2010-07-08 20:22:50 +01:00
|
|
|
{ stdenv, fetchurl }:
|
2004-02-20 16:25:34 +00:00
|
|
|
|
2010-01-26 18:10:59 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
libc = if stdenv ? gcc && stdenv.gcc.libc != null then stdenv.gcc.libc else "/usr";
|
2010-01-18 12:09:51 +00:00
|
|
|
|
2009-11-08 00:32:12 +00:00
|
|
|
in
|
2010-01-18 12:09:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "perl-5.10.1";
|
2004-02-20 16:25:34 +00:00
|
|
|
|
2003-11-05 12:17:48 +00:00
|
|
|
src = fetchurl {
|
2010-01-18 12:09:51 +00:00
|
|
|
url = "mirror://cpan/src/${name}.tar.gz";
|
|
|
|
sha256 = "0dagnhjgmslfx1jawz986nvc3jh1klk7mn2l8djdca1b9gm2czyb";
|
2004-02-20 16:25:34 +00:00
|
|
|
};
|
|
|
|
|
2010-01-26 18:10:59 +00:00
|
|
|
patches =
|
|
|
|
[ # Do not look in /usr etc. for dependencies.
|
|
|
|
./no-sys-dirs.patch
|
|
|
|
];
|
2005-03-10 12:49:37 +00:00
|
|
|
|
2009-04-22 18:37:21 +01: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 00:32:12 +00:00
|
|
|
# Miniperl needs -lm. perl needs -lrt.
|
2010-01-26 18:10:59 +00:00
|
|
|
configureFlags =
|
|
|
|
[ "-de"
|
|
|
|
"-Dcc=gcc"
|
|
|
|
"-Uinstallusrbinperl"
|
|
|
|
"-Dinstallstyle=lib/perl5"
|
|
|
|
"-Duseshrplib"
|
|
|
|
"-Dlocincpth=${libc}/include"
|
|
|
|
"-Dloclibpth=${libc}/lib"
|
|
|
|
]
|
|
|
|
++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
|
2009-04-21 23:38:52 +01:00
|
|
|
|
2009-05-06 15:03:26 +01:00
|
|
|
configureScript = "${stdenv.shell} ./Configure";
|
2009-04-22 18:37:21 +01:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
Enable parallel building of gcc, glibc, gmp, mpfr, ncurses, coreutils, perl, python, git, and qt4.
If a build expressions has set "enableParallelBuilding = true", then the
generic builder may utilize more than one CPU core to build that particular
expression. This feature works out of the box for GNU Make. Expressions that
use other build drivers like Boost.Jam or SCons have to specify appropriate
flags such as "-j${NIX_BUILD_CORES}" themselves.
svn path=/nixpkgs/trunk/; revision=23042
2010-08-08 19:51:42 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2010-01-26 18:10:59 +00:00
|
|
|
preConfigure =
|
2009-04-22 18:37:21 +01:00
|
|
|
''
|
|
|
|
configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
|
2009-10-19 10:17:10 +01:00
|
|
|
|
2010-01-26 18:10:59 +00:00
|
|
|
${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") ''
|
|
|
|
configureFlagsArray=(-Dldflags="-lm -lrt")
|
|
|
|
''}
|
2009-04-22 18:37:21 +01:00
|
|
|
'';
|
|
|
|
|
2010-01-26 18:10:59 +00: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 18:37:21 +01:00
|
|
|
|
2005-03-10 12:49:37 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
2003-11-05 12:17:48 +00:00
|
|
|
}
|