summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2014-04-28 13:15:29 +0000
committerobache <obache@pkgsrc.org>2014-04-28 13:15:29 +0000
commitedd3f7863da51369b5ca40abe47f45267bdd45f4 (patch)
tree2d522a9a1c1e088dd82bd290b8fbc2d4e049945d /mk
parent14bbd97bbb36354af48fe856b7a97ba1613dba57 (diff)
downloadpkgsrc-edd3f7863da51369b5ca40abe47f45267bdd45f4.tar.gz
Check builtin perl usability
* if p5-* in {,BUILD_,TOOL_}DEPENDS, use perl5 from pkgsrc. * check whether builtin perl satisfies PERL5_REQD, or use perl5 from pkgsrc. * if buitin perl satisfies all {perl>=n.m,p5-foo>=x.y} style dependencies, get rid of such dependencies and use builtin perl.
Diffstat (limited to 'mk')
-rw-r--r--mk/tools/replace.mk47
1 files changed, 46 insertions, 1 deletions
diff --git a/mk/tools/replace.mk b/mk/tools/replace.mk
index 3fa665d85cd..b7feb776ba4 100644
--- a/mk/tools/replace.mk
+++ b/mk/tools/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.269 2014/03/13 17:06:43 taca Exp $
+# $NetBSD: replace.mk,v 1.270 2014/04/28 13:15:29 obache Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -940,6 +940,51 @@ TOOLS_PATH.${_t_}= ${TOOLS_PREFIX.${_t_}}/bin/${_t_}
# These tools are all supplied by the lang/perl5 package if there is
# no native tool available.
#
+.if !empty(_TOOLS_USE_PKGSRC.perl:U:M[Nn][Oo]) && \
+ !defined(TOOLS_IGNORE.perl) && !empty(_USE_TOOLS:Mperl)
+. if !empty(DEPENDS:Mp5-*) || !empty(BUILD_DEPENDS:Mp5-*) || !empty(TOOL_DEPENDS:Mp5-*)
+_TOOLS_USE_PKGSRC.perl= yes
+. endif
+. include "../../lang/perl5/version.mk"
+_TOOLS_VERSION.perl!= \
+ eval $$(${TOOLS_PLATFORM.perl} -V:version) && echo $$version
+_TOOLS_PKG.perl= perl-${_TOOLS_VERSION.perl}
+. if !empty(_TOOLS_USE_PKGSRC.perl:M[nN][oO])
+. for _dep_ in perl>=${PERL5_REQD}
+. if !empty(_TOOLS_USE_PKGSRC.perl:M[nN][oO])
+_TOOLS_USE_PKGSRC.perl!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${_TOOLS_PKG.perl:Q}; then \
+ ${ECHO} no; \
+ else \
+ ${ECHO} yes; \
+ fi
+. endif
+. endfor
+. endif
+. if !empty(_TOOLS_USE_PKGSRC.perl:M[nN][oO])
+. for _dep_ in ${DEPENDS:M{perl[><=-]*,*}\:*} \
+ ${DEPENDS:M{*,perl[><=-]*}\:*} \
+ ${BUILD_DEPENDS:M{perl[><=-]*,*}\:*} \
+ ${BUILD_DEPENDS:M{*,perl[><=-]*}\:*} \
+ ${TOOL_DEPENDS:M{perl[><=-]*,*}\:*} \
+ ${TOOL_DEPENDS:M{*,perl[><=-]*}\:*}
+. if !empty(_TOOLS_USE_PKGSRC.perl:M[nN][oO])
+_TOOLS_USE_PKGSRC.perl!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:S/:/ /g:[1]:Q} ${_TOOLS_PKG.perl:Q}; then \
+ ${ECHO} no; \
+ else \
+ ${ECHO} yes; \
+ fi
+. endif
+. endfor
+. if !empty(_TOOLS_USE_PKGSRC.perl:M[nN][oO])
+DEPENDS:= ${DEPENDS:N{perl[><=-]*,*}\:*:N{*,perl[><=-]*}\:*}
+BUILD_DEPENDS:= ${BUILD_DEPENDS:N{perl[><=-]*,*}\:*:N{*,perl[><=-]*}\:*}
+TOOL_DEPENDS:= ${TOOL_DEPENDS:N{perl[><=-]*,*}\:*:N{*,perl[><=-]*}\:*}
+. endif
+. endif
+.endif
+
_TOOLS.perl= perl perldoc pod2html pod2man pod2text
.for _t_ in ${_TOOLS.perl}