Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jul 2011 00:07:32 -0500
From:      Mark Linimon <linimon@lonesome.com>
To:        perl@FreeBSD.org, skv@FreeBSD.org
Cc:        ports@FreeBSD.org
Subject:   RFC: change to bsd.perl.mk
Message-ID:  <20110716050732.GB25141@lonesome.com>

next in thread | raw e-mail | index | archive | help
Per Doug Barton's suggestion, I have reworked the long-standing patch
to bsd.perl.mk to be an exact copy of the logic in bsd.port.mk, and
done an -exp run.  Does anyone have any objection if I commit this
patch?

Notes:

 - some code in bsd.perl.mk, which had been intended as part of gabor's
   SoC rework but has never been tested, is reverted to the exact code
   currently in bsd.port.mk as part of this commit.

 - the code in bsd.port.mk that made the inclusion of bsd.perl.mk
   conditional has been removed.  (In my repeated tests, it simply
   made the INDEX build too fragile.)

I will not be offended if anyone wants to take on either of those two
tasks moving forward.  I've neglected them far too long.

fwiw, the results of the -exp run are at:

  http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-8-exp-perl-latest

AFAIK there are no regressions resulting from this patch.

mcl

Index: bsd.perl.mk
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/Mk/bsd.perl.mk,v
retrieving revision 1.20
diff -u -r1.20 bsd.perl.mk
--- bsd.perl.mk	3 Jul 2011 15:51:18 -0000	1.20
+++ bsd.perl.mk	4 Jul 2011 22:19:26 -0000
@@ -29,72 +29,37 @@
 #				  (value: perl5.8)
 # SITE_PERL		- Directory name where site specific perl packages go.
 #				  This value is added to PLIST_SUB.
-# USE_PERL5		- If your port needs a specific version of Perl, you
-#				  can easily specify that with this knob.  If
-#				  you need a certain minimal version, but don't
-#				  care if about the upperversion, just put the
-#				  + sign behind the version.  If you want to
-#				  specify a latest version your port can be used
-#				  with, suffix the version number with a - sign.
-#				  Exact version can also be specified if you just
-#				  set USE_PERL5 to the desired version.  If you
-#				  just set USE_PERL5 to "yes", Perl will be
-#				  pulled in as a dependency but no version check
-#				  is done.
-# USE_PERL5_REASON
-#				- Along with USE_PERL5, you can set a specific reason,
-#				  why a given version is required.
-#
-# Examples:
-# 	USE_PERL5=	yes	# port requires any version of Perl5 to build.
-# 	USE_PERL5=	5.8.0+	# port requires at least Perl 5.8.0 to build.
-#	USE_PERL5=	5.8.2	# port is only usable with Perl 5.8.2.
-#	USE_PERL5=	5.8.6-	# port is only usable with Perl 5.8.6 or prior.
-#
-# This line along with a properly set USE_PERL5 will give the user a reason,
-# why the specific ports cannot be installed into the given environment.
-#
-#	USE_PERL5_REASON=	this module is already part of your Perl version
-#
+# USE_PERL5		- If set, this port uses perl5 in one or more of the extract,
+#				  patch, build, install or run phases.
 # PERL_CONFIGURE
 #				- Configure using Perl's MakeMaker.  Implies USE_PERL5.
-#				  The version requirement can be specified here,
-#				  as well.
 # USE_PERL5_BUILD
 #				- If set, this port uses perl5 in one or more of the
 #				  extract, patch, build or install phases.
-#				  The version requirement can be specified here,
-#				  as well.
-# USE_PERL5_RUN	- If set, this port uses perl5 for running.  The
-#			 	  version requirement can be specified here,
-#				  as well.
-# PERL_MODBUILD	- Use Module::Build to configure, build and install
-#				  port.  The version requirement can be specified
-#				  here, as well.
-#
-# WANT_PERL		- Set this if your port conditionally depends on Perl.
-#				  This MUST appear before the inclusion of bsd.port.pre.mk.
+# USE_PERL5_RUN	- If set, this port uses perl5 for running.
+# PERL_MODBUILD	- Use Module::Build to configure, build and install port.
 
 .if !defined(_POSTMKINCLUDED) && !defined(Perl_Pre_Include)
 
 Perl_Pre_Include=			bsd.perl.mk
 PERL_Include_MAINTAINER=	perl@FreeBSD.org
 
-# XXX to remain undefined until all ports that require Perl are fixed
-# to set one of the conditionals that force the inclusion of bsd.perl.mk
-.if defined(_PERL_REFACTORING_COMPLETE)
-
 PERL_VERSION?=	5.12.4
 
 .if !defined(PERL_LEVEL) && defined(PERL_VERSION)
-perl_major=		${PERL_VERSION:C|\..*||}
-_perl_minor=	${PERL_VERSION:S|^${perl_major}||:S|^.||:C|\..*||}
-_perl_patch=	${PERL_VERSION:S|^${perl_major}||:S|^.${_perl_minor}||:S|^.||:C|\..*||}
-perl_minor=		${_perl_minor:S|^|000|:C|.*(...)|\1|}
-perl_patch=		${_perl_patch:S|^|00|:C|.*(..)|\1|}
-PERL_LEVEL=		${perl_major}${perl_minor}${perl_patch}
+perl_major=		${PERL_VERSION:C|^([1-9]+).*|\1|}
+_perl_minor=	00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|}
+perl_minor=		${_perl_minor:C|^.*(...)|\1|}
+.if ${perl_minor} >= 100
+perl_minor=		${PERL_VERSION:C|^([1-9]+)\.([0-9][0-9][0-9]).*|\2|}
+perl_patch=		${PERL_VERSION:C|^.*(..)|\1|}
+.else # ${perl_minor} < 100
+_perl_patch=	0${PERL_VERSION:C|^([1-9]+)\.([0-9]+)\.*|0|}
+perl_patch=		${_perl_patch:C|^.*(..)|\1|}
+.endif # ${perl_minor} < 100
+PERL_LEVEL=	${perl_major}${perl_minor}${perl_patch}
 .else
-PERL_LEVEL=		0
+PERL_LEVEL=0
 .endif # !defined(PERL_LEVEL) && defined(PERL_VERSION)
 
 PERL_ARCH?=		mach
@@ -115,8 +80,6 @@
 PERL5=		${LOCALBASE}/bin/perl${PERL_VERSION}
 PERL=		${LOCALBASE}/bin/perl
 
-.endif  # defined(_PERL_REFACTORING_COMPLETE)
-
 # Decide where to look for the version string
 .ifdef USE_PERL5
 USE_PERL5_STRING=	${USE_PERL5}
@@ -177,19 +140,11 @@
 
 Perl_Post_Include=		bsd.perl.mk
 
-.if defined(_PERL_REFACTORING_COMPLETE)
-
 PLIST_SUB+=	PERL_VERSION=${PERL_VERSION} \
 			PERL_VER=${PERL_VERSION} \
 			PERL_ARCH=${PERL_ARCH} \
 			SITE_PERL=${SITE_PERL_REL}
 
-.endif  # defined(_PERL_REFACTORING_COMPLETE)
-
-.if !defined(PERL) || !defined(PERL5) || !defined(PERL_PORT) || !defined(SITE_PERL)
-IGNORE=		missing define for WANT_PERL, USE_PERL5, or similar before bsd.port.pre.mk inclusion
-.endif
-
 .if defined(PERL_MODBUILD)
 PERL_CONFIGURE=		yes
 CONFIGURE_SCRIPT?=	Build.PL
Index: bsd.port.mk
===================================================================
RCS file: /home/FreeBSD/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.687
diff -u -r1.687 bsd.port.mk
--- bsd.port.mk	3 Jul 2011 15:51:18 -0000	1.687
+++ bsd.port.mk	4 Jul 2011 22:19:09 -0000
@@ -323,32 +323,6 @@
 #					'yes'		as a library dependency
 #					'run'		as a run-time dependency
 ##
-# USE_PERL5		- If set, this port uses perl5 in one or more of the extract,
-#				  patch, build, install or run phases.
-# USE_PERL5_BUILD
-#				- If set, this port uses perl5 in one or more of the extract,
-#				  patch, build or install phases.
-# USE_PERL5_RUN	- If set, this port uses perl5 for running.
-# PERL5			- Set to full path of perl5, either in the system or
-#				  installed from a port.
-# PERL			- Set to full path of perl5, either in the system or
-#				  installed from a port, but without the version number.
-#				  Use this if you need to replace "#!" lines in scripts.
-# PERL_VERSION	- Full version of perl5 (see below for current value).
-# PERL_LEVEL	- Perl version as an integer of the form MNNNPP, where
-#				  M is major version, N is minor version, and P is
-#				  the patch level. E.g., PERL_VERSION=5.8.1 would give
-#				  a PERL_LEVEL of 500801. This can be used in comparisons
-#				  to determine if the version of perl is high enough,
-#				  whether a particular dependency is needed, etc.
-# PERL_ARCH		- Directory name of architecture dependent libraries
-#				  (value: ${ARCH}-freebsd).
-# PERL_PORT		- Name of the perl port that is installed
-#				  (value: perl5)
-# SITE_PERL		- Directory name where site specific perl packages go.
-#				  This value is added to PLIST_SUB.
-# PERL_MODBUILD	- Use Module::Build to configure, build and install port.
-##
 # USE_GHOSTSCRIPT
 #				- If set, this port needs ghostscript to both
 #				  build and run.  If a number is specified,
@@ -893,8 +867,6 @@
 #				  configure stage will not do anything if this is not set.
 # GNU_CONFIGURE	- If set, you are using GNU configure (optional).  Implies
 #				  HAS_CONFIGURE.
-# PERL_CONFIGURE
-#				- Configure using Perl's MakeMaker.  Implies USE_PERL5.
 # CONFIGURE_WRKSRC
 #				- Directory to run configure in.
 #				  Default: ${WRKSRC}
@@ -914,7 +886,7 @@
 #				- Pass these args to configure if ${HAS_CONFIGURE} is set.
 #				  Default: "--prefix=${GNU_CONFIGURE_PREFIX} --infodir=${PREFIX}/${INFO_PATH}
 #				  --mandir=${MANPREFIX}/man --build=${CONFIGURE_TARGET}" if
-#				  GNU_CONFIGURE is set, "CC=${CC} CCFLAGS=${CFLAGS}
+#				  GNU_CONFIGURE is set, "CC=${CC} CFLAGS=${CFLAGS}
 #				  PREFIX=${PREFIX} INSTALLPRIVLIB=${PREFIX}/lib
 #				  INSTALLARCHLIB=${PREFIX}/lib" if PERL_CONFIGURE is set,
 #				  empty otherwise.
@@ -1439,48 +1411,6 @@
 
 PKGCOMPATDIR?=		${LOCALBASE}/lib/compat/pkg
 
-# XXX to remain undefined until all ports that require Perl are fixed
-# to set one of the conditionals that force the inclusion of bsd.perl.mk
-.if !defined(_PERL_REFACTORING_COMPLETE)
-
-PERL_VERSION?=	5.12.4
-
-.if !defined(PERL_LEVEL) && defined(PERL_VERSION)
-perl_major=		${PERL_VERSION:C|^([1-9]+).*|\1|}
-_perl_minor=	00${PERL_VERSION:C|^([1-9]+)\.([0-9]+).*|\2|}
-perl_minor=		${_perl_minor:C|^.*(...)|\1|}
-.if ${perl_minor} >= 100
-perl_minor=		${PERL_VERSION:C|^([1-9]+)\.([0-9][0-9][0-9]).*|\2|}
-perl_patch=		${PERL_VERSION:C|^.*(..)|\1|}
-.else # ${perl_minor} < 100
-_perl_patch=	0${PERL_VERSION:C|^([1-9]+)\.([0-9]+)\.*|0|}
-perl_patch=		${_perl_patch:C|^.*(..)|\1|}
-.endif # ${perl_minor} < 100
-PERL_LEVEL=	${perl_major}${perl_minor}${perl_patch}
-.else
-PERL_LEVEL=0
-.endif # !defined(PERL_LEVEL) && defined(PERL_VERSION)
-
-PERL_ARCH?=		mach
-
-.if    ${PERL_LEVEL} >= 501400
-PERL_PORT?=	perl5.14
-.elif  ${PERL_LEVEL} >= 501200
-PERL_PORT?=	perl5.12
-.elif  ${PERL_LEVEL} >= 501000
-PERL_PORT?=	perl5.10
-.else
-PERL_PORT?=	perl5.8
-.endif
-
-SITE_PERL_REL?=	lib/perl5/site_perl/${PERL_VERSION}
-SITE_PERL?=	${LOCALBASE}/${SITE_PERL_REL}
-
-PERL5=		${LOCALBASE}/bin/perl${PERL_VERSION}
-PERL=		${LOCALBASE}/bin/perl
-
-.endif  # !defined(_PERL_REFACTORING_COMPLETE)
-
 .if defined(USE_LOCAL_MK)
 .include "${PORTSDIR}/Mk/bsd.local.mk"
 .endif
@@ -1497,9 +1427,7 @@
 .include "${PORTSDIR}/Mk/bsd.gnustep.mk"
 .endif
 
-#.if defined(USE_PERL5) || defined(USE_PERL5_BUILD) || defined(USE_PERL5_RUN) || defined(PERL_CONFIGURE) || defined(PERL_MODBUILD)
 .include "${PORTSDIR}/Mk/bsd.perl.mk"
-#.endif
 
 .if defined(USE_PHP)
 .include "${PORTSDIR}/Mk/bsd.php.mk"
@@ -2059,13 +1987,6 @@
 
 .endif
 
-.if !defined(_PERL_REFACTORING_COMPLETE)
-PLIST_SUB+=		PERL_VERSION=${PERL_VERSION} \
-				PERL_VER=${PERL_VERSION} \
-				PERL_ARCH=${PERL_ARCH} \
-				SITE_PERL=${SITE_PERL_REL}
-.endif  # !defined(_PERL_REFACTORING_COMPLETE)
-
 .if defined(USE_LOCAL_MK)
 .include "${PORTSDIR}/Mk/bsd.local.mk"
 .endif
@@ -2112,9 +2033,7 @@
 .include "${PORTSDIR}/Mk/bsd.sdl.mk"
 .endif
 
-#.if defined(USE_PERL5) || defined(USE_PERL5_BUILD) || defined(USE_PERL5_RUN) || defined(PERL_CONFIGURE) || defined(PERL_MODBUILD)
 .include "${PORTSDIR}/Mk/bsd.perl.mk"
-#.endif
 
 .if defined(USE_PHP)
 .include "${PORTSDIR}/Mk/bsd.php.mk"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110716050732.GB25141>