On Mon, 05 Aug 2024 19:40:13 +0200, Helmut Grohne wrote: > libnet-z3950-zoom-perl fails to cross build from source, because > Makefile.PL hard codes the build architecture pkg-config and thus fails > finding yaz, which is only requested for the host architecture.
Oh dear. I was happy when this upstream release changed the Makefile.PL because I could drop our patch [0] which replaced yaz-config with pkgconf -- indirectly via ExtUtils::PkgConfig. Do you know if 1.30-4 was cross-buildable? Seems we have to patch Makefile.PL again. > There is > no really good mechanism to solve this at the time of this writing, but > making pkg-config substitutable via the environment variable PKG_CONFIG > and correctly substituting it is common in other build systems. I'm > attaching a patch for your convenience. If you see a way to derive the > toolchain prefix from the perl configuration module, that would be a > better way. I played around a bit: - crosscompiled the package as is from amd64->i386 (with pbuilder's --host-arch) and it failed - created a patch similar to [0] using ExtUtils::PkgConfig [1] - crossbuilding fails with: The following packages have unmet dependencies: builddeps:/build/libnet-z3950-zoom-perl_1.32-1.dsc:i386 : Depends: debhelper-compat:i386 (= 13) Depends: libextutils-pkgconfig-perl:i386 but it is not installable E: Unable to correct problems, you have held broken packages. Hm, does libextutils-pkgconfig-perl (arch:all) need "Multi-Arch: foreign"? Without libextutils-pkgconfig-perl the build of course fails with /usr/bin/perl -I/usr/lib/i386-linux-gnu/perl/cross-config-5.38.2 Makefile.PL INSTALLDIRS=vendor "OPTIMIZE=-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/libnet-z3950-zoom-perl-1.32=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "LD=i686-linux-gnu-gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/libnet-z3950-zoom-perl-1.32=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wl,-z,now" Can't locate ExtUtils/PkgConfig.pm in @INC (you may need to install the ExtUtils::PkgConfig module) (@INC entries checked: /usr/lib/i386-linux-gnu/perl/cross-config-5.38.2 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.38.2 /usr/local/share/perl/5.38.2 /usr/lib/x86_64-linux-gnu/perl5/5.38 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.38 /usr/share/perl/5.38 /usr/local/lib/site_perl) at Makefile.PL line 12. If I put ExtUtils::PkgConfig manually into ./ExtUtils/PkgConfig.pm and run the Makefile.PL call from above manually with an additional -I. I get: # /usr/bin/perl -I. -I/usr/lib/i386-linux-gnu/perl/cross-config-5.38.2 Makefile.PL INSTALLDIRS=vendor "OPTIMIZE=-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/libnet-z3950-zoom-perl-1.32=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" "LD=i686-linux-gnu-gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/libnet-z3950-zoom-perl-1.32=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wl,-z,now" Package yaz was not found in the pkg-config search path. Perhaps you should add the directory containing `yaz.pc' to the PKG_CONFIG_PATH environment variable Package 'yaz', required by 'virtual:world', not found Package yaz was not found in the pkg-config search path. Perhaps you should add the directory containing `yaz.pc' to the PKG_CONFIG_PATH environment variable Package 'yaz', required by 'virtual:world', not found Package yaz was not found in the pkg-config search path. Perhaps you should add the directory containing `yaz.pc' to the PKG_CONFIG_PATH environment variable Package 'yaz', required by 'virtual:world', not found … A bit better but /usr/lib/i386-linux-gnu/pkgconfig/yaz.pc is apparently not found. And in the end ExtUtils::PkgConfig just calls `pkg-config`, so any prefix would need to be found and added there. Alright, sorry for the detour :) So it looks your patch it will be, unless someone has another idea. PS: The same applies to libnet-z3950-simpleserver-perl Cheers, gregor [0] https://sources.debian.org/src/libnet-z3950-zoom-perl/1.30-4/debian/patches/pkg-config.patch/ [1] #+ --- a/Makefile.PL +++ b/Makefile.PL @@ -8,15 +8,14 @@ my $yazver; my $yazinc; my $yazlibs; -system("pkg-config --exists yaz"); -if ($? == 0) { - $yazver = `pkg-config --modversion yaz` or die $!; - $yazinc = `pkg-config --cflags yaz` or die $!; - $yazlibs = `pkg-config --libs yaz` or die $!; -} else { - $yazver = `yaz-config --version`; - $yazinc = `yaz-config --cflags servers`; - $yazlibs = `yaz-config --libs server`; + +use ExtUtils::PkgConfig; + +my $package = "yaz"; +my $yazver = ExtUtils::PkgConfig->modversion($package); +my $yazinc = ExtUtils::PkgConfig->cflags($package); +my $yazlibs = ExtUtils::PkgConfig->libs($package); + if (!$yazver || (!$yazinc && !$yazlibs)) { die qq[ ERROR: Unable to call script: yaz-config @@ -25,7 +24,6 @@ SimpleServer module. ]; } -} chomp($yazver); check_version($yazver, "4.0.0"); #- -- .''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06 `. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe `-
signature.asc
Description: Digital Signature