From 396f765041f2d52d129253150d561916f8c50955 Mon Sep 17 00:00:00 2001 From: Larry Hajali Date: Sat, 2 May 2020 10:19:47 -0700 Subject: [PATCH] libraries/libgit2-glib: build against newer version of libgit2 Signed-off-by: Larry Hajali Signed-off-by: Willy Sudiarto Raharjo --- .../libgit2-glib/detect-libgit2-version.patch | 141 ++++++++++++++++++ .../libgit2-glib/libgit2-glib.SlackBuild | 3 + 2 files changed, 144 insertions(+) create mode 100644 libraries/libgit2-glib/detect-libgit2-version.patch diff --git a/libraries/libgit2-glib/detect-libgit2-version.patch b/libraries/libgit2-glib/detect-libgit2-version.patch new file mode 100644 index 0000000000..5e285c9cff --- /dev/null +++ b/libraries/libgit2-glib/detect-libgit2-version.patch @@ -0,0 +1,141 @@ +diff -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-clone-options.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-clone-options.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-clone-options.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-clone-options.c 2020-05-02 03:01:42.273450898 +0000 +@@ -149,7 +149,7 @@ + + 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 @@ + + 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 -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-config.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-config.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-config.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-config.c 2020-05-02 03:10:08.034437972 +0000 +@@ -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 > 0 || (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 > 0 || (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 > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 27) + NULL, + #endif + force); +diff -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-diff.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-diff.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-diff.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-diff.c 2020-05-02 03:04:17.745446924 +0000 +@@ -786,7 +786,7 @@ + + 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 @@ + } + + 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 -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-error.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-error.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-error.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-error.c 2020-05-02 03:05:09.952445590 +0000 +@@ -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 > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) + git2_err = git_error_last (); + #else + git2_err = giterr_last (); +diff -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-message.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-message.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-message.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-message.c 2020-05-02 03:05:44.877444697 +0000 +@@ -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 > 0 || (LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28) + git_buf_dispose (&buf); + #else + git_buf_free (&buf); +diff -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-patch.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-patch.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-patch.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-patch.c 2020-05-02 03:06:32.489443481 +0000 +@@ -194,7 +194,7 @@ + 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 -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-remote-callbacks.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote-callbacks.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-remote-callbacks.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-remote-callbacks.c 2020-05-02 03:07:14.164442416 +0000 +@@ -160,7 +160,7 @@ + { + 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 -Naur libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-repository.c libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.c +--- libgit2-glib-0.28.0.1.orig/libgit2-glib/ggit-repository.c 2019-04-24 04:18:53.000000000 +0000 ++++ libgit2-glib-0.28.0.1/libgit2-glib/ggit-repository.c 2020-05-02 03:08:08.018441039 +0000 +@@ -1013,7 +1013,7 @@ + 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 @@ + } + + 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/libraries/libgit2-glib/libgit2-glib.SlackBuild b/libraries/libgit2-glib/libgit2-glib.SlackBuild index 6c30ce25b8..037d117b38 100644 --- a/libraries/libgit2-glib/libgit2-glib.SlackBuild +++ b/libraries/libgit2-glib/libgit2-glib.SlackBuild @@ -69,6 +69,9 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +# Build against libgit2 version >= 1.0 +patch -p1 < $CWD/detect-libgit2-version.patch + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ meson build \