* Install Perl modules in $out/lib/perl5. This is what Perl wants by

default, but it didn't happen in Nixpkgs because the string "perl"
  appeared in the prefix, and in that case Perl uses $out/lib.
* Enable thread-safe Perl while we're at it.

svn path=/nixpkgs/branches/stdenv-updates/; revision=15252
This commit is contained in:
Eelco Dolstra 2009-04-22 17:37:21 +00:00
parent 8b28c599a3
commit a98d8aee74
4 changed files with 32 additions and 29 deletions

View file

@ -1,18 +0,0 @@
source $stdenv/setup
configureFlags="$configureFlags -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"
fi
configureScript=./Configure
dontAddPrefix=1
preBuild() {
# Make Cwd work on NixOS (where we don't have a /bin/pwd).
substituteInPlace lib/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
}
genericBuild

View file

@ -3,8 +3,6 @@
stdenv.mkDerivation {
name = "perl-5.10.0";
builder = ./builder.sh;
src = fetchurl {
url = mirror://cpan/src/perl-5.10.0.tar.gz;
sha256 = "0bivbz15x02m02gqs6hs77cgjr2msfrhnvp5xqk359jg6w6llill";
@ -20,10 +18,33 @@ stdenv.mkDerivation {
./no-sys-dirs.patch
];
# 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.
configureFlags = ''
-de -Dcc=gcc -Uinstallusrbinperl -Duseshrplib
-Dprefix=''${out} -Dman1dir=''${out}/share/man/man1 -Dman3dir=''${out}/share/man/man3
-de -Dcc=gcc -Uinstallusrbinperl -Dinstallstyle=lib/perl5 -Duseshrplib -Dusethreads
'';
configureScript = "./Configure";
dontAddPrefix = true;
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"
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)'"
'';
setupHook = ./setup-hook.sh;
}

View file

@ -1,5 +1,5 @@
addPerlLibPath () {
addToSearchPath PERL5LIB $1/lib/site_perl
addToSearchPath PERL5LIB $1/lib/perl5/site_perl
}
envHooks=(${envHooks[@]} addPerlLibPath)

View file

@ -2105,13 +2105,18 @@ let
inherit (bleedingEdgeRepos) sourceByName;
};
perl = if !stdenv.isLinux then sysPerl else realPerl;
perl = if !stdenv.isLinux then sysPerl else perlReal;
perl58 = if !stdenv.isLinux 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;
@ -2182,11 +2187,6 @@ let
inherit clisp stdenv fetchurl builderDefs unzip;
};
realPerl = import ../development/interpreters/perl-5.10 {
fetchurl = fetchurlBoot;
inherit stdenv;
};
ruby = import ../development/interpreters/ruby {
inherit fetchurl stdenv readline ncurses zlib lib openssl;
};