aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2015-10-15 22:24:43 +0800
committermat <mat@FreeBSD.org>2015-10-15 22:24:43 +0800
commit961833bf7aaad347477fbf0d30f80b670dae0e7c (patch)
tree7526de09c3d74ec718e3dad1be5433d23132db82 /lang
parent06736708d42cb7a33667891e5c9281d97de0c172 (diff)
downloadfreebsd-ports-gnome-961833bf7aaad347477fbf0d30f80b670dae0e7c.tar.gz
freebsd-ports-gnome-961833bf7aaad347477fbf0d30f80b670dae0e7c.tar.zst
freebsd-ports-gnome-961833bf7aaad347477fbf0d30f80b670dae0e7c.zip
Try to fix upgrading a non default Perl version that is supposed to be
the default one. Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D3704
Diffstat (limited to 'lang')
-rw-r--r--lang/perl5-devel/Makefile15
-rw-r--r--lang/perl5.16/Makefile15
-rw-r--r--lang/perl5.18/Makefile15
-rw-r--r--lang/perl5.20/Makefile15
-rw-r--r--lang/perl5.22/Makefile15
5 files changed, 75 insertions, 0 deletions
diff --git a/lang/perl5-devel/Makefile b/lang/perl5-devel/Makefile
index 44b48fc68a16..5b2ed524f99e 100644
--- a/lang/perl5-devel/Makefile
+++ b/lang/perl5-devel/Makefile
@@ -165,9 +165,12 @@ PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
ARCH_LIB=${_ARCH_LIB}
PLIST_SUB+= PORTVERSION=${PORTVERSION} # XXX Remove
+_PERL5_DEFAULT_FILE= /tmp/PERL5_DEFAULT
+
# bsd.default-versions.mk needs to know LOCALBASE for Perl, so
# bsd.port.options.mk is needed before including it.
.include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
.include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
# if this port is default due PERL5_DEFAULT
@@ -238,9 +241,21 @@ pre-everything::
.endif
# Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah. While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
post-extract:
${LN} -s libperl.so.${PORTVERSION} ${WRKSRC}/libperl.so
${LN} -s libperl.so.${PORTVERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+ @${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+ @${RM} ${_PERL5_DEFAULT_FILE}
+.endif
.if !defined(MAKING_PATCHES)
# make clean patch makepatch MAKING_PATCHES=
diff --git a/lang/perl5.16/Makefile b/lang/perl5.16/Makefile
index 65e1e823c504..a33234896fa8 100644
--- a/lang/perl5.16/Makefile
+++ b/lang/perl5.16/Makefile
@@ -98,7 +98,10 @@ PKGINSTALL= ${WRKDIR}/use.perl
PKGDEINSTALL= ${WRKDIR}/use.perl
INSTALL_TARGET= install-strip
+_PERL5_DEFAULT_FILE= /tmp/PERL5_DEFAULT
+
.include <bsd.port.pre.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
.include "${PORTSDIR}/Mk/bsd.default-versions.mk"
# if this port is default due PERL5_DEFAULT
@@ -233,9 +236,21 @@ LINK_USRBIN= no
SUB_LIST+= LINK_USRBIN=${LINK_USRBIN}
# Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah. While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
post-extract:
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+ @${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+ @${RM} ${_PERL5_DEFAULT_FILE}
+.endif
post-patch:
${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
diff --git a/lang/perl5.18/Makefile b/lang/perl5.18/Makefile
index 2133d6009a9a..dca2bf3ef115 100644
--- a/lang/perl5.18/Makefile
+++ b/lang/perl5.18/Makefile
@@ -120,9 +120,12 @@ PKGINSTALL= ${WRKDIR}/use.perl
PKGDEINSTALL= ${WRKDIR}/use.perl
INSTALL_TARGET= install-strip
+_PERL5_DEFAULT_FILE= /tmp/PERL5_DEFAULT
+
# bsd.default-versions.mk needs to know LOCALBASE for Perl, so
# bsd.port.options.mk is needed before including it.
.include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
.include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
# if this port is default due PERL5_DEFAULT
@@ -202,9 +205,21 @@ PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
ARCH_LIB=${_ARCH_LIB}
# Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah. While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
post-extract:
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+ @${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+ @${RM} ${_PERL5_DEFAULT_FILE}
+.endif
.if !defined(MAKING_PATCHES)
# make clean patch makepatch MAKING_PATCHES=
diff --git a/lang/perl5.20/Makefile b/lang/perl5.20/Makefile
index 7be103376529..89c80c07509b 100644
--- a/lang/perl5.20/Makefile
+++ b/lang/perl5.20/Makefile
@@ -148,9 +148,12 @@ PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
PRIV_LIB=${_PRIV_LIB} \
ARCH_LIB=${_ARCH_LIB}
+_PERL5_DEFAULT_FILE= /tmp/PERL5_DEFAULT
+
# bsd.default-versions.mk needs to know LOCALBASE for Perl, so
# bsd.port.options.mk is needed before including it.
.include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
.include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
# if this port is default due PERL5_DEFAULT
@@ -197,9 +200,21 @@ pre-everything::
.endif
# Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah. While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
post-extract:
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+ @${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+ @${RM} ${_PERL5_DEFAULT_FILE}
+.endif
.if !defined(MAKING_PATCHES)
# make clean patch makepatch MAKING_PATCHES=
diff --git a/lang/perl5.22/Makefile b/lang/perl5.22/Makefile
index d29232445545..3f90776eaf27 100644
--- a/lang/perl5.22/Makefile
+++ b/lang/perl5.22/Makefile
@@ -146,9 +146,12 @@ PLIST_SUB+= PERL_VERSION=${PERL_VERSION} \
PRIV_LIB=${_PRIV_LIB} \
ARCH_LIB=${_ARCH_LIB}
+_PERL5_DEFAULT_FILE= /tmp/PERL5_DEFAULT
+
# bsd.default-versions.mk needs to know LOCALBASE for Perl, so
# bsd.port.options.mk is needed before including it.
.include <bsd.port.options.mk>
+.sinclude "${_PERL5_DEFAULT_FILE}"
.include "${.CURDIR}/../../Mk/bsd.default-versions.mk"
# if this port is default due PERL5_DEFAULT
@@ -195,9 +198,21 @@ pre-everything::
.endif
# Put a symlink to the future libperl.so.x.yy so that -lperl works.
+# Also, save PERL5_DEFAULT in case someone is not using the default Perl
+# version whilst not having set DEFAULT_VERSIONS=perl5=blah. While upgrading,
+# portmaster/portupgrade will remove the installed Perl version, and it will
+# remove any way to guess what the default Perl version is needed.
post-extract:
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so
${LN} -s libperl.so.${PERL_VERSION} ${WRKSRC}/libperl.so.${PERL_VER}
+.if !defined(PACKAGE_BUILDING)
+ @${ECHO_CMD} "PERL5_DEFAULT=${PERL5_DEFAULT}" > ${_PERL5_DEFAULT_FILE}
+.endif
+
+.if !defined(PACKAGE_BUILDING)
+post-clean:
+ @${RM} ${_PERL5_DEFAULT_FILE}
+.endif
.if !defined(MAKING_PATCHES)
# make clean patch makepatch MAKING_PATCHES=