diff options
Diffstat (limited to 'pkgs/development/interpreters/perl-5.10/default.nix')
-rw-r--r-- | pkgs/development/interpreters/perl-5.10/default.nix | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/pkgs/development/interpreters/perl-5.10/default.nix b/pkgs/development/interpreters/perl-5.10/default.nix index 442f428ac6f46..94fda842bb15d 100644 --- a/pkgs/development/interpreters/perl-5.10/default.nix +++ b/pkgs/development/interpreters/perl-5.10/default.nix @@ -2,6 +2,13 @@ , impureLibcPath ? null }: +let + preBuildNoNative = '' + # Make Cwd work on NixOS (where we don't have a /bin/pwd). + substituteInPlace lib/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'" + ''; + preBuildNative = ""; +in stdenv.mkDerivation { name = "perl-5.10.0"; @@ -24,16 +31,21 @@ stdenv.mkDerivation { # "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. - configureFlags = '' - -de -Dcc=gcc -Uinstallusrbinperl -Dinstallstyle=lib/perl5 -Duseshrplib - ${if stdenv ? glibc then "-Dusethreads" else ""} - ''; + # Miniperl needs -lm. perl needs -lrt. + configureFlags = [ + "-de" + "-Dcc=gcc" + "-Uinstallusrbinperl" + "-Dinstallstyle=lib/perl5" + "-Duseshrplib" + (if stdenv ? glibc then "-Dusethreads" else "") + ]; configureScript = "${stdenv.shell} ./Configure"; dontAddPrefix = true; - preConfigure = + configurePhase = '' configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3" @@ -41,13 +53,11 @@ stdenv.mkDerivation { GLIBC=${if impureLibcPath == null then "$(cat $NIX_GCC/nix-support/orig-libc)" else impureLibcPath} configureFlags="$configureFlags -Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib" fi + ${stdenv.shell} ./Configure $configureFlags \ + ${if stdenv.system == "armv5tel-linux" then "-Dldflags=\"-lm -lrt\"" else ""}; ''; - preBuild = - '' - # Make Cwd work on NixOS (where we don't have a /bin/pwd). - ${if stdenv.system == "i686-darwin" then "" else "substituteInPlace lib/Cwd.pm --replace \"'/bin/pwd'\" \"'$(type -tP pwd)'\""} - ''; + preBuild = if (stdenv.gcc.nativeTools) then preBuildNative else preBuildNoNative; setupHook = ./setup-hook.sh; } |