summary refs log tree commit diff
path: root/pkgs/development/interpreters/perl-5.8/builder.sh
blob: 500de901e174b5c0c4659583bc1b13a44f63e3ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
source $stdenv/setup

if test "$NIX_ENFORCE_PURITY" = "1"; then
    case $system in
        *-linux)  LIBC=$(cat $NIX_GCC/nix-support/orig-libc) ;;
        *-darwin) LIBC=/usr ;;
        *)        echo unsupported system $system; exit 1 ;;
    esac
    extraflags="-Dlocincpth=$LIBC/include -Dloclibpth=$LIBC/lib"
fi

configureScript=./Configure
configureFlags="-de -Dcc=gcc -Dprefix=$out -Uinstallusrbinperl $extraflags"
dontAddPrefix=1

preBuild() {
    # Make Cwd work on NixOS (where we don't have a /bin/pwd).
    substituteInPlace lib/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
}

postInstall() {
    ensureDir "$out/nix-support"
    cp $setupHook $out/nix-support/setup-hook
}

genericBuild