1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/openpkg/perl.patch Tue Jan 06 23:40:39 2009 +0100 1.3 @@ -0,0 +1,243 @@ 1.4 +By default, the "vendor" area is not used, so Perl's installation 1.5 +procedure forgot to create its top-level paths, too. In OpenPKG we use 1.6 +the "vendor" area, so make sure it is created the same way the "site" 1.7 +area is. 1.8 + 1.9 +Index: installperl 1.10 +--- installperl.orig 2006-08-15 14:37:41 +0200 1.11 ++++ installperl 2006-08-18 21:05:05 +0200 1.12 +@@ -211,6 +211,8 @@ 1.13 + my $installarchlib = "$destdir$Config{installarchlib}"; 1.14 + my $installsitelib = "$destdir$Config{installsitelib}"; 1.15 + my $installsitearch = "$destdir$Config{installsitearch}"; 1.16 ++my $installvendorlib = "$destdir$Config{installvendorlib}"; 1.17 ++my $installvendorarch = "$destdir$Config{installvendorarch}"; 1.18 + my $installman1dir = "$destdir$Config{installman1dir}"; 1.19 + my $man1ext = $Config{man1ext}; 1.20 + my $libperl = $Config{libperl}; 1.21 +@@ -403,6 +405,8 @@ 1.22 + mkpath($installarchlib, $verbose, 0777); 1.23 + mkpath($installsitelib, $verbose, 0777) if ($installsitelib); 1.24 + mkpath($installsitearch, $verbose, 0777) if ($installsitearch); 1.25 ++mkpath($installvendorlib, $verbose, 0777) if ($installvendorlib); 1.26 ++mkpath($installvendorarch, $verbose, 0777) if ($installvendorarch); 1.27 + 1.28 + if (chdir "lib") { 1.29 + $do_installarchlib = ! samepath($installarchlib, '.'); 1.30 + 1.31 +----------------------------------------------------------------------------- 1.32 + 1.33 +By default, the Perl module search order is "use lib, -I, PERL[5]LIB, 1.34 +perl, site, vendor, other". This means that in OpenPKG both the modules 1.35 +installed via CPAN shell (in "site" area) and the "perl-xxx" packages 1.36 +(in "vendor" area) cannot override the (sometimes obsoleted) module 1.37 +versions distributed with Perl (in "perl" area). Hence, we change 1.38 +the search order to a more reasonable one for OpenPKG: "use lib, -I, 1.39 +PERL[5]LIB, site, vendor, perl, other". 1.40 + 1.41 +Index: perl.c 1.42 +--- perl.c.orig 2006-08-15 14:37:41 +0200 1.43 ++++ perl.c 2006-08-18 21:08:14 +0200 1.44 +@@ -4749,39 +4749,6 @@ 1.45 + incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE); 1.46 + #endif 1.47 + 1.48 +-#ifdef ARCHLIB_EXP 1.49 +- incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE); 1.50 +-#endif 1.51 +-#ifdef MACOS_TRADITIONAL 1.52 +- { 1.53 +- Stat_t tmpstatbuf; 1.54 +- SV * privdir = newSV(0); 1.55 +- char * macperl = PerlEnv_getenv("MACPERL"); 1.56 +- 1.57 +- if (!macperl) 1.58 +- macperl = ""; 1.59 +- 1.60 +- Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl); 1.61 +- if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) 1.62 +- incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); 1.63 +- Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl); 1.64 +- if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) 1.65 +- incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); 1.66 +- 1.67 +- SvREFCNT_dec(privdir); 1.68 +- } 1.69 +- if (!PL_tainting) 1.70 +- incpush(":", FALSE, FALSE, TRUE, FALSE); 1.71 +-#else 1.72 +-#ifndef PRIVLIB_EXP 1.73 +-# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl" 1.74 +-#endif 1.75 +-#if defined(WIN32) 1.76 +- incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE); 1.77 +-#else 1.78 +- incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE); 1.79 +-#endif 1.80 +- 1.81 + #ifdef SITEARCH_EXP 1.82 + /* sitearch is always relative to sitelib on Windows for 1.83 + * DLL-based path intuition to work correctly */ 1.84 +@@ -4824,6 +4791,39 @@ 1.85 + incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE); 1.86 + #endif 1.87 + 1.88 ++#ifdef ARCHLIB_EXP 1.89 ++ incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE); 1.90 ++#endif 1.91 ++#ifdef MACOS_TRADITIONAL 1.92 ++ { 1.93 ++ Stat_t tmpstatbuf; 1.94 ++ SV * privdir = newSV(0); 1.95 ++ char * macperl = PerlEnv_getenv("MACPERL"); 1.96 ++ 1.97 ++ if (!macperl) 1.98 ++ macperl = ""; 1.99 ++ 1.100 ++ Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl); 1.101 ++ if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) 1.102 ++ incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); 1.103 ++ Perl_sv_setpvf(aTHX_ privdir, "%ssite_perl:", macperl); 1.104 ++ if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) 1.105 ++ incpush(SvPVX(privdir), TRUE, FALSE, TRUE, FALSE); 1.106 ++ 1.107 ++ SvREFCNT_dec(privdir); 1.108 ++ } 1.109 ++ if (!PL_tainting) 1.110 ++ incpush(":", FALSE, FALSE, TRUE, FALSE); 1.111 ++#else 1.112 ++#ifndef PRIVLIB_EXP 1.113 ++# define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl" 1.114 ++#endif 1.115 ++#if defined(WIN32) 1.116 ++ incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE); 1.117 ++#else 1.118 ++ incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE); 1.119 ++#endif 1.120 ++ 1.121 + #ifdef PERL_OTHERLIBDIRS 1.122 + incpush(PERL_OTHERLIBDIRS, TRUE, TRUE, TRUE, TRUE); 1.123 + #endif 1.124 + 1.125 +----------------------------------------------------------------------------- 1.126 + 1.127 +Port to [Open]Darwin 6.6.2: 1.128 + 1.129 +1. In OpenPKG, Perl does not use the vendor GCC and our GCC does not 1.130 + understand "-no-cpp-precomp", so remove this build option. 1.131 + 1.132 +2. The <sys/mman.h> indirectly includes system specific headers 1.133 + which in turn have fields named "environ" while Perl uses 1.134 + a define of "environ" internally. So wrap the inclusion. 1.135 + 1.136 +3. Darwin 6 no longer accepts the non-standard "#import" statements, 1.137 + so replace with "#include" and circumvent some header problem 1.138 + related to the non-standard "__private_extern__" attribute. 1.139 + 1.140 +Index: hints/darwin.sh 1.141 +--- hints/darwin.sh.orig 2006-08-15 14:37:41 +0200 1.142 ++++ hints/darwin.sh 2006-08-18 21:05:05 +0200 1.143 +@@ -120,9 +120,6 @@ 1.144 + *-2147483648) ccflags="${ccflags} -DINT32_MIN_BROKEN -DINT64_MIN_BROKEN" ;; 1.145 + esac 1.146 + 1.147 +-# Avoid Apple's cpp precompiler, better for extensions 1.148 +-cppflags="${cppflags} -no-cpp-precomp" 1.149 +- 1.150 + # This is necessary because perl's build system doesn't 1.151 + # apply cppflags to cc compile lines as it should. 1.152 + ccflags="${ccflags} ${cppflags}" 1.153 +@@ -182,8 +179,7 @@ 1.154 + esac 1.155 + ldlibpthname='DYLD_LIBRARY_PATH'; 1.156 + 1.157 +-# useshrplib=true results in much slower startup times. 1.158 +-# 'false' is the default value. Use Configure -Duseshrplib to override. 1.159 ++useshrplib='true' 1.160 + 1.161 + cat > UU/archname.cbu <<'EOCBU' 1.162 + # This script UU/archname.cbu will get 'called-back' by Configure 1.163 +Index: perlio.c 1.164 +--- perlio.c.orig 2006-08-15 14:37:41 +0200 1.165 ++++ perlio.c 2006-08-18 21:05:05 +0200 1.166 +@@ -461,7 +461,14 @@ 1.167 + #include <unistd.h> 1.168 + #endif 1.169 + #ifdef HAS_MMAP 1.170 ++#ifdef PERL_DARWIN 1.171 ++#define environ_safe environ 1.172 ++#undef environ 1.173 + #include <sys/mman.h> 1.174 ++#define environ environ_safe 1.175 ++#else 1.176 ++#include <sys/mman.h> 1.177 ++#endif 1.178 + #endif 1.179 + 1.180 + void 1.181 + 1.182 +----------------------------------------------------------------------------- 1.183 + 1.184 +Port to Tru64 5.1: 1.185 + 1.186 +Under Tru64 our gcc has to be built without binutils and the system 1.187 +ld(1) does not accept a "-O" option, so remove the whole passing of 1.188 +optimization flags to ld(1). Under a brain-dead platform like Tru64 we 1.189 +really don't need any more optimization because we are already happy if 1.190 +it works at all. 1.191 + 1.192 +Index: hints/dec_osf.sh 1.193 +--- hints/dec_osf.sh.orig 2007-12-18 11:47:07 +0100 1.194 ++++ hints/dec_osf.sh 2007-12-19 12:31:37 +0100 1.195 +@@ -73,15 +73,6 @@ 1.196 + *) if $test "X$optimize" = "X$undef"; then 1.197 + lddlflags="$lddlflags -msym" 1.198 + else 1.199 +- case "$myosvers" in 1.200 +- *4.0D*) 1.201 +- # QAR 56761: -O4 + .so may produce broken code, 1.202 +- # fixed in 4.0E or better. 1.203 +- ;; 1.204 +- *) 1.205 +- lddlflags="$lddlflags $optimize" 1.206 +- ;; 1.207 +- esac 1.208 + # -msym: If using a sufficiently recent /sbin/loader, 1.209 + # keep the module symbols with the modules. 1.210 + lddlflags="$lddlflags -msym $_lddlflags_strict_ansi" 1.211 + 1.212 +----------------------------------------------------------------------------- 1.213 + 1.214 +Index: Configure 1.215 +--- Configure.orig 2006-08-15 14:37:40 +0200 1.216 ++++ Configure 2006-08-18 21:05:05 +0200 1.217 +@@ -7787,7 +7787,7 @@ 1.218 + ;; 1.219 + linux|irix*|gnu*) dflt='-shared' ;; 1.220 + next) dflt='none' ;; 1.221 +- solaris) dflt='-G' ;; 1.222 ++ solaris) dflt='-shared' ;; 1.223 + sunos) dflt='-assert nodefinitions' ;; 1.224 + svr4*|esix*|nonstopux) dflt="-G $ldflags" ;; 1.225 + *) dflt='none' ;; 1.226 + 1.227 +----------------------------------------------------------------------------- 1.228 + 1.229 +Security Fix (CVE-2005-3962, OpenPKG-SA-2005.025-perl) 1.230 + 1.231 +Index: sv.c 1.232 +--- sv.c.orig 2006-08-15 14:37:41 +0200 1.233 ++++ sv.c 2006-08-18 21:05:05 +0200 1.234 +@@ -8595,7 +8595,10 @@ 1.235 + if ( (width = expect_number(&q)) ) { 1.236 + if (*q == '$') { 1.237 + ++q; 1.238 +- efix = width; 1.239 ++ if (width > PERL_INT_MAX) 1.240 ++ efix = PERL_INT_MAX; 1.241 ++ else 1.242 ++ efix = width; 1.243 + } else { 1.244 + goto gotwidth; 1.245 + } 1.246 +