summary refs log tree commit diff
path: root/pkgs/development/interpreters/perl-5.8/builder.sh
blob: c393cb0560b149cc787ffc1efb0909e576c926a7 (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
source $stdenv/setup

if test "$NIX_ENFORCE_PURITY" = "1"; then
    GLIBC=$(cat $NIX_GCC/nix-support/orig-libc)
    extraflags="-Dlocincpth=$GLIBC/include -Dloclibpth=$GLIBC/lib"
fi

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

preBuild=preBuild
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=postInstall
postInstall() {
    ensureDir "$out/nix-support"
    cp $setupHook $out/nix-support/setup-hook
}

genericBuild