summaryrefslogtreecommitdiff
path: root/mk/configure/replace-localedir.mk
diff options
context:
space:
mode:
authorjlam <jlam>2006-07-05 06:09:15 +0000
committerjlam <jlam>2006-07-05 06:09:15 +0000
commitae760a5261f0d8bdd629f11fc996f388ef18d597 (patch)
tree5cda57cdca85b18146d681fc321900e0b05b7666 /mk/configure/replace-localedir.mk
parentff1abac1968d3a2126fff67c56d713586d517e87 (diff)
downloadpkgsrc-ae760a5261f0d8bdd629f11fc996f388ef18d597.tar.gz
Refactor configure, build, test and wrapper phases out of bsd.pkg.mk
and into their own directories. Also do some cleanups with build/_build and pkginstall -- we get rid of _build and simply run pkginstall as part of the "build" target. Introduce a new mechanism to handle varying directory depths under ${WRKSRC} in which we find files to override, e.g. configure, config.*, libtool, etc. OVERRIDE_DIRDEPTH is a package-settable variable that specifies how far under ${WRKSRC} the various targets should look, and it defaults to "2". We preserve the meaning of the various *_OVERRIDE variables, so if they are defined, then their values supersede the OVERRIDE_DIRDEPTH mechanism. devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
Diffstat (limited to 'mk/configure/replace-localedir.mk')
-rw-r--r--mk/configure/replace-localedir.mk45
1 files changed, 45 insertions, 0 deletions
diff --git a/mk/configure/replace-localedir.mk b/mk/configure/replace-localedir.mk
new file mode 100644
index 00000000000..e045025541a
--- /dev/null
+++ b/mk/configure/replace-localedir.mk
@@ -0,0 +1,45 @@
+# $NetBSD: replace-localedir.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $
+
+######################################################################
+### replace-localedir (PRIVATE)
+######################################################################
+### replace-localedir replaces the path to the locale directory in
+### various Makefiles with the one chosen by pkgsrc (PKGLOCALEDIR).
+###
+.PHONY: replace-localedir
+replace-localedir:
+ @${DO_NADA}
+
+replace-localedir: subst-pkglocaledir
+
+_PKGLOCALEDIR= ${PREFIX}/${PKGLOCALEDIR}/locale
+
+REPLACE_LOCALEDIR_PATTERNS?= # empty
+_REPLACE_LOCALEDIR_PATTERNS= ${REPLACE_LOCALEDIR_PATTERNS}
+.if defined(HAS_CONFIGURE)
+_REPLACE_LOCALEDIR_PATTERNS+= [Mm]akefile.in*
+.else
+_REPLACE_LOCALEDIR_PATTERNS+= [Mm]akefile*
+.endif
+_REPLACE_LOCALEDIR_PATTERNS_FIND_cmd= \
+ cd ${WRKSRC} && \
+ ${ECHO} "__dummy-entry__" && \
+ ${FIND} . \( ${_REPLACE_LOCALEDIR_PATTERNS:C/.*/-o -name "&"/g:S/-o//1} \) -print | \
+ ${SED} -e 's|^\./||' | \
+ ${SORT} -u
+
+REPLACE_LOCALEDIR?= # empty
+_REPLACE_LOCALEDIR= \
+ ${REPLACE_LOCALEDIR} \
+ ${_REPLACE_LOCALEDIR_PATTERNS_FIND_cmd:sh:N__dummy-entry__:N*.orig}
+
+.if empty(USE_PKGLOCALEDIR:M[nN][oO])
+SUBST_CLASSES+= pkglocaledir
+.endif
+SUBST_STAGE.pkglocaledir= do-configure-pre-hook
+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|'