2011-10-27 17:58:25 +02:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
libc = if stdenv ? gcc && stdenv.gcc.libc != null then stdenv.gcc.libc else "/usr";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "perl-5.14.2";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://cpan/src/${name}.tar.gz";
|
|
|
|
sha256 = "1ls8cpbgnlaxfydyyqgr7pxj1hkxh9pzcdgr3dv42zdxffakb234";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches =
|
|
|
|
[ # Do not look in /usr etc. for dependencies.
|
|
|
|
./no-sys-dirs.patch
|
2012-02-17 20:32:15 +01:00
|
|
|
]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin ./no-libutil.patch;
|
2011-10-27 17:58:25 +02:00
|
|
|
|
|
|
|
# Build a thread-safe Perl with a dynamic libperls.o. We need the
|
|
|
|
# "installstyle" option to ensure that modules are put under
|
|
|
|
# $out/lib/perl5 - this is the general default, but because $out
|
|
|
|
# contains the string "perl", Configure would select $out/lib.
|
|
|
|
# Miniperl needs -lm. perl needs -lrt.
|
|
|
|
configureFlags =
|
|
|
|
[ "-de"
|
|
|
|
"-Dcc=gcc"
|
|
|
|
"-Uinstallusrbinperl"
|
|
|
|
"-Dinstallstyle=lib/perl5"
|
|
|
|
"-Duseshrplib"
|
|
|
|
"-Dlocincpth=${libc}/include"
|
|
|
|
"-Dloclibpth=${libc}/lib"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
|
|
|
|
|
|
|
|
configureScript = "${stdenv.shell} ./Configure";
|
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
|
|
|
|
|
2012-04-16 01:41:25 +02:00
|
|
|
${stdenv.lib.optionalString stdenv.isArm ''
|
2011-10-27 17:58:25 +02:00
|
|
|
configureFlagsArray=(-Dldflags="-lm -lrt")
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools))
|
|
|
|
''
|
|
|
|
# Make Cwd work on NixOS (where we don't have a /bin/pwd).
|
|
|
|
substituteInPlace dist/Cwd/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
|
|
|
|
'';
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
2012-05-11 15:41:24 +02:00
|
|
|
|
|
|
|
passthru.libPrefix = "lib/perl5/site_perl";
|
2011-10-27 17:58:25 +02:00
|
|
|
}
|