tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fix Perl locating wrong libraries when building c-binding modules



Dear all,

I got this patch in my set that I needed to get proper linking of perl
extensions to pkgsrc libraries. I openend 

	https://rt.cpan.org/Public/Bug/Display.html?id=154351

for this issue, sadly without a resolution or recognition from upstream.

Would pkgsrc be fine with me committing this change? Are there
platforms where the disabled chunk would do something useful? (where
locating libfoo.so.3 instead of libfoo.so would suffice to make -lfoo
suceeed in a linker invocation)

Feel free to convince me otherwise … or help me convincing upstream on
this matter;-)

diff -ruN pkgsrc-2025Q1/lang/perl5/Makefile.common pkgsrc/lang/perl5/Makefile.common
--- pkgsrc-2025Q1/lang/perl5/Makefile.common    2025-04-02 05:01:42.000000000 +0200
+++ pkgsrc/lang/perl5/Makefile.common   2025-04-02 16:22:33.000000000 +0200
@@ -8,6 +8,7 @@
 MASTER_SITES=  ${MASTER_SITE_PERL_CPAN:S,/modules/by-module/$,/src/5.0/,}
 DISTFILES+=    ${DISTNAME}${EXTRACT_SUFX}
 EXTRACT_SUFX=  .tar.xz
+PKGREVISION=   1
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      https://www.perl.org/
diff -ruN pkgsrc-2025Q1/lang/perl5/distinfo pkgsrc/lang/perl5/distinfo
--- pkgsrc-2025Q1/lang/perl5/distinfo   2025-04-02 05:01:42.000000000 +0200
+++ pkgsrc/lang/perl5/distinfo  2025-04-07 20:58:12.000000000 +0200
@@ -6,6 +6,7 @@
 SHA1 (patch-Configure) = f3bd324a90254405b3ce8e29846b4ddc9ebf7d73
 SHA1 (patch-Makefile.SH) = 56203aea57c429a94760f039a978463b8859b0a9
 SHA1 (patch-builtin.c) = 7ac5821ab3f4c9ae29d2cbe9db0407560aee2328
+SHA1 (patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_Liblist_Kid.pm) = cbb546ae7ec862e1b117d19324989f559f0b0584
 SHA1 (patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__BeOS.pm) = 79e5aeccfa272ca5ec08bffc616d8053ae90ac51
 SHA1 (patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_MM__Unix.pm) = 6171a21a24e3bea312155b1d5f692d76ef733d23
 SHA1 (patch-cpan_ExtUtils-MakeMaker_t_MM__BeOS.t) = 9b0e7ab85fdab4887b1754599a8879bd7d9f36cc
diff -ruN pkgsrc-2025Q1/lang/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_Liblist_Kid.pm pkgsrc/lang/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_Liblist_Kid.pm
--- pkgsrc-2025Q1/lang/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_Liblist_Kid.pm  1970-01-01 01:00:00.000000000 +0100
+++ pkgsrc/lang/perl5/patches/patch-cpan_ExtUtils-MakeMaker_lib_ExtUtils_Liblist_Kid.pm 2025-04-02 16:22:33.000000000 +0200
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm.orig   2024-07-11 20:19:23.720530530 +0000
++++ cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -129,10 +129,22 @@ sub _unix_os2_ext {
+             # For gcc-2.6.2 on linux (March 1995), DLD can not load
+             # .sa libraries, with the exception of libm.sa, so we
+             # deliberately skip them.
+-            if ((@fullname =
++            #
++            # ThOr: Disable his branch. This locates -ltinfo as
++            # /usr/lib/x86_64-linux-gnu/libtinfo.so.6.4 on a Debian 12 system where
++            # the -dev package is not installed. This is common for binary distros.
++            # This is not something you get by giving -ltinfo to the linker.
++            # It breaks the build of Term::Readline::Gnu, for example, in an
++            # environment where there are more libraries in a custom
++            # prefix, with a proper libncurses.so to be found were it not for the
++            # erroneously found libtinfo from the host system.
++            # On modern GNU/Linux, if libfoo.so is not found without numeric suffix,
++            # it does not _want_ to be found at build-time.
++            #
++            if (0 && ( (@fullname =
+                  $self->lsdir($thispth, "^\Qlib$thislib.$so.\E[0-9]+")) ||
+                 (@fullname =
+-                 $self->lsdir($thispth, "^\Qlib$thislib.\E[0-9]+\Q\.$so"))) {
++                 $self->lsdir($thispth, "^\Qlib$thislib.\E[0-9]+\Q\.$so")) ) ) {
+                 # Take care that libfoo.so.10 wins against libfoo.so.9.
+                 # Compare two libraries to find the most recent version
+                 # number.  E.g.  if you have libfoo.so.9.0.7 and


-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg


Home | Main Index | Thread Index | Old Index