Add compatibility with libgit2 0.27.x

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-08-10 09:31:24 +02:00
parent d742203528
commit 64a0bd4c6e
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
3 changed files with 80 additions and 17 deletions

View File

@ -0,0 +1,26 @@
From 8ca3380eac548bc88d262acd6dfd82c5ff676e7b Mon Sep 17 00:00:00 2001
From: Roy Buitenhuis <roy.buitenhuis94@gmail.com>
Date: Wed, 27 Jun 2018 19:12:28 +0200
Subject: [PATCH 1/2] package-config generation bug, wrong format used in
meson.build
---
libgit2-glib/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libgit2-glib/meson.build b/libgit2-glib/meson.build
index bab4f61..62a7eba 100644
--- a/libgit2-glib/meson.build
+++ b/libgit2-glib/meson.build
@@ -220,7 +220,7 @@ pkg.generate(
description: 'libgit2-glib, a a glib wrapper library around the libgit2 git access library.',
filebase: libgit2_glib_api_name,
subdirs: libgit2_glib_api_name,
- requires: 'libgit2 >= @0@, glib-2.0 >= @1@, gobject-2.0 >= @1@, gio-2.0 >= @1@'.format(git2_req, glib_req),
+ requires: ['libgit2 >= ' + git2_req, 'glib-2.0 >= ' + glib_req, 'gobject-2.0 >= ' + glib_req, 'gio-2.0 >= ' + glib_req],
variables: 'exec_prefix=${prefix}',
extra_cflags: extra_args
)
--
2.18.0

View File

@ -0,0 +1,35 @@
From f6d7a149b40a7b131852f4daf8b428bbc993b12e Mon Sep 17 00:00:00 2001
From: Steve Langasek <steve.langasek@ubuntu.com>
Date: Sun, 8 Jul 2018 12:51:22 +0100
Subject: [PATCH 2/2] Compatibility with libgit2 0.27
git_config_add_file_ondisk() now takes an additional (optional) 'repo'
argument. Fix the build failure.
[smcv: Make the API change conditional on LIBGIT2_SOVERSION so we can
build against either version]
Fixes: #1
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903146
Signed-off-by: Simon McVittie <smcv@debian.org>
---
libgit2-glib/ggit-config.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libgit2-glib/ggit-config.c b/libgit2-glib/ggit-config.c
index b6536ce..acdad95 100644
--- a/libgit2-glib/ggit-config.c
+++ b/libgit2-glib/ggit-config.c
@@ -295,6 +295,9 @@ ggit_config_add_file (GgitConfig *config,
ret = git_config_add_file_ondisk (_ggit_native_get (config),
path,
(git_config_level_t)level,
+#if LIBGIT2_SOVERSION >= 27
+ NULL,
+#endif
force);
g_free (path);
--
2.18.0

View File

@ -1,7 +1,7 @@
%if 0%{?rhel} == 7
%global with_python3 0
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with python3
%else
%global with_python3 1
%bcond_without python3
%endif
%global glib2_version 2.44.0
@ -9,30 +9,32 @@
Name: libgit2-glib
Version: 0.26.4
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Git library for GLib
License: LGPLv2+
URL: https://wiki.gnome.org/Projects/Libgit2-glib
Source0: https://download.gnome.org/sources/libgit2-glib/0.26/libgit2-glib-%{version}.tar.xz
Patch0001: 0001-package-config-generation-bug-wrong-format-used-in-m.patch
Patch0002: 0002-Compatibility-with-libgit2-0.27.patch
BuildRequires: meson >= 0.43.0
BuildRequires: gcc
BuildRequires: gtk-doc
BuildRequires: meson
BuildRequires: pkgconfig(gobject-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(gobject-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(gio-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(libgit2) >= %{libgit2_version}
BuildRequires: libssh2-devel
%if %{with_python3}
BuildRequires: pkgconfig(pygobject-3.0)
%if %{with python3}
BuildRequires: pkgconfig(pygobject-3.0) >= 3.0.0
BuildRequires: python3-devel
%endif
BuildRequires: vala
Requires: glib2%{?_isa} >= %{glib2_version}
Requires: libgit2%{?_isa} >= %{libgit2_version}
%if %{with_python3}
%if %{with python3}
# Depend on python3-gobject for the python3 gi overrides directory.
# If we ever get a libgit2-glib consumer that does not depend on python3,
# it would probably make sense to split it to a separate subpackage.
@ -54,13 +56,10 @@ developing applications that use %{name}.
%autosetup -p1
%build
%meson -Dgtk_doc=true \
%if %{with_python3}
-Dpython=true
%else
-Dpython=false
%endif
%meson \
-Dgtk_doc=true \
-Dpython=%{?with_python3:true}%{!?with_python3:false} \
%{nil}
%meson_build
%install
@ -73,7 +72,7 @@ developing applications that use %{name}.
%doc AUTHORS NEWS
%{_libdir}/libgit2-glib-1.0.so.*
%{_libdir}/girepository-1.0/Ggit-1.0.typelib
%if %{with_python3}
%if %{with python3}
%{python3_sitelib}/gi/overrides/*
%endif
@ -86,6 +85,9 @@ developing applications that use %{name}.
%doc %{_datadir}/gtk-doc/
%changelog
* Fri Aug 10 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.26.4-4
- Add compatibility with libgit2 0.27.x
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.26.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild