summaryrefslogtreecommitdiff
path: root/lang/perl5
diff options
context:
space:
mode:
authorjlam <jlam>2004-12-19 00:01:43 +0000
committerjlam <jlam>2004-12-19 00:01:43 +0000
commitafc89fb3624007bc83413b58599cfcdcfe183281 (patch)
treed0b5209076372e315276b0112cf736365b03246d /lang/perl5
parent7c9557c9a56f16229c9fad72b3071bf547225f81 (diff)
downloadpkgsrc-afc89fb3624007bc83413b58599cfcdcfe183281.tar.gz
Create a modifier PERL5_OPTIONS that specifies properties of the perl
installation needed when including perl5/buildlink3.mk. The only option currently supported is "threads", which implies that a perl that supports threads is required. The requirement is checked at pre-install time using an INSTALL script template by both the package build and the binary package. Add PERL5_OPTIONS+=threads to both devel/p5-SDL and graphics/p5-GD since those modules require a perl that supports threads.
Diffstat (limited to 'lang/perl5')
-rw-r--r--lang/perl5/buildlink3.mk8
-rw-r--r--lang/perl5/files/install.tmpl26
2 files changed, 33 insertions, 1 deletions
diff --git a/lang/perl5/buildlink3.mk b/lang/perl5/buildlink3.mk
index 925b043f279..1a158caf030 100644
--- a/lang/perl5/buildlink3.mk
+++ b/lang/perl5/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.14 2004/04/26 04:46:00 jlam Exp $
+# $NetBSD: buildlink3.mk,v 1.15 2004/12/19 00:01:43 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
PERL5_BUILDLINK3_MK:= ${PERL5_BUILDLINK3_MK}+
@@ -36,6 +36,12 @@ _PERL5_SITEVAR.INSTALLSITEMAN3DIR= installsiteman3dir
_PERL5_SITEVAR.SITELIBEXP= sitelibexp
_PERL5_SITEVAR.SITEARCHEXP= sitearchexp
+PERL5_OPTIONS?= # empty
+.if !empty(PERL5_OPTIONS:Mthreads)
+USE_PKGINSTALL= yes
+INSTALL_EXTRA_TMPL+= ${.CURDIR}/../../lang/perl5/files/install.tmpl
+.endif
+
.if exists(${PERL5})
. if !defined(_PERL5_SITEPREFIX)
_PERL5_PREFIX!= \
diff --git a/lang/perl5/files/install.tmpl b/lang/perl5/files/install.tmpl
new file mode 100644
index 00000000000..e520da7ac14
--- /dev/null
+++ b/lang/perl5/files/install.tmpl
@@ -0,0 +1,26 @@
+# $NetBSD: install.tmpl,v 1.1 2004/12/19 00:01:43 jlam Exp $
+#
+# Require the presence of a pkgsrc Perl installation that supports threads
+# during the PRE-INSTALL stage, otherwise we bail out.
+
+PERL5="@PERL5@"
+
+case ${STAGE} in
+PRE-INSTALL)
+ if [ ! -x "${PERL5}" ]; then
+ ${ECHO} "==> ${PERL5} does not exist." 1>&2
+ exit 1
+ fi
+ eval `${PERL5} -V:usethreads`
+ case $usethreads in
+ define*|true|[yY]*) # possible "yes" values in Perl Config.pm
+ # We found what we were looking for (a threaded perl) so
+ # do nothing.
+ ;;
+ *)
+ ${ECHO} "==> ${PKGNAME} requires a Perl that supports threads." 1>&2
+ exit 1
+ ;;
+ esac
+ ;;
+esac