diff options
author | jlam <jlam@pkgsrc.org> | 2005-05-18 22:42:07 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2005-05-18 22:42:07 +0000 |
commit | d6f6120540eaa1315ad85806fdeb1140c6e68496 (patch) | |
tree | 67b8f74bb10335e4db27319dcdd190d485ae9da0 | |
parent | b128ce5f024d2ea08fb4743141290d580c65ebe1 (diff) | |
download | pkgsrc-d6f6120540eaa1315ad85806fdeb1140c6e68496.tar.gz |
Goal: Remove USE_PERL5 from pkgsrc.
Plan:
(1) Change USE_PERL5=build into USE_TOOLS+=perl.
(2) Change all other USE_PERL5 into including perl5/buildlink3.mk.
Possibly, for packages that don't actually build anything with perl,
but merely require it for the perl interpreter, we can instead do:
USE_TOOLS+= perl
TOOLS_DEPMETHOD.perl= DEPENDS
but this is more verbose than simply including the perl5/buildlink3.mk
file.
Move the PERL5_REQD computation into a lang/perl5/version.mk file,
and only do the USE_PERL5 logic in bsd.pkg.use.mk if we're not using
the new tools framework. This consolidates all of the perl-handling
into two places -- lang/perl5 and mk/tools/perl.mk.
-rw-r--r-- | lang/libperl/buildlink3.mk | 6 | ||||
-rw-r--r-- | lang/perl5/buildlink3.mk | 16 | ||||
-rw-r--r-- | lang/perl5/module.mk | 6 | ||||
-rw-r--r-- | lang/perl5/version.mk | 38 | ||||
-rw-r--r-- | mk/bsd.pkg.use.mk | 55 | ||||
-rw-r--r-- | mk/tools/perl.mk | 16 |
6 files changed, 71 insertions, 66 deletions
diff --git a/lang/libperl/buildlink3.mk b/lang/libperl/buildlink3.mk index ee8313e69ef..9fa24dbdd6e 100644 --- a/lang/libperl/buildlink3.mk +++ b/lang/libperl/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.11 2004/09/15 14:35:11 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.12 2005/05/18 22:42:07 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ LIBPERL_BUILDLINK3_MK:= ${LIBPERL_BUILDLINK3_MK}+ @@ -11,12 +11,10 @@ BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nlibperl} BUILDLINK_PACKAGES+= libperl .if !empty(LIBPERL_BUILDLINK3_MK:M+) -BUILDLINK_DEPENDS.libperl+= {libperl>=${LIBPERL5_REQD},perl{,-thread}>=5.8.0} +BUILDLINK_DEPENDS.libperl+= {libperl>=${PERL5_REQD},perl{,-thread}>=5.8.0} BUILDLINK_PKGSRCDIR.libperl?= ../../lang/perl58 .endif # LIBPERL_BUILDLINK3_MK -LIBPERL5_REQD?= ${_PERL5_REQD} - .include "../../lang/perl5/buildlink3.mk" BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/lang/perl5/buildlink3.mk b/lang/perl5/buildlink3.mk index 65cfeedf499..c88133b1176 100644 --- a/lang/perl5/buildlink3.mk +++ b/lang/perl5/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.19 2005/05/12 21:01:16 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.20 2005/05/18 22:42:07 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ PERL5_BUILDLINK3_MK:= ${PERL5_BUILDLINK3_MK}+ @@ -13,18 +13,24 @@ BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nperl} BUILDLINK_PACKAGES+= perl .if !empty(PERL5_BUILDLINK3_MK:M+) +. if empty(_USE_NEW_TOOLS:M[yY][eE][sS]) USE_PERL5?= run PERL5_REQD+= 5.0 +. endif +USE_TOOLS+= perl -BUILDLINK_DEPENDS.perl+= {perl>=${_PERL5_REQD},perl-thread>=${_PERL5_REQD}} +BUILDLINK_DEPENDS.perl+= {perl>=${PERL5_REQD},perl-thread>=${PERL5_REQD}} BUILDLINK_RECOMMENDED.perl+= perl>=5.8.5nb6 -BUILDLINK_PKGSRCDIR.perl?= ${PERL5_PKGSRCDIR} +BUILDLINK_PKGSRCDIR.perl?= ../../lang/perl58 -.if !empty(USE_PERL5:M[bB][uU][iI][lL][dD]) +.if (defined(USE_PERL5) && !empty(USE_PERL5:Mbuild)) || \ + (defined(TOOLS_DEPMETHOD.perl) && !empty(TOOLS_DEPMETHOD.perl:MBUILD_DEPENDS)) BUILDLINK_DEPMETHOD.perl?= build +.else +TOOLS_DEPMETHOD.perl?= DEPENDS .endif -PERL5_OPTIONS?= # empty +PERL5_OPTIONS?= # empty .if !empty(PERL5_OPTIONS:Mthreads) USE_PKGINSTALL= yes INSTALL_EXTRA_TMPL+= ${.CURDIR}/../../lang/perl5/files/install.tmpl diff --git a/lang/perl5/module.mk b/lang/perl5/module.mk index 250ec4402a6..6bd4fd18b15 100644 --- a/lang/perl5/module.mk +++ b/lang/perl5/module.mk @@ -1,4 +1,4 @@ -# $NetBSD: module.mk,v 1.44 2005/04/01 22:37:44 heinz Exp $ +# $NetBSD: module.mk,v 1.45 2005/05/18 22:42:07 jlam Exp $ # # This Makefile fragment is intended to be included by packages that build # and install perl5 modules. @@ -145,6 +145,10 @@ PERL5_MAKE_FLAGS+= OTHERLDFLAGS="${LDFLAGS:S/-Wl,//g}" PERL5_MAKE_FLAGS+= OTHERLDFLAGS="${LDFLAGS}" .endif +PLIST_SUBST+= PERL5_SITELIB=${PERL5_SUB_INSTALLSITELIB} +PLIST_SUBST+= PERL5_SITEARCH=${PERL5_SUB_INSTALLSITEARCH} +PLIST_SUBST+= PERL5_ARCHLIB=${PERL5_SUB_INSTALLARCHLIB} + # Generate the PLIST from the files listed in PERL5_PACKLIST. .if defined(PERL5_PACKLIST) PERL5_PLIST_COMMENT= \ diff --git a/lang/perl5/version.mk b/lang/perl5/version.mk new file mode 100644 index 00000000000..7fe715385b9 --- /dev/null +++ b/lang/perl5/version.mk @@ -0,0 +1,38 @@ +# $NetBSD: version.mk,v 1.1 2005/05/18 22:42:07 jlam Exp $ +# +# Distill the PERL5_REQD list into a single value that is the highest +# version of Perl required. +# + +# Default to needing Perl 5. +PERL5_REQD+= 5.0 +PERL5_REQD+= ${_OPSYS_PERL_REQD} + +.if !defined(_PERL5_REQD) +_PERL5_REQD?= none +. for _version_ in ${PERL5_REQD} +. for _pkg_ in perl-${_version_} +. if !empty(_PERL5_REQD:Mnone) +_PERL5_PKG_SATISFIES_DEP= yes +. for _dep_ in ${PERL5_REQD:S/^/perl>=/} +. if !empty(_PERL5_PKG_SATISFIES_DEP:M[yY][eE][sS]) +_PERL5_PKG_SATISFIES_DEP!= \ + if ${PKG_ADMIN} pmatch ${_dep_:Q} ${_pkg_} 2>/dev/null; then \ + ${ECHO} yes; \ + else \ + ${ECHO} no; \ + fi +. endif +. endfor +. undef _vers_ +. if !empty(_PERL5_PKG_SATISFIES_DEP:M[yY][eE][sS]) +_PERL5_REQD= ${_version_} +. endif +. endif +. endfor +. undef _pkg_ +. endfor +. undef _version_ +.endif +PERL5_REQD:= ${_PERL5_REQD} +MAKEVARS+= _PERL5_REQD diff --git a/mk/bsd.pkg.use.mk b/mk/bsd.pkg.use.mk index 9680d388e67..70ee3a2bb76 100644 --- a/mk/bsd.pkg.use.mk +++ b/mk/bsd.pkg.use.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.use.mk,v 1.13 2005/05/18 14:41:50 tv Exp $ +# $NetBSD: bsd.pkg.use.mk,v 1.14 2005/05/18 22:42:07 jlam Exp $ # # Turn USE_* macros into proper depedency logic. Included near the top of # bsd.pkg.mk, after bsd.prefs.mk. @@ -107,42 +107,12 @@ USE_MAKEINFO?= no . include "../../mk/texinfo.mk" .endif -### USE_PERL5, PERL5_REQD - -# Distill the PERL5_REQD list into a single _PERL5_REQD value that is the -# highest version of Perl required. +.if empty(_USE_NEW_TOOLS:M[yY][eE][sS]) +### +### USE_PERL5 +### +.include "../../lang/perl5/version.mk" # -PERL5_REQD+= 5.0 -PERL5_REQD+= ${_OPSYS_PERL_REQD} - -_PERL5_STRICTEST_REQD?= none -.for _version_ in ${PERL5_REQD} -. for _pkg_ in perl-${_version_} -. if ${_PERL5_STRICTEST_REQD} == "none" -_PERL5_PKG_SATISFIES_DEP= YES -. for _vers_ in ${PERL5_REQD} -. if !empty(_PERL5_PKG_SATISFIES_DEP:M[yY][eE][sS]) -_PERL5_PKG_SATISFIES_DEP!= \ - if ${PKG_ADMIN} pmatch 'perl>=${_vers_}' ${_pkg_} 2>/dev/null; then \ - ${ECHO} "YES"; \ - else \ - ${ECHO} "NO"; \ - fi -. endif -. endfor -. if !empty(_PERL5_PKG_SATISFIES_DEP:M[yY][eE][sS]) -_PERL5_STRICTEST_REQD= ${_version_} -. endif -. endif -. endfor -.endfor -_PERL5_REQD= ${_PERL5_STRICTEST_REQD} - -.if defined(USE_PERL5) || !empty(USE_TOOLS:Mperl) -_PERL5_DEPENDS= {perl>=${_PERL5_REQD},perl-thread>=${_PERL5_REQD}} -PERL5_PKGSRCDIR?= ../../lang/perl58 -.endif - # Convert USE_PERL5 to be two-valued: either "build" or "run" to denote # whether we want a build-time or run-time dependency on perl. # @@ -153,23 +123,14 @@ _PERL5_DEPMETHOD= BUILD_DEPENDS USE_PERL5:= run _PERL5_DEPMETHOD= DEPENDS . endif -_PERL5_DEPENDS= {perl>=${_PERL5_REQD},perl-thread>=${_PERL5_REQD}} +_PERL5_DEPENDS= {perl>=${PERL5_REQD},perl-thread>=${PERL5_REQD}} +PERL5_PKGSRCDIR?= ../../lang/perl58 . if !defined(BUILDLINK_DEPENDS.perl) ${_PERL5_DEPMETHOD}+= ${_PERL5_DEPENDS}:${PERL5_PKGSRCDIR} . endif -.endif - -.if empty(_USE_NEW_TOOLS:M[yY][eE][sS]) -.if defined(USE_PERL5) && (${USE_PERL5} == "run") CONFIGURE_ENV+= PERL=${PERL5:Q} . include "../../lang/perl5/vars.mk" -.endif # USE_PERL5 == run .endif - -.if defined(USE_PERL5) -PLIST_SUBST+= PERL5_SITELIB=${PERL5_SUB_INSTALLSITELIB} -PLIST_SUBST+= PERL5_SITEARCH=${PERL5_SUB_INSTALLSITEARCH} -PLIST_SUBST+= PERL5_ARCHLIB=${PERL5_SUB_INSTALLARCHLIB} .endif ### USE_RMAN diff --git a/mk/tools/perl.mk b/mk/tools/perl.mk index 7f191665639..4bc955c98a5 100644 --- a/mk/tools/perl.mk +++ b/mk/tools/perl.mk @@ -1,11 +1,14 @@ -# $NetBSD: perl.mk,v 1.11 2005/05/18 03:14:01 jlam Exp $ +# $NetBSD: perl.mk,v 1.12 2005/05/18 22:42:07 jlam Exp $ # Create a symlink from ${TOOLS_DIR}/bin/perl to ${PERL5} when USE_PERL5 # is defined. This ensures that when "perl" is invoked, the pkgsrc perl # is executed on systems that also provide a perl binary. # .if defined(USE_PERL5) -USE_TOOLS+= perl +USE_TOOLS+= perl +. if empty(USE_PERL5:Mbuild) +TOOLS_DEPMETHOD.perl?= DEPENDS +. endif .endif # Skip the processing at the end of replace.mk. If we need to use @@ -17,14 +20,9 @@ _TOOLS_USE_PKGSRC.perl= yes . if !empty(PKGPATH:Mlang/perl58) MAKEFLAGS+= TOOLS_IGNORE.perl= . else -. include "../../lang/perl5/buildlink3.mk" +. include "../../lang/perl5/version.mk" TOOLS_DEPMETHOD.perl?= BUILD_DEPENDS -_TOOLS_DEPENDS.perl= # empty -. for _dep_ in ${BUILDLINK_DEPENDS.perl} -_TOOLS_DEPENDS.perl+= ${_dep_}:${BUILDLINK_PKGSRCDIR.perl} -. endfor -. undef _dep_ -TOOLS_DEPENDS.perl?= ${_TOOLS_DEPENDS.perl} +TOOLS_DEPENDS.perl?= {perl>=${PERL5_REQD},perl-thread>=${PERL5_REQD}}:../../lang/perl58 TOOLS_CREATE+= perl FIND_PREFIX:= TOOLS_PREFIX.perl=perl . include "../../mk/find-prefix.mk" |