PerlAlien / Alien-Build

Build external dependencies for use in CPAN
16 stars 25 forks source link

Alien-Libxml2 needs PkgConfig #394

Open mtelka opened 1 year ago

mtelka commented 1 year ago

It looks like Alien-Libxml2 needs PkgConfig to build itself, but such dependency is missing in the package metadata (META.json).

plicease commented 1 year ago

Alien-Libxml2 should work with either PkgConfig.pm, PkgConfig::LibPkfConf or the system pkg-config. Alien-Build will dynamically require PkgConfig.pm if either pkg-config or PkgConfig::LibPkfConf aren't found when it is installed. The alienfile for this alien doesn't directly use PkgConfig, but instead uses the pkg-config negotiator plugin Alien::Build::Plugin::PkgConfig::Negotiate to select the best available implementation for the current platform.

mtelka commented 1 year ago

In my case there was pkg-config installed (but no PkgConfig.pm). The failure is this:

(cd $(BUILD_DIR) ; MAKE=/usr/gnu/bin/make \
                        PATH=/usr/gcc/7/bin/::/usr/bin/amd64:/usr/bin:/usr/gnu/bin:/usr/sbin/amd64:/usr/sbin:/usr/perl5/5.36/bin \
                        LANG="" CC="/usr/gcc/7/bin/gcc" CFLAGS="-m64 -O3" PERL="/usr/perl5/5.36/bin/perl"
                        /usr/perl5/5.36/bin/perl Makefile.PL )
Architecture detection: Unknown archname 'i86pc-solaris-thread-multi-64'. at /usr/perl5/vendor_perl/5.36/Alien/Build/Plugin/Core/Setup.pm line 247.
Could not find an appropriate pkg-config or pkgconf implementation, please install PkgConfig.pm, PkgConfig::LibPkgConf, pkg-config or pkgconf at $(BUILD_DIR)/alienfile line 40.
$ /usr/bin/pkg-config --version
0.29.2
$

Once I installed PkgConfig.pm the build passed.

mtelka commented 1 year ago

There is also 64-bit pkg-config installed, but this should make no difference:

$ /usr/bin/amd64/pkg-config --version
0.29.2
$
plicease commented 1 year ago

Moving this to AB since it is not specific to Alien::Libxml2.

Is pkg-config in the PATH? AB should find it if so. (I would expect /usr/bin to be in the PATH but when you ran it you used the full path).

This is the logic it uses to find pkg-config https://metacpan.org/release/PLICEASE/Alien-Build-2.78/source/lib/Alien/Build/Plugin/PkgConfig/CommandLine.pm#L24-31