* Fix Perl on FreeBSD.
svn path=/nixpkgs/branches/stdenv-updates/; revision=19685
This commit is contained in:
parent
0d88060fb6
commit
64f1191313
@ -6,8 +6,8 @@
|
|||||||
# variables so that the compiler and the linker just "work".
|
# variables so that the compiler and the linker just "work".
|
||||||
|
|
||||||
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
||||||
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? "",
|
, gcc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? ""
|
||||||
zlib ? null
|
, zlib ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert nativeTools -> nativePrefix != "";
|
assert nativeTools -> nativePrefix != "";
|
||||||
|
@ -1,14 +1,8 @@
|
|||||||
{ stdenv, fetchurl
|
{ stdenv, fetchurl }:
|
||||||
, impureLibcPath ? null
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
preBuildNoNative =
|
libc = if stdenv ? gcc && stdenv.gcc.libc != null then stdenv.gcc.libc else "/usr";
|
||||||
''
|
|
||||||
# Make Cwd work on NixOS (where we don't have a /bin/pwd).
|
|
||||||
substituteInPlace lib/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
|
|
||||||
'';
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -20,47 +14,45 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0dagnhjgmslfx1jawz986nvc3jh1klk7mn2l8djdca1b9gm2czyb";
|
sha256 = "0dagnhjgmslfx1jawz986nvc3jh1klk7mn2l8djdca1b9gm2czyb";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
patches =
|
||||||
# This patch does the following:
|
[ # Do not look in /usr etc. for dependencies.
|
||||||
# 1) Do use the PATH environment variable to find the `pwd' command.
|
./no-sys-dirs.patch
|
||||||
# By default, Perl will only look for it in /lib and /usr/lib.
|
];
|
||||||
# !!! what are the security implications of this?
|
|
||||||
# 2) Force the use of <errno.h>, not /usr/include/errno.h, on Linux
|
|
||||||
# systems. (This actually appears to be due to a bug in Perl.)
|
|
||||||
./no-sys-dirs.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
# Build a thread-safe Perl with a dynamic libperls.o. We need the
|
# Build a thread-safe Perl with a dynamic libperls.o. We need the
|
||||||
# "installstyle" option to ensure that modules are put under
|
# "installstyle" option to ensure that modules are put under
|
||||||
# $out/lib/perl5 - this is the general default, but because $out
|
# $out/lib/perl5 - this is the general default, but because $out
|
||||||
# contains the string "perl", Configure would select $out/lib.
|
# contains the string "perl", Configure would select $out/lib.
|
||||||
# Miniperl needs -lm. perl needs -lrt.
|
# Miniperl needs -lm. perl needs -lrt.
|
||||||
configureFlags = [
|
configureFlags =
|
||||||
"-de"
|
[ "-de"
|
||||||
"-Dcc=gcc"
|
"-Dcc=gcc"
|
||||||
"-Uinstallusrbinperl"
|
"-Uinstallusrbinperl"
|
||||||
"-Dinstallstyle=lib/perl5"
|
"-Dinstallstyle=lib/perl5"
|
||||||
"-Duseshrplib"
|
"-Duseshrplib"
|
||||||
(if stdenv ? glibc then "-Dusethreads" else "")
|
"-Dlocincpth=${libc}/include"
|
||||||
];
|
"-Dloclibpth=${libc}/lib"
|
||||||
|
]
|
||||||
|
++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
|
||||||
|
|
||||||
configureScript = "${stdenv.shell} ./Configure";
|
configureScript = "${stdenv.shell} ./Configure";
|
||||||
|
|
||||||
dontAddPrefix = true;
|
dontAddPrefix = true;
|
||||||
|
|
||||||
configurePhase =
|
preConfigure =
|
||||||
''
|
''
|
||||||
configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
|
configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
|
||||||
|
|
||||||
if test "${if impureLibcPath == null then "$NIX_ENFORCE_PURITY" else "1"}" = "1"; then
|
${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") ''
|
||||||
GLIBC=${if impureLibcPath == null then "$(cat $NIX_GCC/nix-support/orig-libc)" else impureLibcPath}
|
configureFlagsArray=(-Dldflags="-lm -lrt")
|
||||||
configureFlags="$configureFlags -Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib"
|
''}
|
||||||
fi
|
|
||||||
${stdenv.shell} ./Configure $configureFlags \
|
|
||||||
${if stdenv.system == "armv5tel-linux" then "-Dldflags=\"-lm -lrt\"" else ""};
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools)) preBuildNoNative;
|
preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools))
|
||||||
|
''
|
||||||
|
# Make Cwd work on NixOS (where we don't have a /bin/pwd).
|
||||||
|
substituteInPlace lib/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
|
||||||
|
'';
|
||||||
|
|
||||||
setupHook = ./setup-hook.sh;
|
setupHook = ./setup-hook.sh;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
diff -rc -x '*~' perl-5.10.1-orig/Configure perl-5.10.1/Configure
|
||||||
*** perl-5.10.0-orig/Configure 2007-12-18 11:47:07.000000000 +0100
|
*** perl-5.10.1-orig/Configure 2009-08-18 21:03:53.000000000 +0200
|
||||||
--- perl-5.10.0/Configure 2008-02-21 17:00:40.000000000 +0100
|
--- perl-5.10.1/Configure 2010-01-26 19:08:32.933792254 +0100
|
||||||
***************
|
***************
|
||||||
*** 104,118 ****
|
*** 103,117 ****
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: Proper PATH setting
|
: Proper PATH setting
|
||||||
@ -18,7 +18,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
|
|
||||||
for p in $paths
|
for p in $paths
|
||||||
do
|
do
|
||||||
--- 104,110 ----
|
--- 103,109 ----
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: Proper PATH setting
|
: Proper PATH setting
|
||||||
@ -27,8 +27,8 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
for p in $paths
|
for p in $paths
|
||||||
do
|
do
|
||||||
***************
|
***************
|
||||||
*** 1271,1287 ****
|
*** 1301,1317 ****
|
||||||
groupstype=''
|
archname=''
|
||||||
libnames=''
|
libnames=''
|
||||||
: change the next line if compiling for Xenix/286 on Xenix/386
|
: change the next line if compiling for Xenix/286 on Xenix/386
|
||||||
! xlibpth='/usr/lib/386 /lib/386'
|
! xlibpth='/usr/lib/386 /lib/386'
|
||||||
@ -45,8 +45,8 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
|
|
||||||
: Private path used by Configure to find libraries. Its value
|
: Private path used by Configure to find libraries. Its value
|
||||||
: is prepended to libpth. This variable takes care of special
|
: is prepended to libpth. This variable takes care of special
|
||||||
--- 1263,1274 ----
|
--- 1293,1304 ----
|
||||||
groupstype=''
|
archname=''
|
||||||
libnames=''
|
libnames=''
|
||||||
: change the next line if compiling for Xenix/286 on Xenix/386
|
: change the next line if compiling for Xenix/286 on Xenix/386
|
||||||
! xlibpth=''
|
! xlibpth=''
|
||||||
@ -59,7 +59,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
: Private path used by Configure to find libraries. Its value
|
: Private path used by Configure to find libraries. Its value
|
||||||
: is prepended to libpth. This variable takes care of special
|
: is prepended to libpth. This variable takes care of special
|
||||||
***************
|
***************
|
||||||
*** 1302,1309 ****
|
*** 1329,1336 ****
|
||||||
|
|
||||||
: Possible local include directories to search.
|
: Possible local include directories to search.
|
||||||
: Set locincpth to "" in a hint file to defeat local include searches.
|
: Set locincpth to "" in a hint file to defeat local include searches.
|
||||||
@ -68,7 +68,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
:
|
:
|
||||||
: no include file wanted by default
|
: no include file wanted by default
|
||||||
inclwanted=''
|
inclwanted=''
|
||||||
--- 1289,1295 ----
|
--- 1316,1322 ----
|
||||||
|
|
||||||
: Possible local include directories to search.
|
: Possible local include directories to search.
|
||||||
: Set locincpth to "" in a hint file to defeat local include searches.
|
: Set locincpth to "" in a hint file to defeat local include searches.
|
||||||
@ -77,7 +77,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
: no include file wanted by default
|
: no include file wanted by default
|
||||||
inclwanted=''
|
inclwanted=''
|
||||||
***************
|
***************
|
||||||
*** 1331,1338 ****
|
*** 1358,1365 ****
|
||||||
libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
|
libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
|
||||||
: We probably want to search /usr/shlib before most other libraries.
|
: We probably want to search /usr/shlib before most other libraries.
|
||||||
: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
|
: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
|
||||||
@ -86,9 +86,9 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
: Do not use vfork unless overridden by a hint file.
|
: Do not use vfork unless overridden by a hint file.
|
||||||
usevfork=false
|
usevfork=false
|
||||||
|
|
||||||
--- 1317,1322 ----
|
--- 1344,1349 ----
|
||||||
***************
|
***************
|
||||||
*** 2340,2346 ****
|
*** 2366,2372 ****
|
||||||
zip
|
zip
|
||||||
"
|
"
|
||||||
pth=`echo $PATH | sed -e "s/$p_/ /g"`
|
pth=`echo $PATH | sed -e "s/$p_/ /g"`
|
||||||
@ -96,9 +96,9 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
for file in $loclist; do
|
for file in $loclist; do
|
||||||
eval xxx=\$$file
|
eval xxx=\$$file
|
||||||
case "$xxx" in
|
case "$xxx" in
|
||||||
--- 2324,2329 ----
|
--- 2350,2355 ----
|
||||||
***************
|
***************
|
||||||
*** 8155,8167 ****
|
*** 8361,8373 ****
|
||||||
echo " "
|
echo " "
|
||||||
case "$sysman" in
|
case "$sysman" in
|
||||||
'')
|
'')
|
||||||
@ -112,7 +112,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if $test -d "$sysman"; then
|
if $test -d "$sysman"; then
|
||||||
--- 8138,8145 ----
|
--- 8344,8351 ----
|
||||||
echo " "
|
echo " "
|
||||||
case "$sysman" in
|
case "$sysman" in
|
||||||
'')
|
'')
|
||||||
@ -122,7 +122,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
esac
|
esac
|
||||||
if $test -d "$sysman"; then
|
if $test -d "$sysman"; then
|
||||||
***************
|
***************
|
||||||
*** 19005,19013 ****
|
*** 19476,19484 ****
|
||||||
case "$full_ar" in
|
case "$full_ar" in
|
||||||
'') full_ar=$ar ;;
|
'') full_ar=$ar ;;
|
||||||
esac
|
esac
|
||||||
@ -132,7 +132,7 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
|
|
||||||
: see what type gids are declared as in the kernel
|
: see what type gids are declared as in the kernel
|
||||||
echo " "
|
echo " "
|
||||||
--- 18983,18992 ----
|
--- 19454,19463 ----
|
||||||
case "$full_ar" in
|
case "$full_ar" in
|
||||||
'') full_ar=$ar ;;
|
'') full_ar=$ar ;;
|
||||||
esac
|
esac
|
||||||
@ -143,11 +143,11 @@ diff -rc perl-5.10.0-orig/Configure perl-5.10.0/Configure
|
|||||||
|
|
||||||
: see what type gids are declared as in the kernel
|
: see what type gids are declared as in the kernel
|
||||||
echo " "
|
echo " "
|
||||||
diff -rc perl-5.10.0-orig/ext/Errno/Errno_pm.PL perl-5.10.0/ext/Errno/Errno_pm.PL
|
diff -rc -x '*~' perl-5.10.1-orig/ext/Errno/Errno_pm.PL perl-5.10.1/ext/Errno/Errno_pm.PL
|
||||||
*** perl-5.10.0-orig/ext/Errno/Errno_pm.PL 2007-12-18 11:47:07.000000000 +0100
|
*** perl-5.10.1-orig/ext/Errno/Errno_pm.PL 2009-06-27 18:09:45.000000000 +0200
|
||||||
--- perl-5.10.0/ext/Errno/Errno_pm.PL 2008-02-21 17:00:02.000000000 +0100
|
--- perl-5.10.1/ext/Errno/Errno_pm.PL 2010-01-26 18:08:09.552792021 +0100
|
||||||
***************
|
***************
|
||||||
*** 140,150 ****
|
*** 144,154 ****
|
||||||
if ($dep =~ /(\S+errno\.h)/) {
|
if ($dep =~ /(\S+errno\.h)/) {
|
||||||
$file{$1} = 1;
|
$file{$1} = 1;
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ diff -rc perl-5.10.0-orig/ext/Errno/Errno_pm.PL perl-5.10.0/ext/Errno/Errno_pm.P
|
|||||||
# Some Linuxes have weird errno.hs which generate
|
# Some Linuxes have weird errno.hs which generate
|
||||||
# no #file or #line directives
|
# no #file or #line directives
|
||||||
my $linux_errno_h = -e '/usr/include/errno.h' ?
|
my $linux_errno_h = -e '/usr/include/errno.h' ?
|
||||||
--- 140,146 ----
|
--- 144,150 ----
|
||||||
if ($dep =~ /(\S+errno\.h)/) {
|
if ($dep =~ /(\S+errno\.h)/) {
|
||||||
$file{$1} = 1;
|
$file{$1} = 1;
|
||||||
}
|
}
|
||||||
@ -167,3 +167,35 @@ diff -rc perl-5.10.0-orig/ext/Errno/Errno_pm.PL perl-5.10.0/ext/Errno/Errno_pm.P
|
|||||||
# Some Linuxes have weird errno.hs which generate
|
# Some Linuxes have weird errno.hs which generate
|
||||||
# no #file or #line directives
|
# no #file or #line directives
|
||||||
my $linux_errno_h = -e '/usr/include/errno.h' ?
|
my $linux_errno_h = -e '/usr/include/errno.h' ?
|
||||||
|
diff -rc -x '*~' perl-5.10.1-orig/hints/freebsd.sh perl-5.10.1/hints/freebsd.sh
|
||||||
|
*** perl-5.10.1-orig/hints/freebsd.sh 2009-02-12 23:58:12.000000000 +0100
|
||||||
|
--- perl-5.10.1/hints/freebsd.sh 2010-01-26 18:30:01.181854620 +0100
|
||||||
|
***************
|
||||||
|
*** 118,130 ****
|
||||||
|
objformat=`/usr/bin/objformat`
|
||||||
|
if [ x$objformat = xaout ]; then
|
||||||
|
if [ -e /usr/lib/aout ]; then
|
||||||
|
! libpth="/usr/lib/aout /usr/local/lib /usr/lib"
|
||||||
|
! glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
|
||||||
|
fi
|
||||||
|
lddlflags='-Bshareable'
|
||||||
|
else
|
||||||
|
! libpth="/usr/lib /usr/local/lib"
|
||||||
|
! glibpth="/usr/lib /usr/local/lib"
|
||||||
|
ldflags="-Wl,-E "
|
||||||
|
lddlflags="-shared "
|
||||||
|
fi
|
||||||
|
--- 118,130 ----
|
||||||
|
objformat=`/usr/bin/objformat`
|
||||||
|
if [ x$objformat = xaout ]; then
|
||||||
|
if [ -e /usr/lib/aout ]; then
|
||||||
|
! libpth=""
|
||||||
|
! glibpth=""
|
||||||
|
fi
|
||||||
|
lddlflags='-Bshareable'
|
||||||
|
else
|
||||||
|
! libpth=""
|
||||||
|
! glibpth=""
|
||||||
|
ldflags="-Wl,-E "
|
||||||
|
lddlflags="-shared "
|
||||||
|
fi
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
# argument. Otherwise, it's read from $NIXPKGS_CONFIG or
|
# argument. Otherwise, it's read from $NIXPKGS_CONFIG or
|
||||||
# ~/.nixpkgs/config.nix.
|
# ~/.nixpkgs/config.nix.
|
||||||
config ? null
|
config ? null
|
||||||
|
|
||||||
, crossSystem ? null
|
, crossSystem ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -2496,14 +2497,13 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
perl58 = import ../development/interpreters/perl-5.8 {
|
perl58 = import ../development/interpreters/perl-5.8 {
|
||||||
inherit fetchurl stdenv;
|
inherit fetchurl stdenv;
|
||||||
impureLibcPath = if stdenv.isLinux then null else "/usr";
|
impureLibcPath = if stdenv.isLinux then null else "/usr";
|
||||||
};
|
};
|
||||||
|
|
||||||
perl510 = makeOverridable (import ../development/interpreters/perl-5.10) {
|
perl510 = makeOverridable (import ../development/interpreters/perl-5.10) {
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
fetchurl = fetchurlBoot;
|
fetchurl = fetchurlBoot;
|
||||||
impureLibcPath = if stdenv.isLinux then null else "/usr";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
perl = useFromStdenv "perl"
|
perl = useFromStdenv "perl"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user