stages/1: use GNU patch/ed instead of the versions provided by busybox
[dragora.git] / stages / 1 / 09-perl
blob627063087ae0ea95c7ef032046b7473bed440f8d
1 # Build script for perl and perl-cross
3 # Perl-cross URL: http://arsv.github.io/perl-cross/
5 # Copyright (C) 2014-2017 Matias Fonzo, <selk@dragora.org>
7 # This script is free software: you have unlimited permission
8 # to copy, distribute and modify it.
10 version=5.24.1
11 cross_ver=1.1.4
13 rm -rf -- "${TMPDIR}/perl-${version}" \
14           "${TMPDIR}/perl-cross-${cross_ver}"
15 untar "${worktree}/sources/perl-${version}.tar.gz" "$TMPDIR"
16 untar "${worktree}/sources/perl-cross-${cross_ver}.tar.gz" "$TMPDIR"
18 # Copy perl-cross files over perl-<version>
19 cd -- "$TMPDIR"
20 cp -f -r "perl-cross-${cross_ver}"/* "perl-${version}"
22 # Build instructions
23 cd "perl-${version}"
25 # Don't use -fstack-protector* (troubles)
26 sed -i 's/-fstack-protector/-fnostack-protector/g' ./Configure
28 ./configure \
29  --prefix=/tools \
30  --target=$target \
31  --all-static \
32  -Dprivlib=/tools/lib${libSuffix}/perl5 \
33  -Dsitelib=/tools/lib${libSuffix}/perl5/site_perl \
34  -A ldflags="$BTLDFLAGS -static"
36 make
38 mkdir -p -- "${rootdir}/tools/bin" "${rootdir}/tools/lib${libSuffix}/perl5"
40 cp -f perl cpan/podlators/scripts/pod2man "${rootdir}/tools/bin"
41 cp -R lib/* "${rootdir}/tools/lib${libSuffix}/perl5"
43 cleanup()
45     cd -- "$TMPDIR" && rm -rf "perl-${version}" "perl-cross-${cross_ver}"