recipes: devel/perl: configure without threads support, this is causing troubles
[dragora.git] / recipes / devel / perl / recipe
blobcbd0140f84410ebaf1d1e82887b493ae60825c0d
1 # Build recipe for perl.
3 # Copyright (c) 2016-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=perl
18 version=5.28.1
19 release=2
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/devel"
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://www.cpan.org/src/5.0/$tarname
29 description="
30 Practical Extraction and Report Language.
32 Perl 5 is a highly capable, feature-rich programming language with over
33 29 years of development.  Perl 5 runs on over 100 platforms from
34 portables to mainframes and is suitable for both rapid prototyping
35 and large scale development projects.
37 Perl is a language that combines some of the features of C,
38 sed, awk, and the shell.
40 For more information, visit:  http://www.perl.org
43 homepage=http://www.perl.org
44 license="Artistic | GPLv1"
46 # Source documentation
47 docs="AUTHORS Artistic Changes Copying README README.linux"
48 docsdir="${docdir}/${program}"
50 # Limit parallel jobs to '1' due to perl-cross-static
51 jobs=1
53 # Limit package name to the program name
54 full_pkgname=$program
56 build()
58     set -e
60     unpack "${tardir}/$tarname"
62     cd "$srcdir"
64     # Set sane permissions
65     chmod -R u+w,go-w,a+rX-s .
67     # We are not configuring Perl to make use of threads.
68     # To do so, Configure can be run with -Dusethreads.
69     # Note that Perl built with threading support runs
70     # slightly slower and uses slightly more memory than
71     # plain Perl.
73     ./Configure -de \
74      -Dprefix=/usr \
75      -Dinstallprefix=/usr \
76      -Dsiteprefix=/usr/local \
77      -Dprivlib=/usr/share/perl5 \
78      -Darchlib=/usr/lib${libSuffix}/perl5 \
79      -Dsitelib=/usr/local/share/perl5 \
80      -Dsitearch=/usr/local/lib${libSuffix}/perl5 \
81      -Dvendorprefix=/usr \
82      -Dvendorlib=/usr/share/perl5/vendor_perl \
83      -Dvendorarch=/usr/lib${libSuffix}/perl5/vendor_perl \
84      -Dlibpth="/usr/local/lib${libSuffix} /usr/lib${libSuffix} /lib${libSuffix}" \
85      -Dscriptdir=/usr/bin \
86      -Duseshrplib \
87      -Ubincompat5005 \
88      -Uversiononly \
89      -Uusethreads \
90      -Duselargefiles \
91      -Dusemymalloc=n \
92      -Dldflags="$QILDFLAGS" \
93      -Doptimize="$QICFLAGS" \
94      -Dman1dir="${mandir}/man1" \
95      -Dman3dir="${mandir}/man3" \
96      -Dpager="/usr/bin/less -isR" \
97      BUILD_ZLIB="False" BUILD_BZIP2="0"
99     make -j${jobs} BUILD_ZLIB="False" BUILD_BZIP2="0"
100     make -j${jobs} DESTDIR="$destdir" install
102     # Strip remaining binaries and libraries
103     find "$destdir" -type f | xargs file | \
104      awk '/ELF/ && /executable/ || /shared object/' | \
105       cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
107     find "$destdir" -type f | xargs file | awk '/current ar archive/' | \
108      cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
110     # Compress info documents deleting index file for the package
111     if test -d "${destdir}/$infodir"
112     then
113         rm -f "${destdir}/${infodir}/dir"
114         lzip -9 "${destdir}/${infodir}"/*
115     fi
117     # Compress and link man pages (if needed)
118     if test -d "${destdir}/$mandir"
119     then
120         (
121             cd "${destdir}/$mandir"
122             find . -type f -exec lzip -9 '{}' +
123             find . -type l | while read -r file
124             do
125                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
126                 rm -- "$file"
127             done
128         )
129     fi
131     # Copy documentation
132     mkdir -p "${destdir}${docsdir}"
133     cp -p $docs "${destdir}${docsdir}/"