openpkg/perl.patch

changeset 428
f880f219c566
parent 14
0cd2ee160ef5
child 431
127559aa0c5e
     1.1 --- a/openpkg/perl.patch	Tue Jul 31 12:12:54 2012 +0200
     1.2 +++ b/openpkg/perl.patch	Tue Jul 31 12:23:42 2012 +0200
     1.3 @@ -4,123 +4,29 @@
     1.4  area is.
     1.5  
     1.6  Index: installperl
     1.7 ---- installperl.orig	2006-08-15 14:37:41 +0200
     1.8 -+++ installperl	2006-08-18 21:05:05 +0200
     1.9 -@@ -211,6 +211,8 @@
    1.10 - my $installarchlib = "$destdir$Config{installarchlib}";
    1.11 - my $installsitelib = "$destdir$Config{installsitelib}";
    1.12 - my $installsitearch = "$destdir$Config{installsitearch}";
    1.13 -+my $installvendorlib = "$destdir$Config{installvendorlib}";
    1.14 -+my $installvendorarch = "$destdir$Config{installvendorarch}";
    1.15 - my $installman1dir = "$destdir$Config{installman1dir}";
    1.16 +--- installperl.orig	2011-06-09 22:04:29.000000000 +0200
    1.17 ++++ installperl	2011-06-17 15:20:48.000000000 +0200
    1.18 +@@ -200,6 +200,8 @@
    1.19 + my $installarchlib = "$opts{destdir}$Config{installarchlib}";
    1.20 + my $installsitelib = "$opts{destdir}$Config{installsitelib}";
    1.21 + my $installsitearch = "$opts{destdir}$Config{installsitearch}";
    1.22 ++my $installvendorlib = "$opts{destdir}$Config{installvendorlib}";
    1.23 ++my $installvendorarch = "$opts{destdir}$Config{installvendorarch}";
    1.24 + my $installman1dir = "$opts{destdir}$Config{installman1dir}";
    1.25   my $man1ext = $Config{man1ext};
    1.26   my $libperl = $Config{libperl};
    1.27 -@@ -372,6 +374,8 @@
    1.28 - mkpath($installarchlib, $verbose, 0777);
    1.29 - mkpath($installsitelib, $verbose, 0777) if ($installsitelib);
    1.30 - mkpath($installsitearch, $verbose, 0777) if ($installsitearch);
    1.31 -+mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib);
    1.32 -+mkpath($installvendorarch, $verbose, 0777) if ($installvendorarch);
    1.33 +@@ -349,6 +351,8 @@
    1.34 + mkpath($installarchlib, $opts{verbose}, 0777);
    1.35 + mkpath($installsitelib, $opts{verbose}, 0777) if ($installsitelib);
    1.36 + mkpath($installsitearch, $opts{verbose}, 0777) if ($installsitearch);
    1.37 ++mkpath($installvendorlib, $opts{verbose}, 0777) if ($installvendorlib);
    1.38 ++mkpath($installvendorarch, $opts{verbose}, 0777) if ($installvendorarch);
    1.39   
    1.40   if (chdir "lib") {
    1.41       $do_installarchlib = ! samepath($installarchlib, '.');
    1.42  
    1.43  -----------------------------------------------------------------------------
    1.44  
    1.45 -By default, the Perl module search order is "use lib, -I, PERL[5]LIB,
    1.46 -perl, site, vendor, other". This means that in OpenPKG both the modules
    1.47 -installed via CPAN shell (in "site" area) and the "perl-xxx" packages
    1.48 -(in "vendor" area) cannot override the (sometimes obsoleted) module
    1.49 -versions distributed with Perl (in "perl" area). Hence, we change
    1.50 -the search order to a more reasonable one for OpenPKG: "use lib, -I,
    1.51 -PERL[5]LIB, site, vendor, perl, other".
    1.52 -
    1.53 -Index: perl.c
    1.54 ---- perl.c.orig	2006-08-15 14:37:41 +0200
    1.55 -+++ perl.c	2006-08-18 21:08:14 +0200
    1.56 -@@ -4753,39 +4753,6 @@
    1.57 -     incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE);
    1.58 - #endif
    1.59 - 
    1.60 --#ifdef ARCHLIB_EXP
    1.61 --    incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
    1.62 --#endif
    1.63 --#ifdef MACOS_TRADITIONAL
    1.64 --    {
    1.65 --	Stat_t tmpstatbuf;
    1.66 --    	SV * privdir = newSV(0);
    1.67 --	char * macperl = PerlEnv_getenv("MACPERL");
    1.68 --	
    1.69 --	if (!macperl)
    1.70 --	    macperl = "";
    1.71 --	
    1.72 --	Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
    1.73 --	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
    1.74 --	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
    1.75 --	Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
    1.76 --	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
    1.77 --	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
    1.78 --	
    1.79 --   	SvREFCNT_dec(privdir);
    1.80 --    }
    1.81 --    if (!PL_tainting)
    1.82 --	incpush(":", FALSE, FALSE, TRUE, FALSE);
    1.83 --#else
    1.84 --#ifndef PRIVLIB_EXP
    1.85 --#  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
    1.86 --#endif
    1.87 --#if defined(WIN32)
    1.88 --    incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
    1.89 --#else
    1.90 --    incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
    1.91 --#endif
    1.92 --
    1.93 - #ifdef SITEARCH_EXP
    1.94 -     /* sitearch is always relative to sitelib on Windows for
    1.95 -      * DLL-based path intuition to work correctly */
    1.96 -@@ -4828,6 +4795,39 @@
    1.97 -     incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
    1.98 - #endif
    1.99 - 
   1.100 -+#ifdef ARCHLIB_EXP
   1.101 -+    incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
   1.102 -+#endif
   1.103 -+#ifdef MACOS_TRADITIONAL
   1.104 -+    {
   1.105 -+	Stat_t tmpstatbuf;
   1.106 -+    	SV * privdir = newSV(0);
   1.107 -+	char * macperl = PerlEnv_getenv("MACPERL");
   1.108 -+	
   1.109 -+	if (!macperl)
   1.110 -+	    macperl = "";
   1.111 -+	
   1.112 -+	Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
   1.113 -+	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
   1.114 -+	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
   1.115 -+	Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl);
   1.116 -+	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
   1.117 -+	    incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE);
   1.118 -+	
   1.119 -+   	SvREFCNT_dec(privdir);
   1.120 -+    }
   1.121 -+    if (!PL_tainting)
   1.122 -+	incpush(":", FALSE, FALSE, TRUE, FALSE);
   1.123 -+#else
   1.124 -+#ifndef PRIVLIB_EXP
   1.125 -+#  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
   1.126 -+#endif
   1.127 -+#if defined(WIN32)
   1.128 -+    incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
   1.129 -+#else
   1.130 -+    incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
   1.131 -+#endif
   1.132 -+
   1.133 - #ifdef PERL_OTHERLIBDIRS
   1.134 -     incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE);
   1.135 - #endif
   1.136 -
   1.137 ------------------------------------------------------------------------------
   1.138 -
   1.139  Port to [Open]Darwin 6.6.2:
   1.140  
   1.141  1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not
   1.142 @@ -135,19 +41,30 @@
   1.143     related to the non-standard "__private_extern__" attribute.
   1.144  
   1.145  Index: hints/darwin.sh
   1.146 ---- hints/darwin.sh.orig	2006-08-15 14:37:41 +0200
   1.147 -+++ hints/darwin.sh	2006-08-18 21:05:05 +0200
   1.148 -@@ -120,9 +120,6 @@
   1.149 -   *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;;
   1.150 - esac
   1.151 - 
   1.152 --# Avoid Apple's cpp precompiler, better for extensions
   1.153 --cppflags="${cppflags} -no-cpp-precomp"
   1.154 --
   1.155 - # This is necessary because perl's build system doesn't
   1.156 - # apply cppflags to cc compile lines as it should.
   1.157 - ccflags="${ccflags} ${cppflags}"
   1.158 -@@ -182,8 +179,7 @@
   1.159 +--- hints/darwin.sh.orig	2011-09-19 15:18:22.000000000 +0200
   1.160 ++++ hints/darwin.sh	2011-12-24 12:00:58.000000000 +0100
   1.161 +@@ -181,6 +181,20 @@
   1.162 +    ldflags="${ldflags} -flat_namespace"
   1.163 +    lddlflags="${ldflags} -bundle -undefined suppress"
   1.164 +    ;;
   1.165 ++9.*)
   1.166 ++   lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
   1.167 ++   case "$ld" in
   1.168 ++       *MACOSX_DEVELOPMENT_TARGET*) ;;
   1.169 ++       *) ld="env MACOSX_DEPLOYMENT_TARGET=10.5 ${ld}" ;;
   1.170 ++   esac
   1.171 ++   ;;
   1.172 ++10.*)
   1.173 ++   lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
   1.174 ++   case "$ld" in
   1.175 ++       *MACOSX_DEVELOPMENT_TARGET*) ;;
   1.176 ++       *) ld="env MACOSX_DEPLOYMENT_TARGET=10.6 ${ld}" ;;
   1.177 ++   esac
   1.178 ++   ;;
   1.179 + *) 
   1.180 +    lddlflags="${ldflags} -bundle -undefined dynamic_lookup"
   1.181 +    case "$ld" in
   1.182 +@@ -191,8 +205,7 @@
   1.183   esac
   1.184   ldlibpthname='DYLD_LIBRARY_PATH';
   1.185   
   1.186 @@ -157,24 +74,13 @@
   1.187   
   1.188   cat > UU/archname.cbu <<'EOCBU'
   1.189   # This script UU/archname.cbu will get 'called-back' by Configure 
   1.190 -Index: perlio.c
   1.191 ---- perlio.c.orig	2006-08-15 14:37:41 +0200
   1.192 -+++ perlio.c	2006-08-18 21:05:05 +0200
   1.193 -@@ -472,7 +472,14 @@
   1.194 - #include <unistd.h>
   1.195 - #endif
   1.196 - #ifdef HAS_MMAP
   1.197 -+#ifdef PERL_DARWIN
   1.198 -+#define environ_safe environ
   1.199 -+#undef environ
   1.200 - #include <sys/mman.h>
   1.201 -+#define environ environ_safe
   1.202 -+#else
   1.203 -+#include <sys/mman.h>
   1.204 -+#endif
   1.205 - #endif
   1.206 - 
   1.207 - void
   1.208 +@@ -326,3 +339,6 @@
   1.209 + # makefile in the same place.  Since Darwin uses GNU make, this dodges
   1.210 + # the problem.
   1.211 + firstmakefile=GNUmakefile;
   1.212 ++
   1.213 ++usenm='false'
   1.214 ++
   1.215  
   1.216  -----------------------------------------------------------------------------
   1.217  
   1.218 @@ -187,8 +93,8 @@
   1.219  it works at all.
   1.220  
   1.221  Index: hints/dec_osf.sh
   1.222 ---- hints/dec_osf.sh.orig	2007-12-18 11:47:07 +0100
   1.223 -+++ hints/dec_osf.sh	2007-12-19 12:31:37 +0100
   1.224 +--- hints/dec_osf.sh.orig	2011-06-17 02:06:09.000000000 +0200
   1.225 ++++ hints/dec_osf.sh	2011-06-17 15:20:48.000000000 +0200
   1.226  @@ -73,15 +73,6 @@
   1.227   *)            if $test "X$optimize" = "X$undef"; then
   1.228                         lddlflags="$lddlflags -msym"
   1.229 @@ -208,27 +114,32 @@
   1.230  
   1.231  -----------------------------------------------------------------------------
   1.232  
   1.233 +Linker flag change for Solaris.
   1.234 +
   1.235  Index: Configure
   1.236 ---- Configure.orig	2006-08-15 14:37:40 +0200
   1.237 -+++ Configure	2006-08-18 21:05:05 +0200
   1.238 -@@ -7871,7 +7871,7 @@
   1.239 +--- Configure.orig	2011-06-09 22:04:29.000000000 +0200
   1.240 ++++ Configure	2011-06-17 15:20:48.000000000 +0200
   1.241 +@@ -8078,9 +8058,9 @@
   1.242   			      ;;
   1.243   			linux|irix*|gnu*)  dflt="-shared $optimize" ;;
   1.244   			next)  dflt='none' ;;
   1.245  -			solaris) dflt='-G' ;;
   1.246  +			solaris) dflt='-shared' ;;
   1.247   			sunos) dflt='-assert nodefinitions' ;;
   1.248 - 			svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
   1.249 +-			svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
   1.250 ++			svr4*|esix*|nonstopux) dflt="-shared $ldflags" ;;
   1.251   	        *)     dflt='none' ;;
   1.252 + 			esac
   1.253 + 			;;
   1.254  
   1.255  -----------------------------------------------------------------------------
   1.256  
   1.257  Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl)
   1.258  
   1.259  Index: sv.c
   1.260 ---- sv.c.orig	2006-08-15 14:37:41 +0200
   1.261 -+++ sv.c	2006-08-18 21:05:05 +0200
   1.262 -@@ -8667,7 +8667,10 @@
   1.263 +--- sv.c.orig	2011-06-17 02:06:09.000000000 +0200
   1.264 ++++ sv.c	2011-06-17 15:20:48.000000000 +0200
   1.265 +@@ -10198,7 +10198,10 @@
   1.266   	if ( (width = expect_number(&q)) ) {
   1.267   	    if (*q == '$') {
   1.268   		++q;
   1.269 @@ -243,17 +154,106 @@
   1.270  
   1.271  -----------------------------------------------------------------------------
   1.272  
   1.273 -Corrections for Solaris 11:
   1.274 +Do not use -fstack-protector as it causes too much portability issues.
   1.275  
   1.276 -Index: perl.h
   1.277 -diff -Nau perl.h.orig perl.h
   1.278 ---- perl.h.orig	2007-12-18 11:47:08.000000000 +0100
   1.279 -+++ perl.h	2009-01-06 15:28:45.843276063 +0100
   1.280 -@@ -1393,6 +1393,7 @@
   1.281 -  */
   1.282 +Index: Configure
   1.283 +--- Configure.orig	2011-06-09 22:04:29.000000000 +0200
   1.284 ++++ Configure	2011-06-17 15:20:48.000000000 +0200
   1.285 +@@ -5158,17 +5158,6 @@
   1.286 + 		;;
   1.287 + 	esac
   1.288   
   1.289 - #if defined(I_SYSMODE) && !defined(PERL_MICRO)
   1.290 -+#include <sys/vnode.h>
   1.291 - #include <sys/mode.h>
   1.292 - #endif
   1.293 +-	# on x86_64 (at least) we require an extra library (libssp) in the
   1.294 +-	# link command line. This library is not named, so I infer that it is
   1.295 +-	# an implementation detail that may change. Hence the safest approach
   1.296 +-	# is to add the flag to the flags passed to the compiler at link time,
   1.297 +-	# as that way the compiler can do the right implementation dependant
   1.298 +-	# thing. (NWC)
   1.299 +-	case "$gccversion" in
   1.300 +-	?*)	set stack-protector -fstack-protector
   1.301 +-		eval $checkccflag
   1.302 +-		;;
   1.303 +-	esac
   1.304 + 	;;
   1.305 + esac
   1.306   
   1.307 +@@ -5307,15 +5296,6 @@
   1.308 + 	;;
   1.309 + *) dflt="$ldflags";;
   1.310 + esac
   1.311 +-# See note above about -fstack-protector
   1.312 +-case "$ccflags" in
   1.313 +-*-fstack-protector*) 
   1.314 +-	case "$dflt" in
   1.315 +-	*-fstack-protector*) ;; # Don't add it again
   1.316 +-	*) dflt="$dflt -fstack-protector" ;; 
   1.317 +-	esac
   1.318 +-	;;
   1.319 +-esac
   1.320 + 
   1.321 + : Try to guess additional flags to pick up local libraries.
   1.322 + for thislibdir in $libpth; do
   1.323 +@@ -8107,14 +8087,6 @@
   1.324 + 	''|' ') dflt='none' ;;
   1.325 + 	esac
   1.326 + 
   1.327 +-	case "$ldflags" in
   1.328 +-	*-fstack-protector*)
   1.329 +-	    case "$dflt" in
   1.330 +-			*-fstack-protector*) ;; # Don't add it again
   1.331 +-			*) dflt="$dflt -fstack-protector" ;; 
   1.332 +-		esac
   1.333 +-		;;
   1.334 +-	esac
   1.335 + 
   1.336 + 
   1.337 +     rp="Any special flags to pass to $ld to create a dynamically loaded library?"
   1.338 +
   1.339 +-----------------------------------------------------------------------------
   1.340 +
   1.341 +Make sure we install into <prefix>/lib/perl/ and not <prefix>/lib/perl5/
   1.342 +
   1.343 +Index: Configure
   1.344 +--- Configure.orig	2009-08-24 18:33:49 +0200
   1.345 ++++ Configure	2009-08-24 18:44:39 +0200
   1.346 +@@ -1769,7 +1769,7 @@
   1.347 + touch posthint.sh
   1.348 + 
   1.349 + : set package name
   1.350 +-package='perl5'
   1.351 ++package='perl'
   1.352 + first=`echo $package | sed -e 's/^\(.\).*/\1/'`
   1.353 + last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
   1.354 + case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
   1.355 +
   1.356 +-----------------------------------------------------------------------------
   1.357 +
   1.358 +Linking against just libgdbm_compat under at least SUSE fails 
   1.359 +because it also needs libgdbm (which Perl doesn't pick up, too)
   1.360 +
   1.361 +Index: hints/linux.sh
   1.362 +--- hints/linux.sh.orig	2011-06-09 22:04:29.000000000 +0200
   1.363 ++++ hints/linux.sh	2011-06-17 15:20:48.000000000 +0200
   1.364 +@@ -55,7 +55,9 @@
   1.365 + libswanted="$*"
   1.366 + 
   1.367 + # Debian 4.0 puts ndbm in the -lgdbm_compat library.
   1.368 +-libswanted="$libswanted gdbm_compat"
   1.369 ++if [ -f /etc/debian_version -o -f /etc/ubuntu_version ]; then
   1.370 ++    libswanted="$libswanted gdbm_compat"
   1.371 ++fi
   1.372 + 
   1.373 + # If you have glibc, then report the version for ./myconfig bug reporting.
   1.374 + # (Configure doesn't need to know the specific version since it just uses
   1.375 +
   1.376 +Index: Configure
   1.377 +--- Configure.orig	2012-05-31 14:59:16.000000000 +0200
   1.378 ++++ Configure	2012-05-31 15:04:27.000000000 +0200
   1.379 +@@ -22206,6 +22206,7 @@
   1.380 +     for xxx in *; do
   1.381 + 	case "$xxx" in
   1.382 + 	    DynaLoader|dynaload) ;;
   1.383 ++        \* ) ;;
   1.384 + 	    *)
   1.385 + 	    this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
   1.386 + 	    leaf=`echo $xxx | $sed -e s/.*-//`;

mercurial