On Fri, Feb 20, 2015 at 8:17 PM, Willem Ferguson < willemfergu...@zoology.up.ac.za> wrote:
> On 19/02/2015 07:02, Miika Turkia wrote: > >> >> >> As supossed, I had a v0.20.0 version built from scratch overlaped with >> the debian package. Cleaned it and the macro worked fine as debian version >> (v0.21.3) has three parameters defined . >> >> I think the wrapper was set to support three parameters because v0.21 >> (at least the one packaged in debian) had only those 3 and fourth was >> introduced later. But agree with you 3 completely different versions of >> the same library function in less than a year is a mess (saying it smooth >> and politely). >> >> On Ubuntu Utopic (14.10) I also have the problem with only 1 parameter > for git_remote _fetch > > #define LIBGIT2_VERSION "0.20.0" > > I use the attached patch on my tree, but never sent it out as I have no > clue about how the libgit versioning/API works. > > miika > > I was away for two weeks and got out of touch with respect to the mess > with libgit2. I run Ubuntu 14.4 and the default version of libgit-dev is > V19. > Does the latest Subsurface master run with libgit2 V19? The first #if in > that file appears to provide for this > > #if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 20 > > but I get make errors as discussed previously on this forum. Upon > applying Miika's patch (above, to git-access.c), I get the following: > > .obj/git-access.o: In function `is_git_repository': > git-access.c:(.text+0x327): undefined reference to `git_remote_fetch' > Looks like this function was introduced on 0.20.0. https://libgit2.github.com/libgit2/#HEAD/group/remote/git_remote_fetch > Is there a sane solution for Debian/Ubuntu? > Try the attached patch. At least it should allow you to compile again. miika
From 738be61a02101a61e70b10abadb410b4dc3d3998 Mon Sep 17 00:00:00 2001 From: Miika Turkia <miika.tur...@gmail.com> Date: Fri, 20 Feb 2015 20:47:10 +0200 Subject: [PATCH] Fix compile for distros with older libgit2 Libgit2 with version older than 0.20.0 do not support git_remote_fetch. (Move also the git_remote_lookup to its own if clause.) Signed-off-by: Miika Turkia <miika.tur...@gmail.com> --- git-access.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/git-access.c b/git-access.c index c79f378..91d266c 100644 --- a/git-access.c +++ b/git-access.c @@ -18,14 +18,18 @@ * the interfaces, often just renaming things without any sane way to know which * version you should check for etc etc. It's a disgrace. */ -#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 20 - #define git_remote_lookup(res, repo, name) git_remote_load(res, repo, name) +#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR < 20 + #define git_remote_fetch(remote, refspecs, signature, reflog) 1 +#elif !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR == 20 #define git_remote_fetch(remote, refspecs, signature, reflog) git_remote_fetch(remote) #elif !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR < 22 - #define git_remote_lookup(res, repo, name) git_remote_load(res, repo, name) #define git_remote_fetch(remote, refspecs, signature, reflog) git_remote_fetch(remote, signature, reflog) #endif +#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR < 22 + #define git_remote_lookup(res, repo, name) git_remote_load(res, repo, name) +#endif + static char *get_local_dir(const char *remote, const char *branch) { SHA_CTX ctx; -- 2.1.0
_______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface