[PATCH] main.cpp: fix broken build for libgit2 0.21

Lubomir I. Ivanov neolit123 at gmail.com
Sun Dec 7 04:37:04 PST 2014


On 7 December 2014 at 04:39, Thiago Macieira <thiago at macieira.org> wrote:
> On Sunday 07 December 2014 02:15:33 Lubomir I. Ivanov wrote:
>> On 7 December 2014 at 00:42, Thiago Macieira <thiago at macieira.org> wrote:
>> > On Saturday 06 December 2014 15:49:57 Lubomir I. Ivanov wrote:
>> >> +#if !LIBGIT2_VER_MAJOR && LIBGIT2_VER_MINOR <= 20 &&
>> >> !defined(USE_LIBGIT21_API) git_threads_init();
>> >> +#else
>> >> +       git_libgit2_init();
>> >> +#endif
>> >
>> > Conditional is broken
>>
>> does it break the build for you?
>
> Yes.
>
> ../../src/subsurface/main.cpp: In function ‘int main(int, char**)’:
> ../../src/subsurface/main.cpp:48:19: error: ‘git_libgit2_init’ was not
> declared in this scope
>
>
>> > The API changed for libgit2 0.22, not in 0.21.
>>

ok, i see. looks like i got confused here.

>> odd, can't find such a thing as 0.22 in version.h or in their tags.
>> is the current master *actual* version hidden in some way, while 0.21
>> is displayed in both git and the source?
>
> It's past the 0.21 tag, which means the change happened for version 0.22.
> More
> importantly, anyone installing the tagged and released versions 0.21, 0.21.1
> and 0.21.2 now has their builds broken.
>

0.21 works for me with the current "solution".
is the attached patch the fix you are looking for?; if not perhaps you
can send a patch yourself.

BTW, they have releases marked 0.21.1, 0.21.2, but version.h doesn't
reflect it in master - it's at 0.21.0

just downloaded this:
https://launchpad.net/ubuntu/+source/libgit2/0.21.2-2
and version.h is 0.21.2 there, which means that these newer tagged
releases happen from other branches and makes checking for the RELEASE
digit unreliable, say if the user is using the master branch to build.

lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-main.cpp-rework-the-libgit2-version-check.patch
Type: application/octet-stream
Size: 815 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20141207/ac3819e4/attachment.obj>


More information about the subsurface mailing list