2010-01-26 19:10:59 +01:00
|
|
|
{ stdenv, fetchurl }:
|
2004-02-20 17:25:34 +01:00
|
|
|
|
2010-01-26 19:10:59 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
libc = if stdenv ? gcc && stdenv.gcc.libc != null then stdenv.gcc.libc else "/usr";
|
2010-01-18 13:09:51 +01:00
|
|
|
|
2009-11-08 01:32:12 +01:00
|
|
|
in
|
2010-01-18 13:09:51 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "perl-5.10.1";
|
2004-02-20 17:25:34 +01:00
|
|
|
|
2003-11-05 13:17:48 +01:00
|
|
|
src = fetchurl {
|
2010-01-18 13:09:51 +01:00
|
|
|
url = "mirror://cpan/src/${name}.tar.gz";
|
|
|
|
sha256 = "0dagnhjgmslfx1jawz986nvc3jh1klk7mn2l8djdca1b9gm2czyb";
|
2004-02-20 17:25:34 +01:00
|
|
|
};
|
|
|
|
|
2010-01-26 19:10:59 +01:00
|
|
|
patches =
|
|
|
|
[ # Do not look in /usr etc. for dependencies.
|
|
|
|
./no-sys-dirs.patch
|
|
|
|
];
|
2005-03-10 13:49:37 +01:00
|
|
|
|
2009-04-22 19:37:21 +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.
|
2009-11-08 01:32:12 +01:00
|
|
|
# Miniperl needs -lm. perl needs -lrt.
|
2010-01-26 19:10:59 +01:00
|
|
|
configureFlags =
|
|
|
|
[ "-de"
|
|
|
|
"-Dcc=gcc"
|
|
|
|
"-Uinstallusrbinperl"
|
|
|
|
"-Dinstallstyle=lib/perl5"
|
|
|
|
"-Duseshrplib"
|
|
|
|
"-Dlocincpth=${libc}/include"
|
|
|
|
"-Dloclibpth=${libc}/lib"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
|
2009-04-22 00:38:52 +02:00
|
|
|
|
2009-05-06 16:03:26 +02:00
|
|
|
configureScript = "${stdenv.shell} ./Configure";
|
2009-04-22 19:37:21 +02:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
2010-01-26 19:10:59 +01:00
|
|
|
preConfigure =
|
2009-04-22 19:37:21 +02:00
|
|
|
''
|
|
|
|
configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
|
2009-10-19 11:17:10 +02:00
|
|
|
|
2010-01-26 19:10:59 +01:00
|
|
|
${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") ''
|
|
|
|
configureFlagsArray=(-Dldflags="-lm -lrt")
|
|
|
|
''}
|
2009-04-22 19:37:21 +02:00
|
|
|
'';
|
|
|
|
|
2010-01-26 19:10:59 +01:00
|
|
|
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)'"
|
|
|
|
'';
|
2009-04-22 19:37:21 +02:00
|
|
|
|
2005-03-10 13:49:37 +01:00
|
|
|
setupHook = ./setup-hook.sh;
|
2003-11-05 13:17:48 +01:00
|
|
|
}
|