ERROR: Package libgit2 not found

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Mon Nov 10 03:31:41 PST 2014


On Mon, 10 Nov 2014, Cristian Ionescu-Idbohrn wrote:
>
> I wish I had...  Oh well, at least we now know what the problem is and
> how to work around it.  People with better knowledge of pkg-config
> might have some idea.  /usr/lib/x86_64-linux-gnu/pkgconfig/libgit2.pc
> looks like this on my box:
>
> ,----
> | libdir=/usr/lib/x86_64-linux-gnu
> | includedir=/usr/include
> |
> | Name: libgit2
> | Description: The git library, take 2
> | Version: 0.21.2
> | Requires.private:  openssl zlib libssh2
> | Libs.private:  -lhttp_parser -lrt
> | Libs: -L${libdir} -lgit2
> | Cflags: -I${includedir}
> `----
>
> What does that file show on other distributions?

The problem is debian packaging.  There's already a bug filed for
that, as I mentioned in an earlier post.  See
https://bugs.debian.org/768482.

Dug a bit deeper into this.  libgit2.pc seems to follow with the
upstream code.  The "Requires.private" directive should reflect the
manner the library was built.

	$ pkg-config --print-requires-private libgit2

provides a dependency list:

	openssl
	zlib

if libgit2 was built without libssh2 support, and:

	openssl
	zlib
	libssh2

otherwise.

subsurface-configure.pri (arguably) could pick up that list and
validate each one, with:

	$ pkg-config --exists <lib>

If libssh2-dev is missing:

	$ pkg-config --exists libssh2

will fail, and (alternatively):

	$ pkg-config --print-errors --exists libssh2
	Package libssh2 was not found in the pkg-config search path.
	Perhaps you should add the directory containing `libssh2.pc'
	to the PKG_CONFIG_PATH environment variable
	No package 'libssh2' found

will reveal the obvious reason.

Does that sound like an idea worth considering?

That check shouldn't be needed, but until debian bug #768482 is sorted
out it will help many debian (and derivatives) users.  The extra code
added to subsurface-configure.pri would not have any significant
impact on qmake performance.


Cheers,

-- 
Cristian


More information about the subsurface mailing list