1source $stdenv/setup
2
3PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/perl5/site_perl"
4
5perlFlags=
6for i in $(IFS=:; echo $PERL5LIB); do
7 perlFlags="$perlFlags -I$i"
8done
9
10oldPreConfigure="$preConfigure"
11preConfigure() {
12
13 eval "$oldPreConfigure"
14
15 find . | while read fn; do
16 if test -f "$fn"; then
17 first=$(dd if="$fn" count=2 bs=1 2> /dev/null)
18 if test "$first" = "#!"; then
19 echo "patching $fn..."
20 sed -i "$fn" -e "s|^#\!\(.*\bperl\b.*\)$|#\!\1$perlFlags|"
21 fi
22 fi
23 done
24
25 perl Makefile.PL PREFIX=$out INSTALLDIRS=site $makeMakerFlags PERL=$(type -P perl) FULLPERL=\"$fullperl/bin/perl\"
26}
27
28if test -n "$perlPreHook"; then
29 eval "$perlPreHook"
30fi
31
32genericBuild
33
34if test -n "$perlPostHook"; then
35 eval "$perlPostHook"
36fi