perl-5.8 and perl-5.10: fixed build on MacOS X
On MacOS X, we used to use the native perl interpreter from /usr/bin. Unfortunately, that interpreter fails to build a number of packages (Subversion, Git, etc. ...), because it assumes knowledge about the underlying C compiler that is not valid for the compiler used by Nix. For example, /usr/bin/perl assumes that the compiler can build binaries for both the ppc and the x86 architecture. /usr/bin/FCC can do that, but the gcc from Nix can't. The solution is to compile Perl 5.10 via Nix so that it can properly configure itself. However, note that the resulting binary is impure: it will find headers in /usr/include and libraries in /usr/lib -- something a pure perl binary wouldn't do. In this respect our Nix-compiled perl binary is not better than the native one from /usr/bin -- it's just more accurately configured. svn path=/nixpkgs/trunk/; revision=17618
This commit is contained in:
parent
99fe875609
commit
67cea803fa
|
@ -36,8 +36,12 @@ stdenv.mkDerivation {
|
||||||
configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
|
configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
|
||||||
|
|
||||||
if test "$NIX_ENFORCE_PURITY" = "1"; then
|
if test "$NIX_ENFORCE_PURITY" = "1"; then
|
||||||
GLIBC=$(cat $NIX_GCC/nix-support/orig-libc)
|
case $system in
|
||||||
configureFlags="$configureFlags -Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib"
|
*-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
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
source $stdenv/setup
|
source $stdenv/setup
|
||||||
|
|
||||||
if test "$NIX_ENFORCE_PURITY" = "1"; then
|
if test "$NIX_ENFORCE_PURITY" = "1"; then
|
||||||
GLIBC=$(cat $NIX_GCC/nix-support/orig-libc)
|
case $system in
|
||||||
extraflags="-Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib"
|
*-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
|
fi
|
||||||
|
|
||||||
configureScript=./Configure
|
configureScript=./Configure
|
||||||
|
|
|
@ -2254,18 +2254,19 @@ let
|
||||||
inherit (bleedingEdgeRepos) sourceByName;
|
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 {
|
import ../development/interpreters/perl-5.8 {
|
||||||
inherit fetchurl stdenv;
|
inherit fetchurl stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
perlReal = import ../development/interpreters/perl-5.10 {
|
|
||||||
fetchurl = fetchurlBoot;
|
|
||||||
inherit stdenv;
|
|
||||||
};
|
|
||||||
|
|
||||||
# FIXME: unixODBC needs patching on Darwin (see darwinports)
|
# FIXME: unixODBC needs patching on Darwin (see darwinports)
|
||||||
phpOld = import ../development/interpreters/php {
|
phpOld = import ../development/interpreters/php {
|
||||||
inherit stdenv fetchurl flex bison libxml2 apacheHttpd;
|
inherit stdenv fetchurl flex bison libxml2 apacheHttpd;
|
||||||
|
|
Loading…
Reference in New Issue