diff --git a/vlib/v/pkgconfig/pkgconfig.v b/vlib/v/pkgconfig/pkgconfig.v index 54a1d673bb..a05017247c 100644 --- a/vlib/v/pkgconfig/pkgconfig.v +++ b/vlib/v/pkgconfig/pkgconfig.v @@ -70,7 +70,7 @@ fn (mut pc PkgConfig) parse_list(s string) []string { } fn (mut pc PkgConfig) parse_line(s string) string { - mut r := s.trim_space() + mut r := s.split('#')[0] for r.contains('\${') { tok0 := r.index('\${') or { break } mut tok1 := r[tok0..].index('}') or { break } diff --git a/vlib/v/pkgconfig/test_samples/hogweed.pc b/vlib/v/pkgconfig/test_samples/hogweed.pc new file mode 100644 index 0000000000..fa3704f036 --- /dev/null +++ b/vlib/v/pkgconfig/test_samples/hogweed.pc @@ -0,0 +1,19 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +# Uses Requires.private and Libs.private, under the assumption that +# when using shared libraries, the ELF dependencies from libhogweed.so +# to nettle and gmp work. + +Name: Hogweed +Description: Nettle low-level cryptographic library (public-key algorithms) +URL: http://www.lysator.liu.se/~nisse/nettle +Version: 3.8 +Requires: # nettle +Requires.private: nettle +Libs: -L${libdir} -lhogweed # -lgmp +Libs.private: -lgmp +Cflags: -I${includedir} + diff --git a/vlib/v/pkgconfig/test_samples/nettle.pc b/vlib/v/pkgconfig/test_samples/nettle.pc new file mode 100644 index 0000000000..5c212f368f --- /dev/null +++ b/vlib/v/pkgconfig/test_samples/nettle.pc @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Nettle +Description: Nettle low-level cryptographic library (symmetric algorithms) +URL: http://www.lysator.liu.se/~nisse/nettle +Version: 3.8 +Libs: -L${libdir} -lnettle +Cflags: -I${includedir}