Permalink
Fetching contributors…
Cannot retrieve contributors at this time
252 lines (224 sloc) 10.9 KB
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup perl5 1.0
name perl5
version 5.26.1
categories lang
platforms darwin freebsd linux
license {Artistic-1 GPL}
maintainers {mojca @mojca} openmaintainer
homepage https://www.perl.org/
master_sites http://www.cpan.org/src/5.0/
# https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX/
# current Perl versions
#
# meaning of the fields:
# - version
# - subversion
# - revision
# - rmd160
# - sha256
# - size
set perl5.versions_info {
5.16 3 6 f25fdd72449156a7cbe989e8bd339fdba1afabc0 bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8 13724906
5.18 4 5 d97181a98f7acc80125b0d2a182a6a2cd7542ceb 1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5 14059430
5.20 3 4 499846a1c92e00dd357cb782bc14787b8cd47051 1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b 13743405
5.22 4 2 54fdbcbf249134dc7d82b693417900286201b5e7 8b3122046d1186598082d0e6da53193b045e85e3505e7d37ee0bdd0bdb539b71 13745983
5.24 4 1 8d6b67fc6d58334b2fdbfa9d6d7456265dca1f4e e34ff38c54857f431f37403b757267c9998152bf46b5c750b462f62461279b10 14125130
5.26 2 1 e4a1c7f5f7611a8aa9625940066559a58691a2be 3f6a6b5bbd43016e5211e24b6631ea84216dd300216a2293b41c9195032f3e81 14495883
}
foreach {perl5.v perl5.subversion perl5.revision perl5.rmd160 perl5.sha256 perl5.size} ${perl5.versions_info} {
subport perl${perl5.v} {
set perl5.major ${perl5.v}
version ${perl5.major}.[string range ${perl5.subversion} 0 0]
set minor [lrange [split ${version} .] 1 1]
revision ${perl5.revision}
checksums rmd160 ${perl5.rmd160} sha256 ${perl5.sha256} size ${perl5.size}
description Perl ${version} - Practical Extraction and Report Language
long_description Perl is a general-purpose programming language \
originally developed for text manipulation and now \
used for a wide range of tasks including system \
administration, web development, network \
programming, GUI development, and more.
depends_lib-append port:gdbm
distname perl-${perl5.major}.${perl5.subversion}
dist_subdir perl${perl5.major}
use_bzip2 yes
# TODO: revise patch naming scheme
patchfiles ${perl5.major}/clean-up-paths.patch \
${perl5.major}/avoid-no-cpp-precomp-PR38913.patch
# - Prevent build from picking up the bind9 port's static libbind, which
# duplicates symbols from /usr/lib/libdl (r10638).
# - Don't link against cryptlib
# https://trac.macports.org/ticket/53446
patchfiles-append ${perl5.major}/patch-Configure-remove-libs.diff
# Prevent miniperl linking from accidentally finding our libstdc++
# https://trac.macports.org/ticket/36438
patchfiles-append ${perl5.major}/fix-miniperl-linking-PR36438.patch
# Install files under 5.xx rather than 5.xx.yy
# https://trac.macports.org/ticket/43480
patchfiles-append ${perl5.major}/install-under-short-version-PR43480.patch
if {${perl5.major} == 5.16} {
patchfiles-append \
${perl5.major}/use-stdbool.patch
# Avoid a C++ linkage trick that recent Clang doesn't like. See #43150
# and https://rt.perl.org/Public/Bug/Display.html?id=121714.
patchfiles-append \
${perl5.major}/fix-cxx-dNOOP-PR43150.patch
}
if {${perl5.major} >= 5.22 && ${perl5.major} <= 5.24} {
# failed test
# https://trac.macports.org/ticket/51327
patchfiles-append \
${perl5.major}/patch-dist-IO-t-cachepropagate-unix.t.diff
}
if {${perl5.major} == 5.24} {
patchfiles-append \
${perl5.major}/fix-ld-modification.patch
}
if {${perl5.major} < 5.24} {
# Do not compile for 10.3/10.4
# https://trac.macports.org/ticket/51980
patchfiles-append \
${perl5.major}/remove-10.3-target-PR126360.patch
}
if {${perl5.major} == 5.26} {
# enable syscall() on Sierra for compatibility with earlier OS versions and perl5.24
# Apple has deprecated syscall() on Sierra but it is still available
patchfiles-append \
${perl5.major}/enable-syscall-on-sierra.patch
}
post-patch {
reinplace -W ${worksrcpath} "s|__PREFIX__|${prefix}|g" \
Configure Makefile.SH
}
configure.ccache no
configure.distcc no
configure.env LC_ALL=C
configure.cmd sh Configure
configure.pre_args
configure.universal_args-delete \
--disable-dependency-tracking
configure.post_args -des \
-Dprefix='${prefix}' \
-Dscriptdir='${prefix}/bin' \
-Dvendorprefix='${prefix}' \
-Dusemultiplicity=y \
-Dusethreads \
-Duseshrplib \
{-Dcc="$CC"} \
-Dman1ext=1pm \
-Dman3ext=3pm \
-Dinstallstyle='lib/perl5' \
-Dman1dir='${prefix}/share/man/man1p' \
-Dman3dir='${prefix}/share/man/man3p' \
-Dsitebin='${prefix}/libexec/perl${perl5.major}/sitebin' \
-Dsiteman1dir='${prefix}/share/perl${perl5.major}/siteman/man1' \
-Dsiteman3dir='${prefix}/share/perl${perl5.major}/siteman/man3' \
-Dvendorbin='${prefix}/libexec/perl${perl5.major}' \
-Dvendorman1dir='${prefix}/share/perl${perl5.major}/man/man1' \
-Dvendorman3dir='${prefix}/share/perl${perl5.major}/man/man3' \
-Dpager='/usr/bin/less -sR' \
-Dperlpath="${perl5.bin}" \
-Dstartperl="#!${perl5.bin}" \
{-Acppflags="$CPPFLAGS"} \
{-Accflags="$CFLAGS"} \
{-Alddlflags="$LDFLAGS"} \
{-Aldflags="$LDFLAGS"}
if {[variant_isset universal]} {
post-configure {
system "cd ${worksrcpath} && ed - ${worksrcpath}/config.h < ${filespath}/${perl5.major}/config.h.ed"
}
}
post-build {
reinplace -E {s/-arch [a-z0-9_]+//g} \
${worksrcpath}/lib/Config_heavy.pl
}
test.run yes
variant dtrace description {Build with DTrace probes} {
configure.args-append -Dusedtrace
}
post-destroot {
# avoid conflicting with other perl versions
# perl5 creates unversioned symlinks
delete ${destroot}${prefix}/bin/perl
foreach binFile [glob -directory "${destroot}${prefix}/bin" *] {
if {$binFile ne "${destroot}${prefix}/bin/perl${version}"} {
move ${binFile} ${binFile}-${perl5.major}
}
}
move ${destroot}${prefix}/bin/perl${version} ${destroot}${prefix}/bin/${subport}
ln -s ${subport} ${destroot}${prefix}/bin/perl${version}
foreach man1File [glob -directory "${destroot}${prefix}/share/man/man1p" *] {
regexp (.*)(\.1.*) ${man1File} -> program suffix
move ${man1File} ${program}-${perl5.major}${suffix}
}
foreach man3File [glob -directory "${destroot}${prefix}/share/man/man3p" *] {
regexp (.*)(\.3.*) ${man3File} -> program suffix
move ${man3File} ${program}-${perl5.major}${suffix}
}
}
livecheck.type regex
livecheck.url http://www.cpan.org/src
livecheck.regex perl-(5\\.${minor}\\.\\d)\\.
}
}
# wrapper port
if {$subport eq $name} {
description Wrapper port for Perl 5.x
long_description ${description}
supported_archs noarch
perl5.require_variant yes
perl5.conflict_variants yes
perl5.branches 5.26
perl5.default_branch 5.26
perl5.create_variants ${perl5.branches}
distfiles
use_configure no
build {}
##
## Note: the destroot section below currently uses lists of files
## to know what files to link. In the future we can use
## something like:
## set contents_list [registry_port_registered $portname])
## to get the lists of binaries and man pages installed by
## the perl5.x ports.
##
destroot {
if {[file exists ${perl5.bin}]} {
ln -s perl${perl5.major} ${destroot}${prefix}/bin/${name}
ln -s perl${perl5.major} ${destroot}${prefix}/bin/perl
} else {
ui_error "Can't find perl ${perl5.major} (as ${perl5.bin}) so can't link $name to it."
return -code error "perl${perl5.major} is missing"
}
# some binaries are not included in the list because they would conflict
# with module ports:
# config_data -> p5-module-build (ticket #24025)
# corelist -> p5-module-corelist (ticket #28485)
# instmodsh -> p5-extutils-makemaker (ticket #24590)
# ptar, ptardiff -> p5-archive-tar (ticket #28255)
# shasum -> p5-digest-sha (ticket #28580)
foreach list {binList man1pList man3pList} {
set fd [open ${filespath}/${list}]; set $list [read $fd]; close $fd
}
foreach binFile $binList {
if {[file exists ${prefix}/bin/${binFile}-${perl5.major}]} {
ln -s ${binFile}-${perl5.major} ${destroot}${prefix}/bin/${binFile}
}
}
file mkdir ${destroot}${prefix}/share/man/man1p
foreach manFile $man1pList {
if {[file exists ${prefix}/share/man/man1p/${manFile}-${perl5.major}.1pm]} {
ln -s ${manFile}-${perl5.major}.1pm ${destroot}${prefix}/share/man/man1p/${manFile}.1pm
}
}
file mkdir ${destroot}${prefix}/share/man/man3p
foreach manFile $man3pList {
if {[file exists ${prefix}/share/man/man3p/${manFile}-${perl5.major}.3pm]} {
ln -s ${manFile}-${perl5.major}.3pm ${destroot}${prefix}/share/man/man3p/${manFile}.3pm
}
}
}
livecheck.type none
}