* Set PERL5LIB automatically in the Perl setup hook.

* Remove explicit setting of PERL5LIB.
* Use the generic Perl builder for the BerkeleyDB and XML::Parser
  modules.
* Prefix all names of Perl modules with `perl-' (in the generic Perl
  builder).

svn path=/nixpkgs/trunk/; revision=2365
This commit is contained in:
Eelco Dolstra
2005-03-10 12:49:37 +00:00
parent 93e16516a7
commit 8a282aa46c
33 changed files with 91 additions and 138 deletions

View File

@@ -1,19 +1,7 @@
addInputsHook=addInputsHook
addInputsHook() {
# Should be in a Perl setup hook.
envHooks=(${envHooks[@]} addPerlLibs)
}
addPerlLibs() {
PERL5LIB="$PERL5LIB${PERL5LIB:+:}$1/lib/site_perl"
}
. $stdenv/setup
PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/site_perl"
export PERL5LIB
oldIFS=$IFS
IFS=:
perlFlags=
@@ -21,7 +9,7 @@ for i in $PERL5LIB; do
perlFlags="$perlFlags -I$i"
done
IFS=$oldIFS
echo "$perlFlags"
echo "Perl flags: $perlFlags"
preConfigure=preConfigure
preConfigure() {
@@ -42,4 +30,12 @@ preConfigure() {
perl Makefile.PL PREFIX=$out $makeMakerFlags
}
if test -n "$perlPreHook"; then
. $perlPreHook
fi
genericBuild
if test -n "$perlPostHook"; then
. $perlPostHook
fi

View File

@@ -3,6 +3,7 @@ perl:
attrs:
perl.stdenv.mkDerivation (attrs // {
name = "perl-" + attrs.name;
builder = ./builder.sh;
buildInputs = [(if attrs ? buildInputs then attrs.buildInputs else []) perl];
})