2005-12-05 15:11:09 +01:00
|
|
|
source $stdenv/setup
|
2005-01-22 01:19:27 +01:00
|
|
|
|
|
|
|
PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/site_perl"
|
|
|
|
|
|
|
|
oldIFS=$IFS
|
|
|
|
IFS=:
|
|
|
|
perlFlags=
|
|
|
|
for i in $PERL5LIB; do
|
|
|
|
perlFlags="$perlFlags -I$i"
|
|
|
|
done
|
|
|
|
IFS=$oldIFS
|
2005-03-10 13:49:37 +01:00
|
|
|
echo "Perl flags: $perlFlags"
|
2005-01-22 01:19:27 +01:00
|
|
|
|
2008-10-20 05:58:49 +02:00
|
|
|
oldPreConfigure="$preConfigure"
|
2005-01-22 01:19:27 +01:00
|
|
|
preConfigure=preConfigure
|
|
|
|
preConfigure() {
|
|
|
|
|
2008-10-20 05:58:49 +02:00
|
|
|
eval "$oldPreConfigure"
|
|
|
|
|
2005-01-22 01:19:27 +01:00
|
|
|
find . | while read fn; do
|
|
|
|
if test -f "$fn"; then
|
|
|
|
first=$(dd if="$fn" count=2 bs=1 2> /dev/null)
|
|
|
|
if test "$first" = "#!"; then
|
|
|
|
echo "patching $fn..."
|
|
|
|
sed < "$fn" > "$fn".tmp \
|
|
|
|
-e "s|^#\!\(.*/perl.*\)$|#\! \1$perlFlags|"
|
|
|
|
if test -x "$fn"; then chmod +x "$fn".tmp; fi
|
|
|
|
mv "$fn".tmp "$fn"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
perl Makefile.PL PREFIX=$out $makeMakerFlags
|
|
|
|
}
|
|
|
|
|
2007-03-13 14:32:17 +01:00
|
|
|
postFixup=postFixup
|
|
|
|
postFixup() {
|
|
|
|
# If a user installs a Perl package, she probably also wants its
|
|
|
|
# dependencies in the user environment (since Perl modules don't
|
|
|
|
# have something like an RPATH, so the only way to find the
|
|
|
|
# dependencies is to have them in the PERL5LIB variable).
|
|
|
|
if test -e $out/nix-support/propagated-build-inputs; then
|
|
|
|
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2005-03-10 13:49:37 +01:00
|
|
|
if test -n "$perlPreHook"; then
|
2007-03-13 14:32:17 +01:00
|
|
|
eval "$perlPreHook"
|
2005-03-10 13:49:37 +01:00
|
|
|
fi
|
|
|
|
|
2005-01-22 01:19:27 +01:00
|
|
|
genericBuild
|
2005-03-10 13:49:37 +01:00
|
|
|
|
|
|
|
if test -n "$perlPostHook"; then
|
2007-03-13 14:32:17 +01:00
|
|
|
eval "$perlPostHook"
|
2005-12-05 15:11:09 +01:00
|
|
|
fi
|