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