From d8e3f880b8772e5d8bb69ab2d6338d96f7ecfe87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 22 Aug 2020 18:11:02 +0700 Subject: [PATCH] libgit2-glib: update to 0.99.0.1. --- .../libgit2-glib/patches/libgit2-1.0.patch | 156 ------------------ .../patches/meson-vapi-link.patch | 11 ++ srcpkgs/libgit2-glib/template | 28 ++-- 3 files changed, 28 insertions(+), 167 deletions(-) delete mode 100644 srcpkgs/libgit2-glib/patches/libgit2-1.0.patch create mode 100644 srcpkgs/libgit2-glib/patches/meson-vapi-link.patch diff --git a/srcpkgs/libgit2-glib/patches/libgit2-1.0.patch b/srcpkgs/libgit2-glib/patches/libgit2-1.0.patch deleted file mode 100644 index 183be9909b..0000000000 --- a/srcpkgs/libgit2-glib/patches/libgit2-1.0.patch +++ /dev/null @@ -1,156 +0,0 @@ -commit bcbd4b6c84779413162f1e7fdd2a4a5329fef04a -Author: q66 -Date: Sun May 3 19:27:40 2020 +0200 - - libgit2 1.0 build fix - -diff --git libgit2-glib/ggit-clone-options.c libgit2-glib/ggit-clone-options.c -index 5e69eec..b47fdb1 100644 ---- libgit2-glib/ggit-clone-options.c -+++ libgit2-glib/ggit-clone-options.c -@@ -149,7 +149,7 @@ create_repository_wrapper (git_repository **out, - - if (error != NULL) - { --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (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 @@ create_remote_wrapper (git_remote **out, - - if (error) - { --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (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 --git libgit2-glib/ggit-config.c libgit2-glib/ggit-config.c -index 626f7f0..58c2bbe 100644 ---- libgit2-glib/ggit-config.c -+++ libgit2-glib/ggit-config.c -@@ -191,7 +191,7 @@ ggit_config_find_global (void) - if (git_config_find_global (&buf) == GIT_OK) - { - path = g_file_new_for_path (buf.ptr); --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); -@@ -224,7 +224,7 @@ ggit_config_find_system (void) - if (git_config_find_system (&buf) == GIT_OK) - { - path = g_file_new_for_path (buf.ptr); --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); -@@ -303,9 +303,7 @@ 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); - -diff --git libgit2-glib/ggit-diff.c libgit2-glib/ggit-diff.c -index 43fa6cf..5189724 100644 ---- libgit2-glib/ggit-diff.c -+++ libgit2-glib/ggit-diff.c -@@ -786,7 +786,7 @@ ggit_diff_format_email (GgitDiff *diff, - - if (ret != GIT_OK) - { --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); -@@ -796,7 +796,7 @@ ggit_diff_format_email (GgitDiff *diff, - } - - retval = g_strndup (buf.ptr, buf.size); --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); -diff --git libgit2-glib/ggit-error.c libgit2-glib/ggit-error.c -index 9247064..dbdaf4e 100644 ---- libgit2-glib/ggit-error.c -+++ libgit2-glib/ggit-error.c -@@ -51,7 +51,7 @@ _ggit_error_set (GError **error, - g_return_if_fail (err < 0); - - /* TODO: add more kind of errors, see git_error_t */ --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git2_err = git_error_last (); - #else - git2_err = giterr_last (); -diff --git libgit2-glib/ggit-message.c libgit2-glib/ggit-message.c -index 7bd6983..4d1b1b8 100644 ---- libgit2-glib/ggit-message.c -+++ libgit2-glib/ggit-message.c -@@ -46,7 +46,7 @@ ggit_message_prettify (const gchar *message, - git_message_prettify (&buf, message, strip_comments, comment_char); - - d = g_strdup (buf.ptr); --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); -diff --git libgit2-glib/ggit-patch.c libgit2-glib/ggit-patch.c -index cd35be7..b544591 100644 ---- libgit2-glib/ggit-patch.c -+++ libgit2-glib/ggit-patch.c -@@ -194,7 +194,7 @@ ggit_patch_to_string (GgitPatch *patch, - if (ret == GIT_OK) - { - result = g_strdup (buf.ptr); --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); -diff --git libgit2-glib/ggit-remote-callbacks.c libgit2-glib/ggit-remote-callbacks.c -index 7956f8b..a1e7b7d 100644 ---- libgit2-glib/ggit-remote-callbacks.c -+++ libgit2-glib/ggit-remote-callbacks.c -@@ -160,7 +160,7 @@ credentials_wrap (git_cred **cred, - { - if (error) - { --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (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 --git libgit2-glib/ggit-repository.c libgit2-glib/ggit-repository.c -index 42490f4..dd9c7d6 100644 ---- libgit2-glib/ggit-repository.c -+++ libgit2-glib/ggit-repository.c -@@ -1013,7 +1013,7 @@ ggit_repository_discover_full (GFile *location, - if (ret == GIT_OK) - { - rep = g_file_new_for_path (buf.ptr); --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); -@@ -3684,7 +3684,7 @@ ggit_repository_get_default_notes_ref (GgitRepository *repository, - } - - ref = g_strdup (buf.ptr); --#if LIBGIT2_SOVERSION >= 28 -+#if LIBGIT2_VER_MAJOR > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) - git_buf_dispose (&buf); - #else - git_buf_free (&buf); diff --git a/srcpkgs/libgit2-glib/patches/meson-vapi-link.patch b/srcpkgs/libgit2-glib/patches/meson-vapi-link.patch new file mode 100644 index 0000000000..768dd4c57a --- /dev/null +++ b/srcpkgs/libgit2-glib/patches/meson-vapi-link.patch @@ -0,0 +1,11 @@ +--- meson_vapi_link.py.orig 2020-08-22 14:36:38.509123984 +0700 ++++ meson_vapi_link.py 2020-08-22 14:37:05.199021653 +0700 +@@ -4,7 +4,7 @@ + import subprocess + import sys + +-vapidir = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], sys.argv[1], 'vala', 'vapi') ++vapidir = os.path.join(os.environ['DESTDIR'] + sys.argv[1], 'vala', 'vapi') + + # FIXME: meson will not track the creation of these files + # https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39 diff --git a/srcpkgs/libgit2-glib/template b/srcpkgs/libgit2-glib/template index 89551f7b75..f94d7e07d8 100644 --- a/srcpkgs/libgit2-glib/template +++ b/srcpkgs/libgit2-glib/template @@ -1,22 +1,30 @@ # Template file for 'libgit2-glib' pkgname=libgit2-glib -version=0.28.0.1 -revision=3 +version=0.99.0.1 +revision=1 build_style=meson build_helper="gir" configure_args="-Dintrospection=$(vopt_if gir true false) - -Dvapi=$(vopt_if vala true false)" -hostmakedepends="pkg-config glib-devel $(vopt_if vala vala)" + -Dvapi=$(vopt_if gir true false)" +hostmakedepends="pkg-config glib-devel $(vopt_if gir vala)" makedepends="libglib-devel libgit2-devel python-gobject-devel" short_desc="Glib wrapper library around libgit2" maintainer="Orphaned " license="LGPL-2.1-or-later" -homepage="https://github.com/GNOME/${pkgname}" +homepage="https://github.com/GNOME/libgit2-glib" distfiles="${homepage}/archive/v${version}.tar.gz" -checksum=c9dd1333ae664f21cec05196cd052169fcd819d6ad8e40e3b9914ef240801408 +checksum=22dccc7aa9ff6f29edf50352b17d58c3f9289ba1cfa7952f70d7feb48676f10c -build_options="gir vala" -build_options_default="gir vala" +build_options="gir" +build_options_default="gir" + +CPPFLAGS="-UG_DISABLE_ASSERT" + +post_patch() { + if [ "$XBPS_TARGET_LIBC" = musl ]; then + vsed -i "s,TEST.*encoding.*,/* & */," tests/repository.c + fi +} libgit2-glib-devel_package() { depends="${sourcepkg}>=${version}_${revision} libglib-devel libgit2-devel" @@ -25,11 +33,9 @@ libgit2-glib-devel_package() { vmove "usr/lib/*.so" vmove usr/include vmove usr/lib/pkgconfig - if [ "$build_option_vala" ]; then - vmove usr/share/vala - fi if [ "$build_option_gir" ]; then vmove usr/share/gir-1.0 + vmove usr/share/vala fi } }