1 | # -*- 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 |
---|
2 | # $Id: Portfile 91580 2012-04-06 06:26:53Z jmr@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name perl5.16 |
---|
7 | version 5.16.0 |
---|
8 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
9 | categories lang |
---|
10 | license {Artistic-1 GPL} |
---|
11 | platforms darwin freebsd linux |
---|
12 | maintainers ricci openmaintainer |
---|
13 | description Perl 5.16.x - Practical Extraction and Report Language |
---|
14 | |
---|
15 | long_description \ |
---|
16 | Perl is a general-purpose programming language originally developed \ |
---|
17 | for text manipulation and now used for a wide range of tasks including \ |
---|
18 | system administration, web development, network programming, GUI \ |
---|
19 | development, and more. |
---|
20 | |
---|
21 | distname perl-${version} |
---|
22 | use_bzip2 yes |
---|
23 | homepage http://www.perl.org/ |
---|
24 | master_sites http://www.cpan.org/src/5.0/ |
---|
25 | |
---|
26 | checksums rmd160 1a68709f25c64803afdc05a3fb9fbc1c571ba988 \ |
---|
27 | sha256 8c1d25e92a5760e84f77baa57fde5606fd6e95ec992408d36fa53c47162721d1 |
---|
28 | |
---|
29 | depends_lib-append port:gdbm |
---|
30 | |
---|
31 | patchfiles patch-Configure.diff patch-handy.h.stdbool.diff |
---|
32 | |
---|
33 | platform darwin { |
---|
34 | patchfiles-append patch-hints_darwin.sh.diff |
---|
35 | ## patchfiles-append patch-hints_darwin.diff \ |
---|
36 | ## patch-perl.c.diff |
---|
37 | } |
---|
38 | |
---|
39 | pre-configure { |
---|
40 | reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/Configure |
---|
41 | } |
---|
42 | |
---|
43 | configure.ccache no |
---|
44 | configure.distcc no |
---|
45 | configure.env LC_ALL=C |
---|
46 | configure.cmd sh Configure |
---|
47 | configure.pre_args |
---|
48 | configure.universal_args-delete --disable-dependency-tracking |
---|
49 | configure.post_args \ |
---|
50 | -des \ |
---|
51 | -Dprefix='${prefix}' \ |
---|
52 | -Dscriptdir='${prefix}/bin' \ |
---|
53 | -Dcppflags="\${CPPFLAGS}" \ |
---|
54 | -Dccflags="\${CFLAGS}" \ |
---|
55 | -Dldflags="\${LDFLAGS}" \ |
---|
56 | -Dvendorprefix='${prefix}' \ |
---|
57 | -Dusemultiplicity=y \ |
---|
58 | -D cc=\${CC} \ |
---|
59 | -D ld=\${CC} \ |
---|
60 | -D man1ext='1pm' \ |
---|
61 | -D man3ext='3pm' \ |
---|
62 | -D man1dir='${prefix}/share/man/man1p' \ |
---|
63 | -D man3dir='${prefix}/share/man/man3p' \ |
---|
64 | -D siteman1dir='${prefix}/share/man/man1' \ |
---|
65 | -D siteman3dir='${prefix}/share/man/man3' \ |
---|
66 | -D vendorman1dir='${prefix}/share/man/man1' \ |
---|
67 | -D vendorman3dir='${prefix}/share/man/man3' \ |
---|
68 | -D pager="/usr/bin/less -sR" \ |
---|
69 | -D perlpath="${prefix}/bin/perl${branch}" \ |
---|
70 | -D startperl="#!${prefix}/bin/perl${branch}" |
---|
71 | |
---|
72 | # Allow perl to find p5-* ports installed by previous (minor) versions |
---|
73 | set platsuffix "" |
---|
74 | if {${os.platform} == "darwin"} { |
---|
75 | set platsuffix "-2level" |
---|
76 | } |
---|
77 | |
---|
78 | if { [variant_isset threads] } { |
---|
79 | configure.args-append "-D inc_version_list=\"5.16.0/${os.platform}-thread-multi${platsuffix} 5.16.0 \"" |
---|
80 | } else { |
---|
81 | configure.args-append "-D inc_version_list=\"5.16.0/${os.platform}-multi${platsuffix} 5.16.0 \"" |
---|
82 | } |
---|
83 | |
---|
84 | |
---|
85 | if {[variant_isset universal]} { |
---|
86 | post-configure { |
---|
87 | system "cd ${worksrcpath} && ed - ${worksrcpath}/config.h < ${filespath}/config.h.ed" |
---|
88 | } |
---|
89 | } |
---|
90 | |
---|
91 | post-build { |
---|
92 | reinplace -E {s|-arch [a-z0-9_]+||g} \ |
---|
93 | ${worksrcpath}/lib/Config_heavy.pl |
---|
94 | } |
---|
95 | |
---|
96 | test.run yes |
---|
97 | |
---|
98 | variant threads description {Build with thread support} { |
---|
99 | configure.args-append -Dusethreads |
---|
100 | } |
---|
101 | |
---|
102 | variant shared description {Build shared perl library} { |
---|
103 | configure.args-append -Duseshrplib |
---|
104 | } |
---|
105 | |
---|
106 | variant dtrace description {Build with DTrace probes} { |
---|
107 | configure.args-append -Dusedtrace |
---|
108 | } |
---|
109 | |
---|
110 | post-destroot { |
---|
111 | # avoid conflicting with other perl versions |
---|
112 | # perl5 creates unversioned symlinks |
---|
113 | delete ${destroot}${prefix}/bin/perl |
---|
114 | foreach binFile [glob -directory "${destroot}${prefix}/bin" *] { |
---|
115 | if {$binFile != "${destroot}${prefix}/bin/perl${version}"} { |
---|
116 | move ${binFile} ${binFile}-${branch} |
---|
117 | } |
---|
118 | } |
---|
119 | move ${destroot}${prefix}/bin/perl${version} ${destroot}${prefix}/bin/${name} |
---|
120 | ln -s ${name} ${destroot}${prefix}/bin/perl${version} |
---|
121 | foreach man1File [glob -directory "${destroot}${prefix}/share/man/man1p" *] { |
---|
122 | regexp (.*)(\.1.*) ${man1File} -> program suffix |
---|
123 | move ${man1File} ${program}-${branch}${suffix} |
---|
124 | } |
---|
125 | foreach man3File [glob -directory "${destroot}${prefix}/share/man/man3p" *] { |
---|
126 | regexp (.*)(\.3.*) ${man3File} -> program suffix |
---|
127 | move ${man3File} ${program}-${branch}${suffix} |
---|
128 | } |
---|
129 | } |
---|
130 | |
---|
131 | ## livecheck.type regex |
---|
132 | ## livecheck.url http://www.cpan.org/src |
---|
133 | ## livecheck.regex latest_[join [lrange [split ${version} .] 0 1] .]_is_(\\d+(?:\\.\\d+)*) |
---|
134 | |
---|
135 | livecheck.type regex |
---|
136 | livecheck.url http://www.cpan.org/src |
---|
137 | livecheck.regex {perl-(5\.16\.\d)\.} |
---|