[packages/libgit2-glib] - updated to 0.99.0.1 - removed obsolete libgit2-1.0 patch - added vapi patches from git

qboosh qboosh at pld-linux.org
Sat Aug 28 07:57:25 CEST 2021


commit 07e34b51676b660992fb027d341703c611f818ba
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Aug 28 08:01:12 2021 +0200

    - updated to 0.99.0.1
    - removed obsolete libgit2-1.0 patch
    - added vapi patches from git

 libgit2-1.0.patch         | 141 -----------------------------------------
 libgit2-glib-vapi20.patch |  26 ++++++++
 libgit2-glib-vapi22.patch | 158 ++++++++++++++++++++++++++++++++++++++++++++++
 libgit2-glib.spec         |  16 +++--
 4 files changed, 194 insertions(+), 147 deletions(-)
---
diff --git a/libgit2-glib.spec b/libgit2-glib.spec
index c77ffc4..cf7cbd6 100644
--- a/libgit2-glib.spec
+++ b/libgit2-glib.spec
@@ -6,13 +6,14 @@
 Summary:	GLib wrapper library around the libgit2 git access library
 Summary(pl.UTF-8):	Biblioteka obudowania GLib do biblioteki dostępu do gita libgit2
 Name:		libgit2-glib
-Version:	0.28.0.1
-Release:	6
+Version:	0.99.0.1
+Release:	1
 License:	LGPL v2.1+
 Group:		Libraries
-Source0:	http://ftp.gnome.org/pub/GNOME/sources/libgit2-glib/0.28/%{name}-%{version}.tar.xz
-# Source0-md5:	04c4cf24291c16406bddb5760449ab52
-Patch0:		libgit2-1.0.patch
+Source0:	https://download.gnome.org/sources/libgit2-glib/0.99/%{name}-%{version}.tar.xz
+# Source0-md5:	0507d588f149f7b002256e5e8e733156
+Patch0:		%{name}-vapi20.patch
+Patch1:		%{name}-vapi22.patch
 URL:		https://wiki.gnome.org/Libgit2-glib
 BuildRequires:	glib2-devel >= 1:2.44.0
 BuildRequires:	gobject-introspection-devel >= 0.10.1
@@ -23,6 +24,8 @@ BuildRequires:	ninja
 BuildRequires:	pkgconfig
 BuildRequires:	python3 >= 1:3.2.3
 BuildRequires:	python3-pygobject3-devel >= 3.0.0
+BuildRequires:	rpm-build >= 4.6
+BuildRequires:	rpmbuild(macros) >= 1.736
 BuildRequires:	tar >= 1:1.22
 BuildRequires:	vala
 BuildRequires:	xz
@@ -104,12 +107,13 @@ API języka Vala do biblioteki libgit2-glib.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %meson build \
 	-Dssh=true \
 	-Dpython=true \
-	-Dgtk_doc=true
+	%{?with_apidocs:-Dgtk_doc=true}
 
 %meson_build -C build
 
diff --git a/libgit2-1.0.patch b/libgit2-1.0.patch
deleted file mode 100644
index fec1f95..0000000
--- a/libgit2-1.0.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-clone-options.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-clone-options.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-clone-options.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-clone-options.c	2020-05-17 00:49:40.395051430 +0200
-@@ -149,7 +149,7 @@
- 
- 	if (error != NULL)
- 	{
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 		git_error_set_str (GIT_ERROR, error->message);
- #else
- 		giterr_set_str (GIT_ERROR, error->message);
-@@ -191,7 +191,7 @@
- 
- 	if (error)
- 	{
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 		git_error_set_str (GIT_ERROR, error->message);
- #else
- 		giterr_set_str (GIT_ERROR, error->message);
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-config.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-config.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-config.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-config.c	2020-05-17 00:50:21.902924233 +0200
-@@ -191,7 +191,7 @@
- 	if (git_config_find_global (&buf) == GIT_OK)
- 	{
- 		path = g_file_new_for_path (buf.ptr);
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 		git_buf_dispose (&buf);
- #else
- 		git_buf_free (&buf);
-@@ -224,7 +224,7 @@
- 	if (git_config_find_system (&buf) == GIT_OK)
- 	{
- 		path = g_file_new_for_path (buf.ptr);
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 		git_buf_dispose (&buf);
- #else
- 		git_buf_free (&buf);
-@@ -303,7 +303,7 @@
- 	ret = git_config_add_file_ondisk (_ggit_native_get (config),
- 	                                  path,
- 	                                  (git_config_level_t)level,
--#if LIBGIT2_SOVERSION >= 27
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 27))
- 	                                  NULL,
- #endif
- 	                                  force);
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-diff.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-diff.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-diff.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-diff.c	2020-05-17 00:50:43.846896752 +0200
-@@ -786,7 +786,7 @@
- 
- 	if (ret != GIT_OK)
- 	{
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 		git_buf_dispose (&buf);
- #else
- 		git_buf_free (&buf);
-@@ -796,7 +796,7 @@
- 	}
- 
- 	retval = g_strndup (buf.ptr, buf.size);
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 	git_buf_dispose (&buf);
- #else
- 	git_buf_free (&buf);
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-error.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-error.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-error.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-error.c	2020-05-17 00:51:04.997513781 +0200
-@@ -51,7 +51,7 @@
- 	g_return_if_fail (err < 0);
- 
- 	/* TODO: add more kind of errors, see git_error_t */
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 	git2_err = git_error_last ();
- #else
- 	git2_err = giterr_last ();
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-message.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-message.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-message.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-message.c	2020-05-17 00:51:12.027719074 +0200
-@@ -46,7 +46,7 @@
- 	git_message_prettify (&buf, message, strip_comments, comment_char);
- 
- 	d = g_strdup (buf.ptr);
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 	git_buf_dispose (&buf);
- #else
- 	git_buf_free (&buf);
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-patch.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-patch.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-patch.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-patch.c	2020-05-17 00:51:18.614578177 +0200
-@@ -194,7 +194,7 @@
- 	if (ret == GIT_OK)
- 	{
- 		result = g_strdup (buf.ptr);
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 		git_buf_dispose (&buf);
- #else
- 		git_buf_free (&buf);
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote-callbacks.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-remote-callbacks.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote-callbacks.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-remote-callbacks.c	2020-05-17 00:52:04.109242895 +0200
-@@ -160,7 +160,7 @@
- 		{
- 			if (error)
- 			{
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 				git_error_set_str (GIT_ERROR, error->message);
- #else
- 				giterr_set_str (GIT_ERROR, error->message);
-diff -ur libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.c libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-repository.c
---- libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.c	2019-04-24 06:18:53.000000000 +0200
-+++ libgit2-glib-0.28.0.1-libgit1/libgit2-glib/ggit-repository.c	2020-05-17 00:52:18.686336953 +0200
-@@ -1013,7 +1013,7 @@
- 	if (ret == GIT_OK)
- 	{
- 		rep = g_file_new_for_path (buf.ptr);
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 		git_buf_dispose (&buf);
- #else
- 		git_buf_free (&buf);
-@@ -3684,7 +3684,7 @@
- 	}
- 
- 	ref = g_strdup (buf.ptr);
--#if LIBGIT2_SOVERSION >= 28
-+#if (LIBGIT2_VER_MAJOR >= 1) || ((LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR >= 28))
- 	git_buf_dispose (&buf);
- #else
- 	git_buf_free (&buf);
diff --git a/libgit2-glib-vapi20.patch b/libgit2-glib-vapi20.patch
new file mode 100644
index 0000000..6f20bc5
--- /dev/null
+++ b/libgit2-glib-vapi20.patch
@@ -0,0 +1,26 @@
+From 7f63349fd0405439532f2ff0896a3697c73ccaaf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny at gentoo.org>
+Date: Thu, 27 Feb 2020 15:20:20 +0100
+Subject: [PATCH] Fix meson_vapi_link.py to respect DESTDIR
+
+Fixes #5
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 6d314b5..3a423b3 100644
+--- a/meson.build
++++ b/meson.build
+@@ -135,7 +135,7 @@ if enable_vapi
+   assert(enable_gir, 'vapi support was requested, but introspection support is mandatory.')
+   assert(add_languages('vala', required: false), 'vapi support was requested, but vala not found.')
+ 
+-  meson.add_install_script('meson_vapi_link.py', libgit2_glib_datadir)
++  meson.add_install_script('meson_vapi_link.py', get_option('datadir'))
+ endif
+ 
+ # Check for libgit2 ssh support
+-- 
+2.24.1
+
diff --git a/libgit2-glib-vapi22.patch b/libgit2-glib-vapi22.patch
new file mode 100644
index 0000000..be22e1e
--- /dev/null
+++ b/libgit2-glib-vapi22.patch
@@ -0,0 +1,158 @@
+From 272024b9370380a538417004d478ef594bd0703c Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Sun, 1 Mar 2020 17:33:12 +0000
+Subject: [PATCH 1/4] meson_vapi_link.py: Don't reset the cwd
+
+We're exiting anyway so it's unnecessary.
+---
+ meson_vapi_link.py | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/meson_vapi_link.py b/meson_vapi_link.py
+index eb64fd6..5b33063 100644
+--- a/meson_vapi_link.py
++++ b/meson_vapi_link.py
+@@ -5,18 +5,14 @@ import subprocess
+ import sys
+ 
+ vapidir = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], sys.argv[1], 'vala', 'vapi')
++os.chdir(vapidir)
+ 
+ # FIXME: meson will not track the creation of these files
+ #        https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
+ old = 'ggit-1.0'
+ new = 'libgit2-glib-1.0'
+ 
+-wd = os.getcwd()
+-os.chdir(vapidir)
+-
+ for ext in ['vapi', 'deps']:
+   src = os.path.join('{}.{}'.format(new, ext))
+   dest = os.path.join('{}.{}'.format(old, ext))
+   subprocess.call(['ln', '-s', '-f', src, dest])
+-
+-os.chdir(wd)
+-- 
+2.24.1
+
+
+From f49f3f5a6cc20f54cdd9001f64912ca4d018ffec Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Sun, 1 Mar 2020 17:33:12 +0000
+Subject: [PATCH 2/4] meson_vapi_link.py: Remove unnecessary os.path.join
+
+We only have one argument, so it does nothing.
+---
+ meson_vapi_link.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson_vapi_link.py b/meson_vapi_link.py
+index 5b33063..58e0f6b 100644
+--- a/meson_vapi_link.py
++++ b/meson_vapi_link.py
+@@ -13,6 +13,6 @@ old = 'ggit-1.0'
+ new = 'libgit2-glib-1.0'
+ 
+ for ext in ['vapi', 'deps']:
+-  src = os.path.join('{}.{}'.format(new, ext))
+-  dest = os.path.join('{}.{}'.format(old, ext))
++  src = '{}.{}'.format(new, ext)
++  dest = '{}.{}'.format(old, ext)
+   subprocess.call(['ln', '-s', '-f', src, dest])
+-- 
+2.24.1
+
+
+From 170e1c31dad2208e3ce659628efdbf0623ebbda7 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Sun, 1 Mar 2020 17:33:12 +0000
+Subject: [PATCH 3/4] meson_vapi_link.py: Improve calculation of vapidir
+
+The script gets the *absolute* datadir passed as its argument. This
+means os.path.join will throw away the MESON_INSTALL_DESTDIR_PREFIX,
+breaking the symlinking when DESTDIR is set.
+
+Also handle the case where the datadir is not inside the prefix by
+prepending the destdir ourselves. We make the datadir relative to the
+root by stripping the drive letter (if any) and the initial separator.
+---
+ meson.build        | 2 +-
+ meson_vapi_link.py | 9 ++++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 3a423b3..6d314b5 100644
+--- a/meson.build
++++ b/meson.build
+@@ -135,7 +135,7 @@ if enable_vapi
+   assert(enable_gir, 'vapi support was requested, but introspection support is mandatory.')
+   assert(add_languages('vala', required: false), 'vapi support was requested, but vala not found.')
+ 
+-  meson.add_install_script('meson_vapi_link.py', get_option('datadir'))
++  meson.add_install_script('meson_vapi_link.py', libgit2_glib_datadir)
+ endif
+ 
+ # Check for libgit2 ssh support
+diff --git a/meson_vapi_link.py b/meson_vapi_link.py
+index 58e0f6b..d7fc729 100644
+--- a/meson_vapi_link.py
++++ b/meson_vapi_link.py
+@@ -4,7 +4,14 @@ import os
+ import subprocess
+ import sys
+ 
+-vapidir = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], sys.argv[1], 'vala', 'vapi')
++datadir = sys.argv[1]
++
++destdir = os.environ.get('DESTDIR')
++if destdir:
++    datadir = os.path.splitdrive(datadir)[1].lstrip(os.path.sep)
++    datadir = os.path.join(destdir, datadir)
++
++vapidir = os.path.join(datadir, 'vala', 'vapi')
+ os.chdir(vapidir)
+ 
+ # FIXME: meson will not track the creation of these files
+-- 
+2.24.1
+
+
+From 29db98df0f65519bbcc9827253b0849ce7fb741c Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Sun, 1 Mar 2020 17:33:12 +0000
+Subject: [PATCH 4/4] meson_vapi_link.py: Use python's own utils instead of
+ calling 'ln'
+
+Replace the use of 'ln' with os.symlink. Since subprocess.call does not
+raise any exception when the called process fails, this script likely
+silently did nothing on Windows. Instead, fall back to using shutil.copy
+to copy instead of symlinking.
+---
+ meson_vapi_link.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/meson_vapi_link.py b/meson_vapi_link.py
+index d7fc729..db1e4e8 100644
+--- a/meson_vapi_link.py
++++ b/meson_vapi_link.py
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env python3
+ 
+ import os
+-import subprocess
++import shutil
+ import sys
+ 
+ datadir = sys.argv[1]
+@@ -22,4 +22,7 @@ new = 'libgit2-glib-1.0'
+ for ext in ['vapi', 'deps']:
+   src = '{}.{}'.format(new, ext)
+   dest = '{}.{}'.format(old, ext)
+-  subprocess.call(['ln', '-s', '-f', src, dest])
++  try:
++      os.symlink(src, dest)
++  except OSError:
++      shutil.copy(src, dest)
+-- 
+2.24.1
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libgit2-glib.git/commitdiff/07e34b51676b660992fb027d341703c611f818ba



More information about the pld-cvs-commit mailing list