diff --git a/pkgs/development/interpreters/perl-5.10/default.nix b/pkgs/development/interpreters/perl-5.10/default.nix index a8b8dd536a75..8f7908a80979 100644 --- a/pkgs/development/interpreters/perl-5.10/default.nix +++ b/pkgs/development/interpreters/perl-5.10/default.nix @@ -34,10 +34,14 @@ stdenv.mkDerivation { preConfigure = '' configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3" - + if test "$NIX_ENFORCE_PURITY" = "1"; then - GLIBC=$(cat $NIX_GCC/nix-support/orig-libc) - configureFlags="$configureFlags -Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib" + case $system in + *-linux) LIBC=$(cat $NIX_GCC/nix-support/orig-libc) ;; + *-darwin) LIBC=/usr ;; + *) echo unsupported system $system; exit 1 ;; + esac + configureFlags="$configureFlags -Dlocincpth=$LIBC/include -Dloclibpth=$LIBC/lib" fi ''; diff --git a/pkgs/development/interpreters/perl-5.8/builder.sh b/pkgs/development/interpreters/perl-5.8/builder.sh index 79458b3249b6..500de901e174 100644 --- a/pkgs/development/interpreters/perl-5.8/builder.sh +++ b/pkgs/development/interpreters/perl-5.8/builder.sh @@ -1,8 +1,12 @@ source $stdenv/setup if test "$NIX_ENFORCE_PURITY" = "1"; then - GLIBC=$(cat $NIX_GCC/nix-support/orig-libc) - extraflags="-Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib" + case $system in + *-linux) LIBC=$(cat $NIX_GCC/nix-support/orig-libc) ;; + *-darwin) LIBC=/usr ;; + *) echo unsupported system $system; exit 1 ;; + esac + extraflags="-Dlocincpth=$LIBC/include -Dloclibpth=$LIBC/lib" fi configureScript=./Configure diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 538be82c612e..0433fff06aed 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2254,18 +2254,19 @@ let inherit (bleedingEdgeRepos) sourceByName; }; - perl = if !stdenv.isLinux then sysPerl else perlReal; + supportsPerl = stdenv.isLinux || system == "i686-darwin"; - perl58 = if !stdenv.isLinux then sysPerl else + perl = if !supportsPerl then sysPerl else + import ../development/interpreters/perl-5.10 { + fetchurl = fetchurlBoot; + inherit stdenv; + }; + + perl58 = if !supportsPerl then sysPerl else import ../development/interpreters/perl-5.8 { inherit fetchurl stdenv; }; - perlReal = import ../development/interpreters/perl-5.10 { - fetchurl = fetchurlBoot; - inherit stdenv; - }; - # FIXME: unixODBC needs patching on Darwin (see darwinports) phpOld = import ../development/interpreters/php { inherit stdenv fetchurl flex bison libxml2 apacheHttpd;