Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / lang / perl5 / Makefile
blob6635020b2ee19a08c6416e7fe8a229a0b52bea0d
1 # $NetBSD: Makefile,v 1.199 2013/04/03 09:28:55 adam Exp $
3 .include "license.mk"
4 .include "Makefile.common"
6 COMMENT= Practical Extraction and Report Language
8 CONFLICTS= perl-base-[0-9]* perl-thread-[0-9]* \
9 p5-CGI-2.66{,nb*} p5-CGI-2.75{,nb*} p5-CGI-2.75.[0-2] \
10 p5-Tie-File-0.96{,nb*} \
11 p5-Memoize-1.01{,nb*} \
12 p5-I18N-LangTags<0.35 \
13 p5-Locale-Maketext-1.[0-9]*{,nb*} \
14 p5-Locale-Maketext-Simple<0.21 \
15 p5-Digest<=1.16 \
16 p5-Digest-MD5<=2.39 \
17 p5-Digest-SHA<2.48
19 SUPERSEDES+= p5-Tie-File<0.97
20 SUPERSEDES+= p5-Memoize<1.02
21 SUPERSEDES+= p5-I18N-LangTags<=0.35
22 SUPERSEDES+= p5-Locale-Maketext<=1.15
24 .include "../../mk/bsd.prefs.mk"
26 # Determine the Perl API version from the patchlevel.h file from the
27 # source distribution.
29 PERL5_API_VERS= ${PERL5_API_VERS_cmd:sh}
30 PERL5_API_VERS_cmd= \
31 if ${TEST} -f ${WRKSRC}/patchlevel.h; then \
32 ${AWK} '/\#define[ ]*PERL_API_REVISION/ { R = $$3 }\
33 /\#define[ ]*PERL_API_VERSION/ { r = "."$$3 } \
34 /\#define[ ]*PERL_API_SUBVERSION/ { s = "."$$3 } \
35 END { printf "%s%s%s\n", R, r, s }' \
36 ${WRKSRC}/patchlevel.h; \
37 else \
38 ${ECHO} "unknown"; \
41 .include "dirs.mk"
43 .include "../../mk/compiler.mk"
45 HAS_CONFIGURE= yes
46 CONFIGURE_SCRIPT= ./Configure
47 CONFIGURE_ARGS+= -sde
48 MAKE_ENV+= LC_ALL="C"
50 TEST_TARGET= test
52 # Policy.sh generation
53 # (see comments in files/Policy.sh)
54 SUBST_CLASSES+= policysh
55 SUBST_STAGE.policysh= pre-configure
56 SUBST_FILES.policysh= Policy.sh
57 SUBST_VARS.policysh+= MACHINE_ARCH
58 SUBST_VARS.policysh+= LOWER_OPSYS
59 SUBST_VARS.policysh+= OBJECT_FMT
60 SUBST_VARS.policysh+= CC
61 SUBST_VARS.policysh+= CFLAGS
62 SUBST_VARS.policysh+= LDFLAGS
63 SUBST_VARS.policysh+= COMPILER_RPATH_FLAG
64 SUBST_VARS.policysh+= PERL5_PREFIX
65 SUBST_VARS.policysh+= PERL5_SITEPREFIX
66 SUBST_VARS.policysh+= PERL5_VENDORPREFIX
67 SUBST_VARS.policysh+= PERL5_PERLBASE
68 SUBST_VARS.policysh+= PERL5_SITEBASE
69 SUBST_VARS.policysh+= PERL5_SITEBIN
70 SUBST_VARS.policysh+= PERL5_VENDORBASE
71 SUBST_VARS.policysh+= PERL5_PRIVLIB
72 SUBST_VARS.policysh+= PERL5_SITELIB
73 SUBST_VARS.policysh+= PERL5_VENDORLIB
74 SUBST_VARS.policysh+= PKGMANDIR
75 SUBST_VARS.policysh+= LOCALBASE
76 SUBST_VARS.policysh+= PTHREAD_LDFLAGS
78 .if ${OPSYS} == "Darwin" || ${OPSYS} == "Cygwin"
80 # The Perl build attempts to work around case-insensitivity problems on
81 # HFS filesystems by using GNUmakefiles, so we need to use GNU make.
83 USE_TOOLS+= gmake
84 MAKE_FILE= GNUmakefile
85 .endif
88 # For the moment disable the building of a shared libperl.dylib on Darwin
89 # => 9.0 as it breaks the build. This should just be considered a temporary
90 # work around until the actual problem can be fixed as this worked for
91 # Darwin < 9.0.
93 .if empty(MACHINE_PLATFORM:MDarwin-9.*-*)
94 CONFIGURE_ARGS+= -Duseshrplib
95 .endif
97 # Perl embeds the full paths to the following tools in several installed
98 # files, so make sure the paths to the ones in ${TOOLS_DIR} aren't used.
100 USE_TOOLS+= hostname ln sed test
101 SUBST_VARS.policysh+= TOOLS_HOSTNAME_CMD
102 SUBST_VARS.policysh+= TOOLS_LN
103 TOOLS_ALIASES.sed+= ${TOOLS_SED:T}
104 SUBST_VARS.policysh+= TOOLS_SED
105 SUBST_VARS.policysh+= TOOLS_SH
106 SUBST_VARS.policysh+= TOOLS_TEST
107 SUBST_VARS.policysh+= FALSE
109 # Nail down the needed libraries for each platform here to avoid hidden
110 # dependencies. If this isn't defined, then use the perl defaults for the
111 # particular operating system.
113 LIBSWANTED.Cygwin= m crypt dl
114 LIBSWANTED.Darwin= m c
115 LIBSWANTED.DragonFly= m crypt
116 LIBSWANTED.FreeBSD= m crypt
117 LIBSWANTED.HPUX= cl pthread $$libswanted # see Perl's README.hpux
118 LIBSWANTED.IRIX= m crypt
119 LIBSWANTED.Interix= m dl
120 LIBSWANTED.Linux= m crypt dl nsl
121 LIBSWANTED.MirBSD= m crypt
122 LIBSWANTED.NetBSD= m crypt
123 LIBSWANTED.OpenBSD= m crypt
124 LIBSWANTED.SunOS= m crypt dl socket nsl
125 LIBSWANTED.AIX= m crypt dl socket nsl bind c
126 LIBSWANTED= ${LIBSWANTED.${OPSYS}}
127 SUBST_VARS.policysh+= LIBSWANTED
129 # Nail down the directories in which the system libraries may be found.
130 # If this isn't defined, then use the perl defaults for the particular
131 # operating system.
133 SYSLIBPATH.Cygwin= /usr/lib
134 SYSLIBPATH.Darwin= /usr/lib
135 SYSLIBPATH.DragonFly= /usr/lib
136 SYSLIBPATH.FreeBSD= /usr/lib
137 SYSLIBPATH.Haiku= /boot/common/lib
138 SYSLIBPATH.Interix= /usr/lib
139 SYSLIBPATH.MirBSD= /usr/lib
140 SYSLIBPATH.NetBSD= /usr/lib
141 SYSLIBPATH.OpenBSD= /usr/lib
142 SYSLIBPATH.SunOS= /usr/lib
143 SYSLIBPATH.AIX= /usr/lib
144 SYSLIBPATH= ${SYSLIBPATH.${OPSYS}}
145 SUBST_VARS.policysh+= SYSLIBPATH
147 .include "../../mk/dlopen.buildlink3.mk"
148 .include "options.mk"
150 .if !empty(MACHINE_PLATFORM:MMirBSD*)
151 SUBST_CLASSES+= mirbsd-paths
152 SUBST_STAGE.mirbsd-paths= pre-configure
153 SUBST_FILES.mirbsd-paths= hints/mirbsd.sh
154 SUBST_SED.mirbsd-paths= -e 's,/usr/mpkg,${PREFIX},g'
155 SUBST_MESSAGE.mirbsd-paths= Do not use non-pkgsrc paths on MirBSD.
156 .endif
158 # Remove a spurious workdir reference
159 SUBST_CLASSES+= rm
160 SUBST_STAGE.rm= pre-install
161 SUBST_FILES.rm= lib/Config_heavy.pl
162 SUBST_MESSAGE.rm= Do not use tools version of rm.
163 SUBST_SED.rm= -e "s!^rm_try='/.*/\\.tools/bin/rm -f!rm_try='/bin/rm -f!"
165 # Replace our perl as the interpreter
166 REPLACE_PERL+= lib/File/DosGlob.pm
167 REPLACE_PERL+= lib/unicore/mktables
168 REPLACE_PERL+= lib/version.pm
169 REPLACE_PERL+= dist/bignum/lib/Math/BigFloat/Trace.pm
170 REPLACE_PERL+= dist/bignum/lib/Math/BigInt/Trace.pm
171 REPLACE_PERL+= dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
173 # And replace a perl interpreter during the pre-install stage
174 # I think this may be a bootstrap script, so can't use REPLACE_PERL
175 # because that is acted upon already in the pre-configure stage
176 SUBST_CLASSES+= miniperl
177 SUBST_STAGE.miniperl= pre-install
178 SUBST_FILES.miniperl= lib/ExtUtils/xsubpp
179 SUBST_SED.miniperl= -e "1s:\#!./miniperl:\#!${PERL5}:"
181 .if ${PKGSRC_COMPILER} == "xlc"
182 SUBST_CLASSES+= cpprun
183 SUBST_STAGE.cpprun= pre-install
184 SUBST_FILES.cpprun= lib/Config_heavy.pl
185 . if !empty(PKG_OPTIONS:Mthreads)
186 SUBST_SED.cpprun= -e "s/cpprun=''/cpprun='cc_r -E'/"
187 . else
188 SUBST_SED.cpprun= -e "s/cpprun=''/cpprun='cc -E'/"
189 . endif
190 .endif
192 # Some platforms may want the directory mode not to be 0755. This
193 # is, unfortunately, hardcoded in quite a few places in Perl, so
194 # let's substitute what pkgsrc says instead.
196 SUBST_CLASSES+= dirmode
197 SUBST_STAGE.dirmode= post-patch
198 SUBST_FILES.dirmode= installhtml install_lib.pl \
199 dist/ExtUtils-Install/lib/ExtUtils/Install.pm
200 SUBST_SED.dirmode= -e "s/755/${PKGDIRMODE}/g;/umask(/d"
202 post-extract:
203 cp ${FILESDIR}/Policy.sh ${WRKSRC}/Policy.sh
204 cp ${FILESDIR}/cpan-DB_File-hints-netbsd.pl \
205 ${WRKSRC}/cpan/DB_File/hints/netbsd.pl
207 pre-configure:
208 cd ${WRKSRC} && find `pwd` -name "*.orig" -type f -exec ${RM} -f {} \;
210 post-build:
211 ${SED} -e "s,@PERL5@,"${PERL5:Q}",g" \
212 -e "s,@SH@,"${SH:Q}",g" \
213 -e "s,@PKGMANDIR@,"${PKGMANDIR}",g" \
214 ${FILESDIR}/perllink.in > ${WRKDIR}/perllink.sh
216 INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
217 PERL5_PACKLIST_DIR_cmd= . ${WRKSRC}/config.sh; echo $$installarchlib
218 PERL5_PACKLIST_DIR= ${PERL5_PACKLIST_DIR_cmd:sh}
219 PERL5_PACKLIST= .packlist
220 PERL5_PACKLIST_DESTDIR= no
221 FILES_SUBST+= PERL5_COMMENT=\#
222 FILES_SUBST+= PERL5_PACKLIST=
224 post-install: perl5-post-install
226 perl5-post-install:
227 ${RUN}if ${TEST} -x ${DESTDIR}${PREFIX}/bin/a2p; then \
228 strip ${DESTDIR}${PREFIX}/bin/a2p; \
230 ${INSTALL_SCRIPT} ${WRKDIR}/perllink.sh \
231 ${DESTDIR}${PERL5_PERLBASE}/bin/perllink
232 ${INSTALL_MAN} ${FILESDIR}/perllink.1 \
233 ${DESTDIR}${PERL5_PERLBASE}/${PKGMANDIR}/man1/perllink.1
234 ${RM} -f ${DESTDIR}${PREFIX}/bin/perllink \
235 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/perllink.1
236 ${LN} -s ${PERL5_PERLBASE}/bin/perllink \
237 ${DESTDIR}${PREFIX}/bin/perllink
238 ${LN} -s ${PERL5_PERLBASE}/${PKGMANDIR}/man1/perllink.1 \
239 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/perllink.1
240 .if ${OPSYS} == "Haiku"
241 ${CHMOD} a+x ${DESTDIR}${PREFIX}/bin/perl
242 .endif
244 .include "packlist.mk"
245 .include "../../mk/bsd.pkg.mk"