void-packages/srcpkgs/perl/template

232 lines
6.6 KiB
Bash

# Template file for 'perl'
pkgname=perl
version=5.38.2
revision=3
_perl_cross_version=1.5.2
build_style=gnu-configure
makedepends="zlib-devel bzip2-devel gdbm-devel db-devel"
depends="less"
checkdepends="iana-etc perl-AnyEvent perl-Test-Pod procps-ng"
short_desc="Practical Extraction and Report Language"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="Artistic-1.0-Perl, GPL-1.0-or-later"
homepage="https://www.perl.org"
distfiles="https://www.cpan.org/src/5.0/perl-${version}.tar.gz
https://github.com/arsv/perl-cross/releases/download/${_perl_cross_version}/perl-cross-${_perl_cross_version}.tar.gz"
checksum="a0a31534451eb7b83c7d6594a497543a54d488bc90ca00f5e34762577f40655e
584dc54c48dca25e032b676a15bef377c1fed9de318b4fc140292a5dbf326e90"
skip_extraction=perl-cross-${_perl_cross_version}.tar.gz
if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
makedepends+=" libxcrypt-devel"
depends+=" libxcrypt-devel"
fi
# Before updating this package to a new major version, run
# ${FILESDIR}/update-perl-provides.pl ${wrksrc} perl/template
# to find the list of built in packages.
provides="perl-Archive-Tar-2.40_1
perl-Attribute-Handlers-1.03_1
perl-AutoLoader-5.74_1
perl-CPAN-2.36_1
perl-CPAN-Meta-2.150010_1
perl-CPAN-Meta-Requirements-2.140_1
perl-CPAN-Meta-YAML-0.018_1
perl-Carp-1.54_1
perl-Compress-Raw-Bzip2-2.204.001_1
perl-Compress-Raw-Zlib-2.204.001_1
perl-Config-Perl-V-0.36_1
perl-DB_File-1.858_1
perl-Data-Dumper-2.188_1
perl-Devel-PPPort-3.71_1
perl-Devel-SelfStubber-1.06_1
perl-Digest-1.20_1
perl-Digest-MD5-2.58.01_1
perl-Digest-SHA-6.04_1
perl-Dumpvalue-1.21_1
perl-Encode-3.19_1
perl-Env-1.06_1
perl-Exporter-5.77_1
perl-ExtUtils-CBuilder-0.280238_1
perl-ExtUtils-Constant-0.25_1
perl-ExtUtils-Install-2.22_1
perl-ExtUtils-MakeMaker-7.70_1
perl-ExtUtils-Manifest-1.73_1
perl-ExtUtils-PL2Bat-0.005_1
perl-ExtUtils-ParseXS-3.51_1
perl-File-Fetch-1.04_1
perl-File-Path-2.18_1
perl-File-Temp-0.2311_1
perl-Filter-Simple-0.96_1
perl-Filter-Util-Call-1.64_1
perl-FindBin-1.53_1
perl-Getopt-Long-2.54_1
perl-HTTP-Tiny-0.086_1
perl-I18N-Collate-1.02_1
perl-I18N-LangTags-0.45_1
perl-IO-1.52_1
perl-IO-Compress-2.204_1
perl-IO-Socket-IP-0.41.01_1
perl-IO-Zlib-1.14_1
perl-IPC-Cmd-1.04_1
perl-IPC-SysV-2.09_1
perl-JSON-PP-4.16_1
perl-Locale-Maketext-1.33_1
perl-Locale-Maketext-Simple-0.21.01_1
perl-MIME-Base64-3.16.01_1
perl-Math-BigInt-1.999837_1
perl-Math-BigInt-FastCalc-0.5013_1
perl-Math-BigRat-0.2624_1
perl-Math-Complex-1.62_1
perl-Memoize-1.16_1
perl-Module-CoreList-5.20231125_1
perl-Module-Load-0.36_1
perl-Module-Load-Conditional-0.74_1
perl-Module-Loaded-0.08_1
perl-Module-Metadata-1.000037_1
perl-NEXT-0.69_1
perl-Net-Ping-2.76_1
perl-Params-Check-0.38_1
perl-PathTools-3.89_1
perl-Perl-OSType-1.010_1
perl-PerlIO-via-QuotedPrint-0.10_1
perl-Pod-Checker-1.75_1
perl-Pod-Escapes-1.07_1
perl-Pod-Perldoc-3.2801_1
perl-Pod-Simple-3.43_1
perl-Pod-Usage-2.03_1
perl-Safe-2.44_1
perl-Scalar-List-Utils-1.63_1
perl-Search-Dict-1.07_1
perl-SelfLoader-1.26_1
perl-Socket-2.036_1
perl-Storable-3.32_1
perl-Sys-Syslog-0.36_1
perl-Term-ANSIColor-5.01_1
perl-Term-Cap-1.18_1
perl-Term-Complete-1.403_1
perl-Term-ReadLine-1.17_1
perl-Test-1.31_1
perl-Test-Harness-3.44_1
perl-Test-Simple-1.302194_1
perl-Text-Abbrev-1.02_1
perl-Text-Balanced-2.06_1
perl-Text-ParseWords-3.31_1
perl-Text-Tabs-2021.0814_1
perl-Thread-Queue-3.14_1
perl-Thread-Semaphore-2.13_1
perl-Tie-File-1.07_1
perl-Tie-RefHash-1.40_1
perl-Time-HiRes-1.9775_1
perl-Time-Local-1.30_1
perl-Time-Piece-1.3401.01_1
perl-Unicode-Collate-1.31_1
perl-Unicode-Normalize-1.32_1
perl-Win32-0.59_1
perl-Win32API-File-0.1203.01_1
perl-XSLoader-0.32_1
perl-autodie-2.36_1
perl-autouse-1.11_1
perl-base-2.27_1
perl-bignum-0.66_1
perl-constant-1.33_1
perl-encoding-warnings-0.14_1
perl-experimental-0.031_1
perl-if-0.0610_1
perl-lib-0.65_1
perl-libnet-3.15_1
perl-parent-0.241_1
perl-perlfaq-5.20210520_1
perl-podlators-5.010_1
perl-threads-2.36_1
perl-threads-shared-1.68_1
perl-version-0.9929_1"
for f in ${provides}; do
replaces+=" $($XBPS_UHELPER_CMD getpkgname ${f})>=0"
done
post_extract() {
local TAR=$(command -v bsdtar || command -v tar)
$TAR --strip-components=1 -xf \
${XBPS_SRCDISTDIR}/${pkgname}-${version}/perl-cross-$_perl_cross_version.tar.gz
[ -n "${SOURCE_DATE_EPOCH}" ] && touch -h -d @$SOURCE_DATE_EPOCH patchlevel.h
}
do_configure() {
local _args="-Dusethreads -Duseshrplib -Dusesoname -Dusevendorprefix
-Dprefix=/usr -Dvendorprefix=/usr
-Dprivlib=/usr/share/perl5/core_perl
-Darchlib=/usr/lib/perl5/core_perl
-Dsitelib=/usr/share/perl5/site_perl
-Dsitearch=/usr/lib/perl5/site_perl
-Dvendorlib=/usr/share/perl5/vendor_perl
-Dvendorarch=/usr/lib/perl5/vendor_perl
-Dscriptdir=/usr/bin -Dvendorscript=/usr/bin
-Dinc_version_list=none -Dman1ext=1p -Dman3ext=3p
-Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3
-Dd_sockaddr_in6=define"
if [ "$CROSS_BUILD" ]; then
_args+=" --target=$XBPS_CROSS_TRIPLET"
fi
LDFLAGS+=" -Wl,-z,stack-size=2097152 -pthread"
export HOSTLDFLAGS+=" -pthread"
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
export HOSTCFLAGS+=" -D_GNU_SOURCE"
export CFLAGS+=" -DNO_POSIX_2008_LOCALE -D_GNU_SOURCE"
else
export CFLAGS+=" -D_FILE_OFFSET_BITS=64 -DLARGE_FILE_SUPPORT64"
fi
export LD="$CC"
./configure --prefix=/usr $_args \
-Dcccdlflags="-fPIC" \
-Doptimize=" -Wall ${CFLAGS} " -Dccflags=" ${CFLAGS} " \
-Dlddlflags="-shared ${LDFLAGS}" -Dldflags="${LDFLAGS}" \
-Dperl_static_inline='static __inline__' -Dd_static_inline ||
{
cat ./config.log
return 42
}
}
do_check() {
export LD="$CC"
export PERL_BUILD_PACKAGING=1
TEST_JOBS=${XBPS_MAKEJOBS} make test
}
post_install() {
find ${DESTDIR}/usr/share -type f -exec chmod 644 {} \;
find ${DESTDIR}/usr/lib -type f -exec chmod 644 {} \;
# Make a symbolic link from perl to perl${version}.
ln -sf perl ${DESTDIR}/usr/bin/perl${version}
# Remove all pod files *except* those under
# /usr/share/perl5/core_perl/pod/ (FS#16488)
rm -f ${DESTDIR}/usr/share/perl5/core_perl/*.pod
for d in ${DESTDIR}/usr/share/perl5/core_perl/*; do
if [ -d $d -a $(basename $d) != "pod" ]; then
find $d -name *.pod -delete
fi
done
find ${DESTDIR}/usr/lib -name *.pod -delete
find ${DESTDIR} -name .packlist -delete
# Remove references to hardening -specs.
sed -e "s|-specs=.*hardened-ld||g" -e "s|-specs=.*hardened-cc1||g" \
-i ${DESTDIR}/usr/lib/perl5/core_perl/Config_heavy.pl
# HOTFIX
# ln -sfr ${DESTDIR}/usr/lib/perl5/core_perl/CORE/libperl.so.${version} ${DESTDIR}/usr/lib/
# ln -sfr ${DESTDIR}/usr/lib/perl5/core_perl/CORE/libperl.so.${version} ${DESTDIR}/usr/lib/libperl.so
}