diff options
Diffstat (limited to 'main/perl/APKBUILD')
-rw-r--r-- | main/perl/APKBUILD | 146 |
1 files changed, 80 insertions, 66 deletions
diff --git a/main/perl/APKBUILD b/main/perl/APKBUILD index bbf1c18a4d4..b4150eb2a3c 100644 --- a/main/perl/APKBUILD +++ b/main/perl/APKBUILD @@ -2,27 +2,32 @@ # Contributor: Leonardo Arena <rnalrd@alpinelinux.org> # Contributor: Valery Kartel <valery.kartel@gmail.com> pkgname=perl -pkgver=5.34.0 -pkgrel=1 +pkgver=5.38.2 +pkgrel=0 pkgdesc="Larry Wall's Practical Extraction and Report Language" url="https://www.perl.org/" arch="all" -license="Artistic-Perl OR GPL-1.0-or-later" -options="!fhs" -depends_dev="perl-utils" +license="Artistic-1.0-Perl OR GPL-1.0-or-later" +depends_dev="perl-utils=$pkgver-r$pkgrel" makedepends="bzip2-dev zlib-dev" subpackages="$pkgname-doc $pkgname-dev $pkgname-utils::noarch miniperl" -source="https://www.cpan.org/src/5.0/perl-$pkgver.tar.gz - musl-locale.patch +source="https://www.cpan.org/src/5.0/perl-$pkgver.tar.xz + digest-sha-cflags.patch musl-skip-dst-test.patch skip-test-due-to-busybox-ps.patch musl-stack-size.patch - CVE-2021-36770.patch " -# Tests too slow, and some failures on mips64. -[ "$CARCH" = "mips64" ] && options="$options !check" +# creates empty usr/local/{lib,share} for local sitedirs +options="!fhs" + +# in perl core, removed from main/perl-scalar-list-utils +provides=" + perl-scalar-list-utils=$pkgver-r$pkgrel + " # secfixes: +# 5.38.1-r0: +# - CVE-2023-47038 # 5.34.0-r1: # - CVE-2021-36770 # 5.30.3-r0: @@ -44,16 +49,13 @@ source="https://www.cpan.org/src/5.0/perl-$pkgver.tar.gz # - CVE-2017-12837 # - CVE-2017-12883 - _privlib=/usr/share/perl5/core_perl _archlib=/usr/lib/perl5/core_perl prepare() { + # most sources are readonly but we patch some chmod +w "$builddir"/*.c default_prepare - sed -e 's/less -R/less/g' \ - -e 's/libswanted="\(.*\) nsl\(.*\)"/libswanted="\1\2"/g' \ - -i ./Configure # Ensure that we never accidentally bundle zlib or bzip2 rm -rf cpan/Compress-Raw-Zlib/zlib-src @@ -62,15 +64,16 @@ prepare() { } build() { - BUILD_ZLIB=0 - BUILD_BZIP2=0 - BZIP2_LIB=/usr/lib - BZIP2_INCLUDE=/usr/include + export BUILD_ZLIB=0 + export BUILD_BZIP2=0 + export BZIP2_LIB=/usr/lib + export BZIP2_INCLUDE=/usr/include + + # language runtime + export CFLAGS="$CFLAGS -O2 -flto=auto" - export BUILD_ZLIB BUILD_BZIP2 BZIP2_LIB BZIP2_INCLUDE ./Configure -des \ -Dcccdlflags='-fPIC' \ - -Dcccdlflags='-fPIC' \ -Dccdlflags='-rdynamic' \ -Dprefix=/usr \ -Dprivlib=$_privlib \ @@ -95,6 +98,8 @@ build() { -Dman3ext='3pm' \ -Dcf_by='Alpine' \ -Ud_csh \ + -Ud_fpos64_t \ + -Ud_off64_t \ -Dusenm make libperl.so && make } @@ -102,80 +107,89 @@ build() { check() { export CI=true export LC_ALL=C - make test-notty + + # Perl tests HARNESS_OPTIONS against the regex + # /^j(\d*)$/, if $JOBS is unset, it defaults to 9 + export HARNESS_OPTIONS=j"$JOBS" + export PERL_TEST_HARNESS_ASAP=1 + + make test_harness_notty } package() { make DESTDIR="$pkgdir" install - if [ -n "$(find $pkgdir/usr/local -type f)" ]; then + + # omit global flto afterward + # perl saves compile-time cflags and applies them to every future build + sed -i \ + -e "s| -flto=auto||g" \ + "$pkgdir"/usr/lib/perl5/core_perl/Config_heavy.pl + + if [ -n "$(find "$pkgdir"/usr/local -type f)" ]; then error "files found under /usr/local" return 1 fi + + install -Dm755 miniperl \ + -t "$pkgdir"/usr/bin/ + + # delete files starting with a dot, + # but really just usr/lib/perl5/core_perl/.packlist find "$pkgdir" -name '.*' -delete } miniperl() { - install -Dm755 "$builddir"/$subpkgname \ - "$subpkgdir"/usr/bin/$subpkgname + amove usr/bin/miniperl } doc() { - default_doc - local file; for file in $(find "$pkgdir" -name "*.pod"); do - file=${file#$pkgdir/} - mkdir -p "$subpkgdir"/${file%/*} - mv "$pkgdir"/$file "$subpkgdir"/$file + local file; find "$pkgdir" -name "*.pod" | while read -r file; do + amove "${file#"$pkgdir"}" done + default_doc } dev() { - mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/$_archlib "$subpkgdir"/$_privlib - mv "$pkgdir"/$_archlib/Devel "$subpkgdir"/$_archlib/ - mv "$pkgdir"/$_privlib/Encode "$subpkgdir"/$_privlib/ - - mv "$pkgdir"/usr/bin/h2xs \ - "$pkgdir"/usr/bin/perlivp \ - "$pkgdir"/usr/bin/enc2xs \ - "$pkgdir"/usr/bin/xsubpp \ - "$subpkgdir"/usr/bin/ + amove \ + $_archlib/Devel \ + $_privlib/Encode \ + usr/bin/h2xs \ + usr/bin/perlivp \ + usr/bin/enc2xs \ + usr/bin/xsubpp default_dev } utils() { pkgdesc="$pkgdesc (misc utilities)" - depends="$pkgname" - mkdir -p "$subpkgdir"/usr/bin - local file - for file in \ - corelist \ - cpan \ - encguess \ - libnetcfg \ - h2ph \ - instmodsh \ - json_pp \ - perlbug \ - perlthanks \ - piconv \ - pl2pm \ - prove \ - ptar \ - ptardiff \ - ptargrep \ - shasum \ - splain \ - zipdetails - do - mv "$pkgdir"/usr/bin/$file "$subpkgdir"/usr/bin/ - done + depends="$pkgname=$pkgver-r$pkgrel" + + amove \ + usr/bin/corelist \ + usr/bin/cpan \ + usr/bin/encguess \ + usr/bin/libnetcfg \ + usr/bin/h2ph \ + usr/bin/instmodsh \ + usr/bin/json_pp \ + usr/bin/perlbug \ + usr/bin/perlthanks \ + usr/bin/piconv \ + usr/bin/pl2pm \ + usr/bin/prove \ + usr/bin/ptar \ + usr/bin/ptardiff \ + usr/bin/ptargrep \ + usr/bin/shasum \ + usr/bin/splain \ + usr/bin/zipdetails } sha512sums=" -3bd2ae3900df54801b42a1ab1c136b20438f3a162d88c1e030c5d91e96ad5cf76d5ccbcf9e75388fa29bcc26db0b1c5df3d1240d48136159462c912c9258d405 perl-5.34.0.tar.gz -a78b5fb1a2b6f60b401329cfd2d8349d4fdcc19628cde0e9b840b82e1a02e705f7d7413fe206aa13ed714ab93a65b62ac3d85dfd526ca8048621d5d89b22f0ef musl-locale.patch +0ca51e447c7a18639627c281a1c7ae6662c773745ea3c86bede46336d5514ecc97ded2c61166e1ac15635581489dc596368907aa3a775b34db225b76d7402d10 perl-5.38.2.tar.xz +59afa4c166e4808d355e19cd70748540ffce9da5c6919c71648be7678de328409f9121ddea33415add73fc01a22e95ed9d9629f31b8ba20b3bbfc04dab926c63 digest-sha-cflags.patch 3eaec691bc38e208ba4f34130ae45e50b6c339fa50093d0b0f6d7f24cb5b7c2a3734ca714a279c4b51173f82e46a8e7a3e70bfc7d7471a18c55a2102140e4186 musl-skip-dst-test.patch ba9cb1ff4a6e8e4c31bf4ef132c071ac919ffe45842cf5e98c8ca72d78ef4803883b57a0e7b8037da0079561a6ce9e6bd8d127892ac1bcb047638cb3ba3157f6 skip-test-due-to-busybox-ps.patch c004d6612ec754e5947255a2e2d15b5581f187c32495aeeec9f4fa286919bd9f40c72b63db61e3f4004b09288af2063a6a14b67e5c289e9a8b23ebd7c216e16f musl-stack-size.patch -2eb4986ac56f394e584ed5b16be40ccc0b689512fc23746588a3947db49c53be96dbbc25b8256513142c7a613481ea11b9154dfd4d0a67f05ef0662fedfd476a CVE-2021-36770.patch " |