pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Goal: Remove USE_PERL5 from pkgsrc.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ff4fd368106d
branches:  trunk
changeset: 494074:ff4fd368106d
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed May 18 22:42:07 2005 +0000

description:
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.

diffstat:

 lang/libperl/buildlink3.mk |   6 +---
 lang/perl5/buildlink3.mk   |  16 +++++++++----
 lang/perl5/module.mk       |   6 ++++-
 lang/perl5/version.mk      |  38 +++++++++++++++++++++++++++++++
 mk/bsd.pkg.use.mk          |  55 ++++++---------------------------------------
 mk/tools/perl.mk           |  16 +++++-------
 6 files changed, 71 insertions(+), 66 deletions(-)

diffs (243 lines):

diff -r c6a4a623841e -r ff4fd368106d lang/libperl/buildlink3.mk
--- a/lang/libperl/buildlink3.mk        Wed May 18 22:40:49 2005 +0000
+++ b/lang/libperl/buildlink3.mk        Wed May 18 22:42:07 2005 +0000
@@ -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+=   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 -r c6a4a623841e -r ff4fd368106d lang/perl5/buildlink3.mk
--- a/lang/perl5/buildlink3.mk  Wed May 18 22:40:49 2005 +0000
+++ b/lang/perl5/buildlink3.mk  Wed May 18 22:42:07 2005 +0000
@@ -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+=   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 -r c6a4a623841e -r ff4fd368106d lang/perl5/module.mk
--- a/lang/perl5/module.mk      Wed May 18 22:40:49 2005 +0000
+++ b/lang/perl5/module.mk      Wed May 18 22:42:07 2005 +0000
@@ -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}"
 .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 -r c6a4a623841e -r ff4fd368106d lang/perl5/version.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/perl5/version.mk     Wed May 18 22:42:07 2005 +0000
@@ -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 -r c6a4a623841e -r ff4fd368106d mk/bsd.pkg.use.mk
--- a/mk/bsd.pkg.use.mk Wed May 18 22:40:49 2005 +0000
+++ b/mk/bsd.pkg.use.mk Wed May 18 22:42:07 2005 +0000
@@ -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 @@
 .  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 @@
 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 -r c6a4a623841e -r ff4fd368106d mk/tools/perl.mk
--- a/mk/tools/perl.mk  Wed May 18 22:40:49 2005 +0000
+++ b/mk/tools/perl.mk  Wed May 18 22:42:07 2005 +0000
@@ -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 @@
 .  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"



Home | Main Index | Thread Index | Old Index