at master 1.1 kB view raw
1PERL5LIB="$PERL5LIB${PERL5LIB:+:}$out/lib/perl5/site_perl" 2 3perlFlags= 4for i in $(IFS=:; echo $PERL5LIB); do 5 perlFlags="$perlFlags -I$i" 6done 7 8oldPreConfigure="$preConfigure" 9preConfigure() { 10 11 eval "$oldPreConfigure" 12 13 find . | while read fn; do 14 if test -f "$fn"; then 15 first=$(dd if="$fn" count=2 bs=1 2> /dev/null) 16 if test "$first" = "#!"; then 17 echo "patching $fn..." 18 sed -i "$fn" -e "s|^#\!\(.*\bperl\b.*\)$|#\!\1$perlFlags|" 19 fi 20 fi 21 done 22 23 local flagsArray=() 24 concatTo flagsArray makeMakerFlags 25 26 # Perl expect these to be exported 27 export CPPRUN="$CC -E" 28 export FULL_AR=$AR 29 # Requires to be $CC since it tries adding "-Wl" 30 export LD=$CC 31 perl Makefile.PL AR="$AR" FULL_AR="$AR" CC="$CC" LD="$CC" CPPRUN="$CPPRUN" \ 32 PREFIX=$out INSTALLDIRS=site "${flagsArray[@]}" \ 33 PERL=$(type -P perl) FULLPERL=\"$fullperl/bin/perl\" 34} 35 36if test -n "$perlPreHook"; then 37 eval "$perlPreHook" 38fi 39 40genericBuild 41 42if test -n "$perlPostHook"; then 43 eval "$perlPostHook" 44fi