Missing pkg-config name transforms (for libarchive, libcrypto, etc) #13551
Labels
bug
Observed behavior contradicts documented or intended behavior
zig build system
std.Build, the build runner, `zig build` subcommand, package management
Milestone
Zig Version
0.11.0-dev.174+d823680e1
Steps to Reproduce and Observed Behavior
Add
linkSystemLibrary("archive")
tobuild.zig
. Observe that Zig just adds-larchive
without any-L
or-I
flags (it actually doesn't callpkg-config --cflags --libs
) so it fails if libarchive is installed to a non-standard path.Now replace that with
linkSystemLibrary("libarchive")
and pkg-config gets called properly but if you remove pkg-config, you get-llibarchive
which doesn't work.Expected Behavior
For
linkSystemLibrary("archive")
to callpkg-config --cflags --libs libarchive
.linkSystemLibraryPkgConfigOnly("libarchive")
is not a solution because if libarchive is installed in a standard location it should still be linkable without pkg-config, but currently there is no portable way to do this without checking ifpkg-config
is in PATH inbuild.zig
.Currently
lib/std/build.zig
'srunPkgConfig
doesn't support the following "transform kinds" I've seen in the wild (on Homebrew and on Debian):Aside from libxml2, it seems it should be possible to go through the checks that are in place already just also check them for names with added "lib" prefix.
I'd tackle this issue myself but I don't feel like learning how to compile zig from source tonight 🙈
The text was updated successfully, but these errors were encountered: