Fixing perl so it builds well with stdenvNative in my arm-linux debian.

svn path=/nixpkgs/trunk/; revision=16467
This commit is contained in:
Lluís Batlle i Rossell 2009-07-26 21:48:17 +00:00
parent 532fc4a05d
commit 4f5e00f686

View File

@ -1,5 +1,12 @@
{stdenv, fetchurl}:
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";
@ -22,8 +29,10 @@ 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.
# Miniperl needs -lm. perl needs -lrt.
configureFlags = ''
-de -Dcc=gcc -Uinstallusrbinperl -Dinstallstyle=lib/perl5 -Duseshrplib
-Dldflags='-lm -lrt'
${if stdenv ? glibc then "-Dusethreads" else ""}
'';
@ -41,11 +50,7 @@ stdenv.mkDerivation {
fi
'';
preBuild =
''
# Make Cwd work on NixOS (where we don't have a /bin/pwd).
substituteInPlace lib/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
'';
preBuild = if (stdenv.gcc.nativeTools) then preBuildNative else preBuildNoNative;
setupHook = ./setup-hook.sh;
}