Bug#813252: pkg-config --libs libgit2 should include -lhttp_parser too

2016-03-27 Thread Josh Triplett
Control: tags -1 + moreinfo

On Sat, 30 Jan 2016 23:18:28 +0100 Giuseppe Bilotta 
 wrote:
> Package: libgit2-dev
> Version: 0.23.1-1+b1
> Severity: important
> 
> libgit2 depends on libhttp-parser, and libgit2-dev depends on
> libhttp-parser-dev. However, the pkg-config information for libgit2 does
> not include -lhttp_parser among the needed libraries, hence trying to
> compile a program that depends on libgit2 using $(pkg-config --libs
> libgit2) to get the compile flags will fail due to undefined references
> to http_parser_init and http_parser_execute methods.
> 
> This should be trivial to fix, by moving -lhttp_parser from the
> Libs.private to the Libs field in the .pc file.

Are you trying to link statically or dynamically?

If you're trying to link dynamically, the libgit2 dynamic library
already depends on libhttp_parser at runtime.  libgit2 doesn't directly
expose any symbols or types from libhttp_parser, so callers of libgit2
don't need to care that it uses libhttp_parser internally.  So, you
shouldn't pass -lhttp_parser unless you directly call symbols from
libhttp_parser yourself.  Doing so would introduce an unnecessary
dependency in your program or library, which (among other problems)
complicates transitions.

If you're trying to link statically, you need to use $(pkg-config
--static --libs libgit2) , which produces the following here:

-lgit2 -lcurl -lhttp_parser -lssh2 -lrt -lz



Bug#813252: pkg-config --libs libgit2 should include -lhttp_parser too

2016-01-30 Thread Giuseppe Bilotta
Package: libgit2-dev
Version: 0.23.1-1+b1
Severity: important

libgit2 depends on libhttp-parser, and libgit2-dev depends on
libhttp-parser-dev. However, the pkg-config information for libgit2 does
not include -lhttp_parser among the needed libraries, hence trying to
compile a program that depends on libgit2 using $(pkg-config --libs
libgit2) to get the compile flags will fail due to undefined references
to http_parser_init and http_parser_execute methods.

This should be trivial to fix, by moving -lhttp_parser from the
Libs.private to the Libs field in the .pc file.


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libgit2-dev depends on:
ii  libcurl4-openssl-dev   7.47.0-1
ii  libgit2-23 0.23.1-1+b1
ii  libhttp-parser-dev 2.1-2
ii  libssh2-1-dev  1.5.0-2+b1
ii  libssl-dev 1.0.2f-2
ii  zlib1g-dev [libz-dev]  1:1.2.8.dfsg-2+b1

libgit2-dev recommends no packages.

libgit2-dev suggests no packages.

-- no debconf information