[143612] trunk/dports/lang

mojca at macports.org mojca at macports.org
Tue Dec 15 14:30:36 PST 2015


Revision: 143612
          https://trac.macports.org/changeset/143612
Author:   mojca at macports.org
Date:     2015-12-15 14:30:35 -0800 (Tue, 15 Dec 2015)
Log Message:
-----------
perl5[.x]: merge all Perl ports into a single Portfile with subports (see also #49982)

Modified Paths:
--------------
    trunk/dports/lang/perl5/Portfile

Added Paths:
-----------
    trunk/dports/lang/perl5/files/5.16/
    trunk/dports/lang/perl5/files/5.18/
    trunk/dports/lang/perl5/files/5.20/
    trunk/dports/lang/perl5/files/5.22/

Removed Paths:
-------------
    trunk/dports/lang/perl5/files/5.18/perl5.18
    trunk/dports/lang/perl5.10/
    trunk/dports/lang/perl5.12/
    trunk/dports/lang/perl5.14/
    trunk/dports/lang/perl5.16/
    trunk/dports/lang/perl5.18/
    trunk/dports/lang/perl5.20/
    trunk/dports/lang/perl5.22/
    trunk/dports/lang/perl5.8/

Modified: trunk/dports/lang/perl5/Portfile
===================================================================
--- trunk/dports/lang/perl5/Portfile	2015-12-15 21:26:55 UTC (rev 143611)
+++ trunk/dports/lang/perl5/Portfile	2015-12-15 22:30:35 UTC (rev 143612)
@@ -2,94 +2,227 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           perl5 1.0
 
 name                perl5
 version             5.22.1
 categories          lang
-license             BSD
 platforms           darwin freebsd linux
-maintainers         nomaintainer
-supported_archs     noarch
+license             {Artistic-1 GPL}
+maintainers         devans mojca openmaintainer
 
-description         Wrapper port for perl 5.x
-long_description    ${description}
-
 homepage            http://www.perl.org/
-distfiles
+master_sites        http://www.cpan.org/src/5.0/
 
-use_configure       no
-build               {}
+# obsolete Perl versions; remove after 2016-12-09
+foreach perl5.major {5.8 5.10 5.12 5.14} {
+    subport perl${perl5.major} {
+        version             5.22.0
+        replaced_by         perl5.22
+        PortGroup           obsolete 1.0
+    }
+}
 
-if {[variant_isset perl5_16]} {
-    set branch 5.16
-} elseif {[variant_isset perl5_18]} {
-    set branch 5.18
-} elseif {[variant_isset perl5_20]} {
-    set branch 5.20
-} else {
-    set branch 5.22
-    default_variants +perl5_22
+# current Perl versions
+#
+# meaning of the fields:
+# - version
+# - subversion
+# - revision
+# - rmd160 sha256
+set perl5.versions_info {
+    5.16 3 1 f25fdd72449156a7cbe989e8bd339fdba1afabc0  bb7bc735e6813b177dcfccd480defcde7eddefa173b5967eac11babd1bfa98e8
+    5.18 4 1 d97181a98f7acc80125b0d2a182a6a2cd7542ceb  1fb4d27b75cd244e849f253320260efe1750641aaff4a18ce0d67556ff1b96a5
+    5.20 3 0 499846a1c92e00dd357cb782bc14787b8cd47051  1b40068166c242e34a536836286e70b78410602a80615143301e52aa2901493b
+    5.22 1 0 99e3af98d80ace857da6ce28679a2e35a4360144  e98e4075a3167fa40524abe447c30bcca10c60e02a54ee1361eff278947a1221
 }
 
-##
-## 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 ${prefix}/bin/perl${branch}]} {
-        ln -s perl${branch} ${destroot}${prefix}/bin/${name}
-        ln -s perl${branch} ${destroot}${prefix}/bin/perl
-    } else {
-        ui_error "Can't find perl ${branch} (as ${prefix}/bin/perl${branch}) so can't link $name to it."
-        return -code error "perl${version} 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}-${branch}]} {
-            ln -s ${binFile}-${branch} ${destroot}${prefix}/bin/${binFile}
+foreach {perl5.major perl5.subversion perl5.revision perl5.rmd160 perl5.sha256} ${perl5.versions_info} {
+    subport perl${perl5.major} {
+        version             ${perl5.major}.${perl5.subversion}
+        set minor           [lrange [split ${version} .] 1 1]
+        revision            ${perl5.revision}
+        checksums           rmd160 ${perl5.rmd160} sha256 ${perl5.sha256}
+
+        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-${version}
+        dist_subdir         perl${perl5.major}
+        use_bzip2           yes
+
+        patchfiles          ${perl5.major}/clean-up-paths.patch \
+                            ${perl5.major}/avoid-no-cpp-precomp-PR38913.patch \
+                            ${perl5.major}/fix-ld-modification.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
+        } else {
+            patchfiles-append \
+                            ${perl5.major}/install-under-short-version-PR43480.patch \
         }
-    }
-    file mkdir ${destroot}${prefix}/share/man/man1p
-    foreach manFile $man1pList {
-        if {[file exists ${prefix}/share/man/man1p/${manFile}-${branch}.1pm]} {
-            ln -s ${manFile}-${branch}.1pm ${destroot}${prefix}/share/man/man1p/${manFile}.1pm
+
+        # Prevent build from picking up the bind9 port's static libbind, which
+        # duplicates symbols from /usr/lib/libdl (r10638).
+        patchfiles-append   ${perl5.major}/avoid-bind9-linking.patch
+
+        # Prevent miniperl linking from accidentally finding our libstdc++
+        # (#36438).
+        patchfiles-append   ${perl5.major}/fix-miniperl-linking-PR36438.patch
+
+        post-patch {
+            reinplace -W ${worksrcpath} "s|__PREFIX__|${prefix}|g" \
+                    Configure Makefile.SH
         }
-    }
-    file mkdir ${destroot}${prefix}/share/man/man3p
-    foreach manFile $man3pList {
-        if {[file exists ${prefix}/share/man/man3p/${manFile}-${branch}.3pm]} {
-            ln -s ${manFile}-${branch}.3pm ${destroot}${prefix}/share/man/man3p/${manFile}.3pm
+
+        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' \
+                           {-Dcppflags="$CPPFLAGS"} \
+                           {-Dccflags="$CFLAGS"} \
+                           {-Dldflags="$LDFLAGS"} \
+                            -Dvendorprefix='${prefix}' \
+                            -Dusemultiplicity=y \
+                            -Dusethreads \
+                            -Duseshrplib \
+                           {-Dcc="$CC"} \
+                           {-Dld="env MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET $CC"} \
+                            -Dman1ext=1pm \
+                            -Dman3ext=3pm \
+                            -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}"
+
+        if {[variant_isset universal]} {
+            post-configure {
+                system "cd ${worksrcpath} && ed - ${worksrcpath}/config.h < ${filespath}/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/${name}
+            ln -s ${name} ${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)\\.
     }
 }
 
-variant perl5_16 conflicts perl5_18 perl5_20 perl5_22 description {use perl 5.16} {
-    depends_lib-append  port:perl5.16
-}
+# wrapper port
+if {$subport eq $name} {
+    description             Wrapper port for Perl 5.x
+    long_description        ${description}
 
-variant perl5_18 conflicts perl5_16 perl5_20 perl5_22 description {use perl 5.18} {
-    depends_lib-append  port:perl5.18
-}
+    supported_archs         noarch
 
-variant perl5_20 conflicts perl5_16 perl5_18 perl5_22 description {use perl 5.20} {
-    depends_lib-append  port:perl5.20
-}
+    perl5.require_variant   yes
+    perl5.conflict_variants yes
+    perl5.branches          5.16 5.18 5.20 5.22
+    perl5.create_variants   ${perl5.branches}
 
-variant perl5_22 conflicts perl5_16 perl5_18 perl5_20 description {use perl 5.22} {
-    depends_lib-append  port:perl5.22
+    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}-${branch}]} {
+                ln -s ${binFile}-${branch} ${destroot}${prefix}/bin/${binFile}
+            }
+        }
+        file mkdir ${destroot}${prefix}/share/man/man1p
+        foreach manFile $man1pList {
+            if {[file exists ${prefix}/share/man/man1p/${manFile}-${branch}.1pm]} {
+                ln -s ${manFile}-${branch}.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}-${branch}.3pm]} {
+                ln -s ${manFile}-${branch}.3pm ${destroot}${prefix}/share/man/man3p/${manFile}.3pm
+            }
+        }
+    }
+
+    livecheck.type      none
 }
-
-livecheck.type      none

Deleted: trunk/dports/lang/perl5/files/5.18/perl5.18
===================================================================
--- trunk/dports/lang/perl5.18/files/perl5.18	2015-12-15 21:26:55 UTC (rev 143611)
+++ trunk/dports/lang/perl5/files/5.18/perl5.18	2015-12-15 22:30:35 UTC (rev 143612)
@@ -1,42 +0,0 @@
-bin/a2p-5.18
-bin/c2ph-5.18
-bin/config_data-5.18
-bin/corelist-5.18
-bin/cpan-5.18
-bin/cpan2dist-5.18
-bin/cpanp-5.18
-bin/cpanp-run-perl-5.18
-bin/enc2xs-5.18
-bin/find2perl-5.18
-bin/h2ph-5.18
-bin/h2xs-5.18
-bin/instmodsh-5.18
-bin/json_pp-5.18
-bin/libnetcfg-5.18
-bin/perl5.18
-bin/perl5.18.1
-bin/perlbug-5.18
-bin/perldoc-5.18
-bin/perlivp-5.18
-bin/perlthanks-5.18
-bin/piconv-5.18
-bin/pl2pm-5.18
-bin/pod2html-5.18
-bin/pod2latex-5.18
-bin/pod2man-5.18
-bin/pod2text-5.18
-bin/pod2usage-5.18
-bin/podchecker-5.18
-bin/podselect-5.18
-bin/prove-5.18
-bin/psed-5.18
-bin/pstruct-5.18
-bin/ptar-5.18
-bin/ptardiff-5.18
-bin/ptargrep-5.18
-bin/s2p-5.18
-bin/shasum-5.18
-bin/splain-5.18
-bin/xsubpp-5.18
-bin/zipdetails-5.18
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151215/26729d34/attachment-0001.html>


More information about the macports-changes mailing list