summary refs log tree commit diff
path: root/pkgs/development/interpreters/perl/builder.sh
blob: e36e0738f501a1d6aee3313e00c2252949e3e7ef (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
27
28
29
30
31
32
33
#! /bin/sh -e

buildinputs="$patch"
. $stdenv/setup

tar xvfz $src
cd perl-*

# Perl's Configure messes with PATH.  We can't have that, so we patch it.
# Yeah, this is an ugly hack.
if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
    cat Configure | \
        grep -v '^paths=' | \
        grep -v '^locincpth=' | \
        grep -v '^xlibpth=' | \
        grep -v '^glibpth=' | \
        grep -v '^loclibpth=' | \
        grep -v '^locincpth=' | \
        cat > Configure.tmp
    mv Configure.tmp Configure
    chmod +x Configure
fi

patch -p1 < $srcPatch

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

./Configure -de -Dcc=gcc -Dprefix=$out -Uinstallusrbinperl $extraflags
make
make install