aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorLarry Hajali <larryhaja@gmail.com>2020-05-02 09:43:40 -0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-05-03 08:48:37 +0700
commit9083bbe6816559ccaf82e0dba1f4d85aff2a178b (patch)
tree3e29d28209bac4e05b2a020b45a0de7c27b089e8 /misc
parent9adf294b488fe73dab2f1b77819b917331c76976 (diff)
misc/subsurface: Fix building against newer version of libgit2
Signed-off-by: Larry Hajali <larryhaja[at]gmail[dot]com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc')
-rw-r--r--misc/subsurface/libgit2-version.patch54
-rw-r--r--misc/subsurface/subsurface.SlackBuild3
2 files changed, 57 insertions, 0 deletions
diff --git a/misc/subsurface/libgit2-version.patch b/misc/subsurface/libgit2-version.patch
new file mode 100644
index 000000000000..76878e4a863a
--- /dev/null
+++ b/misc/subsurface/libgit2-version.patch
@@ -0,0 +1,54 @@
+commit 67a717dc057a5936ae1f5820fc6c470524213b97
+Author: Dirk Hohndel <dirk@hohndel.org>
+Date: Thu Apr 9 16:59:12 2020 -0700
+
+ cleanup: remove support for ancient versions of libgit2
+
+ We require a minimum of libgit2 0.26.
+
+ Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
+
+diff --git a/INSTALL b/INSTALL
+index 52b05cf2b..321c6cef0 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -97,7 +97,7 @@ Other third party library dependencies
+ --------------------------------------
+
+ In order for our cloud storage to be fully functional you need
+-libgit2 0.23 or newer.
++libgit2 0.26 or newer.
+
+
+ cmake build system
+diff --git a/core/git-access.c b/core/git-access.c
+index 3688cb90c..982a51cfd 100644
+--- a/core/git-access.c
++++ b/core/git-access.c
+@@ -359,11 +359,7 @@ static int try_to_git_merge(git_repository *repo, git_reference **local_p, git_r
+ }
+
+ git_merge_init_options(&merge_options, GIT_MERGE_OPTIONS_VERSION);
+-#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR > 23
+ merge_options.flags = GIT_MERGE_FIND_RENAMES;
+-#else
+- merge_options.tree_flags = GIT_MERGE_TREE_FIND_RENAMES;
+-#endif
+ merge_options.file_favor = GIT_MERGE_FILE_FAVOR_UNION;
+ merge_options.rename_threshold = 100;
+ if (git_commit_lookup(&local_commit, repo, local_id)) {
+diff --git a/core/save-git.c b/core/save-git.c
+index a304e0d94..7bf7b2e1d 100644
+--- a/core/save-git.c
++++ b/core/save-git.c
+@@ -1022,10 +1022,8 @@ int update_git_checkout(git_repository *repo, git_object *parent, git_tree *tree
+
+ static int get_authorship(git_repository *repo, git_signature **authorp)
+ {
+-#if LIBGIT2_VER_MAJOR || LIBGIT2_VER_MINOR >= 20
+ if (git_signature_default(authorp, repo) == 0)
+ return 0;
+-#endif
+ /* try to fetch the user info from the OS, otherwise use default values. */
+ struct user_info user = { .name = NULL, .email = NULL };
+ subsurface_user_info(&user);
diff --git a/misc/subsurface/subsurface.SlackBuild b/misc/subsurface/subsurface.SlackBuild
index c0d02297a3bc..824245515896 100644
--- a/misc/subsurface/subsurface.SlackBuild
+++ b/misc/subsurface/subsurface.SlackBuild
@@ -73,6 +73,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 {} \;
+# Fix building against newer versions of libgit2
+patch -p1 < $CWD/libgit2-version.patch
+
# Ugly hack to avoid header collision between grantlee and grantlee-qt5.
# https://mail.kde.org/pipermail/release-team/2015-August/008911.html
sed -i 's|#include <grantlee_templates.h>|#include "grantlee_templates_local.h"|' \