summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-08-27 11:29:56 +0000
committerjlam <jlam@pkgsrc.org>2003-08-27 11:29:56 +0000
commite5462ca7308976aae7ff1232d7799c57d882cc26 (patch)
treeb27904a27f1a3c2d035f1484bf240a843ec6c802 /mk/bsd.pkg.mk
parentb81c512e4febfed6ab263973ebf7917e9785956f (diff)
downloadpkgsrc-e5462ca7308976aae7ff1232d7799c57d882cc26.tar.gz
(*) Nuke the _BUILDLINK_SUBST_USE target now that subst.mk does the same
thing. (*) Move the code to adjust Makefiles to refer to the correct PKGLOCALEDIR into bsd.pkg.mk and reimplement it using subst.mk so that it's non-USE_BUILDLINK2 packages can use it, too. (*) Reimplement the PKGCONFIG_OVERRIDE code in bsd.pkg.mk using subst.mk. (*) Reimplement the unbuildlink code in bsd.buildlink2.mk using subst.mk.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r--mk/bsd.pkg.mk56
1 files changed, 40 insertions, 16 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 086a865459a..aa75ba7eb5f 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1247 2003/08/27 01:01:25 jlam Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1248 2003/08/27 11:29:56 jlam Exp $
#
# This file is in the public domain.
#
@@ -620,9 +620,6 @@ MESSAGE_SUBST+= PKGNAME=${PKGNAME} \
MESSAGE_SUBST_SED= ${MESSAGE_SUBST:S/=/}!/:S/$/!g/:S/^/ -e s!\\\${/}
.endif
-PKGCONFIG_OVERRIDE_SED= \
- '-e s|^\(Libs:.*[ ]\)-L\([ ]*[^ ]*\)\(.*\)$$|\1-Wl,${RPATH_FLAG}\2 -L\2\3|'
-
# Latest version of digest(1) required for pkgsrc
DIGEST_REQD= 20010302
@@ -2078,6 +2075,34 @@ do-patch: uptodate-digest
# post-configure. These targets typically edit the files generated by
# the do-configure target that are used during the build phase.
+.if defined(USE_PKGLOCALEDIR)
+_PKGLOCALEDIR= ${PREFIX}/${PKGLOCALEDIR}/locale
+REPLACE_LOCALEDIR_PATTERNS?= # empty
+_REPLACE_LOCALEDIR_PATTERNS= ${REPLACE_LOCALEDIR_PATTERNS}
+. if defined(HAS_CONFIGURE) || defined(GNU_CONFIGURE)
+_REPLACE_LOCALEDIR_PATTERNS+= Makefile.in*
+. else
+_REPLACE_LOCALEDIR_PATTERNS+= Makefile*
+. endif
+_REPLACE_LOCALEDIR_PATTERNS_FIND= \
+ \( ${_REPLACE_LOCALEDIR_PATTERNS:S/$/!/:S/^/-o -name !/:S/!/"/g:S/-o//1} \)
+REPLACE_LOCALEDIR?= # empty
+_REPLACE_LOCALEDIR= \
+ ${REPLACE_LOCALEDIR} \
+ `${FIND} . ${_REPLACE_LOCALEDIR_PATTERNS_FIND} -print | ${SED} -e 's|^\./||' | ${GREP} -v '\.orig' | ${SORT} -u`
+
+_CONFIGURE_PREREQ+= subst-pkglocaledir
+. if empty(USE_PKGLOCALEDIR:M[nN][oO])
+SUBST_CLASSES+= pkglocaledir
+. endif
+SUBST_MESSAGE.pkglocaledir= "Fixing locale directory references."
+SUBST_FILES.pkglocaledir= ${_REPLACE_LOCALEDIR}
+SUBST_SED.pkglocaledir= \
+ -e 's|^\(localedir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \
+ -e 's|^\(gnulocaledir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \
+ -e 's|\(-DLOCALEDIR[ ]*=\)[^ ]*\(.*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|'
+.endif
+
.if defined(REPLACE_PERL)
REPLACE_INTERPRETER+= perl
_REPLACE.perl.old= .*/bin/perl
@@ -2144,18 +2169,15 @@ do-config-star-override:
. endif
.endif
-.if defined(PKGCONFIG_OVERRIDE)
-_CONFIGURE_PREREQ+= do-pkgconfig-override
-.PHONY: do-pkgconfig-override
-do-pkgconfig-override:
-. for pkgconfig in ${PKGCONFIG_OVERRIDE}
- ${_PKG_SILENT}${_PKG_DEBUG} \
- if [ -f ${pkgconfig} ]; then \
- ${MV} ${pkgconfig} ${pkgconfig}.norpath ; \
- ${SED} ${PKGCONFIG_OVERRIDE_SED} \
- < ${pkgconfig}.norpath > ${pkgconfig} ; \
- fi
-. endfor
+PKGCONFIG_OVERRIDE_SED= \
+ -e 's|^\(Libs:.*[ ]\)-L\([ ]*[^ ]*\)\(.*\)$$|\1${_COMPILER_LD_FLAG}${RPATH_FLAG}\2 -L\2\3|'
+
+.if defined(PKGCONFIG_OVERRIDE) && !empty(PKGCONFIG_OVERRIDE)
+_CONFIGURE_PREREQ+= subst-pkgconfig
+SUBST_CLASSES+= pkgconfig
+SUBST_MESSAGE.pkgconfig= "Adding rpaths to pkgconfig files."
+SUBST_FILES.pkgconfig= ${PKGCONFIG_OVERRIDE:S/^${WRKSRC}\///}
+SUBST_SED.pkgconfig= ${PKGCONFIG_OVERRIDE_SED}
.endif
# By adding this target, it makes sure the the above PREREQ's work.
@@ -4588,6 +4610,8 @@ ${DESCR}: ${DESCR_SRC}
${ECHO} '${HOMEPAGE}' >>${DESCR}
.endif
+.include "../../mk/subst.mk"
+
#
# For bulk build targets (bulk-install, bulk-package), the
# BATCH variable must be set in /etc/mk.conf: