* 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,12 +0,0 @@
buildinputs="$perl $db4"
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd BerkeleyDB-* || exit 1
echo "LIB = $db4/lib" > config.in
echo "INCLUDE = $db4/include" >> config.in
perl Makefile.PL || exit 1
make || exit 1
make install SITEPREFIX=$out PERLPREFIX=$out || exit 1

View File

@@ -1,14 +1,12 @@
{stdenv, fetchurl, perl, db4}:
{fetchurl, perl, db4}:
assert perl != null && db4 != null;
stdenv.mkDerivation {
name = "perl-BerkeleyDB-0.25";
builder = ./builder.sh;
import ../generic perl {
name = "BerkeleyDB-0.26";
src = fetchurl {
url = ftp://ftp.cs.uu.nl/mirror/CPAN/authors/id/P/PM/PMQS/BerkeleyDB-0.25.tar.gz;
md5 = "fcef06232d1ccd6c2a9cd114e388ea3d";
url = ftp://ftp.cs.uu.nl/mirror/CPAN/authors/id/P/PM/PMQS/BerkeleyDB-0.26.tar.gz;
md5 = "6e9882f4e4bac48b24079d082af30e6c";
};
perl = perl;
db4 = db4;
perlPreHook = ./hook.sh;
buildInputs = [db4];
# inherit db4;
}

View File

@@ -0,0 +1,7 @@
oldPreConfigure=$preConfigure
preConfigure=myPreConfigure
myPreConfigure() {
echo "LIB = $db4/lib" > config.in
echo "INCLUDE = $db4/include" >> config.in
$oldPreConfigure
}

View File

@@ -1,10 +0,0 @@
buildinputs="$perl $expat"
. $stdenv/setup || exit 1
tar xvfz $src || exit 1
cd XML-Parser-* || exit 1
perl Makefile.PL EXPATLIBPATH=$expat/lib EXPATINCPATH=$expat/include \
SITEPREFIX=$out PERLPREFIX=$out || exit 1
make || exit 1
make install || exit 1

View File

@@ -1,14 +1,11 @@
{stdenv, fetchurl, perl, expat}:
{fetchurl, perl, expat}:
assert perl != null && expat != null;
stdenv.mkDerivation {
name = "perl-XML-Parser-2.34";
builder = ./builder.sh;
import ../generic perl {
name = "XML-Parser-2.34";
src = fetchurl {
url = http://catamaran.labs.cs.uu.nl/dist/tarballs/XML-Parser-2.34.tar.gz;
md5 = "84d9e0001fe01c14867256c3fe115899";
};
perl = perl;
expat = expat;
perlPreHook = ./hook.sh;
inherit expat;
}

View File

@@ -0,0 +1 @@
makeMakerFlags="EXPATLIBPATH=$expat/lib EXPATINCPATH=$expat/include"

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];
})