recipes: optimize lzlib and plzip
[dragora.git] / stages / 1 / 10-perl
blob46f4c1c5aa6a31d63ec85012941b953a7819e1df
1 # Build script for perl and perl-cross.
2 # Perl-cross URL: http://arsv.github.io/perl-cross/
4 # Copyright (c) 2014-2019 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 version=5.30.0
19 cross_ver=1.3
21 cd -- "$TMPDIR"
22 rm -rf perl-${version} perl-cross-${cross_ver}
23 unpack "${worktree}/sources/perl-${version}.tar.gz" \
24        "${worktree}/sources/perl-cross-${cross_ver}.tar.gz"
26 # Copy perl-cross over Perl distribution
27 cp -f -r perl-cross-${cross_ver}/* perl-${version}/
29 # Build instructions
30 cd perl-${version}
32 # Update for hosts based on musl
33 cp -f "${worktree}/archive/common/config.guess" cnf/config.guess
34 cp -f "${worktree}/archive/common/config.sub" cnf/config.sub
36 ./configure \
37  --prefix=/tools \
38  --target=$target \
39  --all-static \
40  -Dprivlib=/tools/lib${libSuffix}/perl5 \
41  -Dsitelib=/tools/lib${libSuffix}/perl5/site_perl \
42  -Dldflags="$BTLDFLAGS -static"
44 make -j1
46 mkdir -p -- "${rootdir}/tools/bin" "${rootdir}/tools/lib${libSuffix}/perl5"
47 cp -f perl cpan/podlators/scripts/pod2man "${rootdir}/tools/bin"
48 cp -R lib/* "${rootdir}/tools/lib${libSuffix}/perl5"
50 cleanup()
52     cd -- "$TMPDIR" && rm -rf perl-${version} perl-cross-${cross_ver}