Mass upgrade in preparations...
[dragora.git] / stages / 1 / 10-perl
blob112b35a73d8a460c26138594d588349e800f6d58
1 # Build script for perl and perl-cross.
2 # Perl-cross URL: http://arsv.github.io/perl-cross/
4 # Copyright (c) 2014-2020 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.2
19 cross_ver=1.3.2
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 ./configure \
33  --prefix=/tools \
34  --target=$target \
35  --all-static \
36  -Dprivlib=/tools/lib${libSuffix}/perl5 \
37  -Dsitelib=/tools/lib${libSuffix}/perl5/site_perl \
38  -Dldflags="$BTLDFLAGS -static"
40 make -j1
42 mkdir -p -- "${rootdir}/tools/bin" "${rootdir}/tools/lib${libSuffix}/perl5"
43 cp -f perl cpan/podlators/scripts/pod2man "${rootdir}/tools/bin"
44 cp -R lib/* "${rootdir}/tools/lib${libSuffix}/perl5"
46 cleanup()
48     cd -- "$TMPDIR" && rm -rf perl-${version} perl-cross-${cross_ver}