summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2013-03-06 14:28:57 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2013-03-06 14:28:57 +0000
commit05b55e937fdc3ca77b410575aa4e8f79baea86e4 (patch)
treeff1c99fff77ba1d8a0c6327b2caa4d142ff34781
parentUpdate to 1.2.5 (diff)
New USES macros that loads "features" on demand.
First feature implemented: pathfix which will lookup in WRKSRC for Makefile.in and configure and fix common path that doesn't fit with FreeBSD hier(7) This is an extract of bsd.gnome.mk's gnomehack to avoid porters to have to load the full bsd.gnome.mk just for this feature More features to come...
Notes
Notes: svn path=/head/; revision=313517
-rw-r--r--Mk/Uses/pathfix.mk26
-rw-r--r--Mk/bsd.port.mk10
2 files changed, 36 insertions, 0 deletions
diff --git a/Mk/Uses/pathfix.mk b/Mk/Uses/pathfix.mk
new file mode 100644
index 000000000000..37df6cfa9ae4
--- /dev/null
+++ b/Mk/Uses/pathfix.mk
@@ -0,0 +1,26 @@
+# $FreeBSD$
+# Lookup in Makefile.in and configure for common incorrect paths and set them
+# to respect FreeBSD hier
+#
+# MAINTAINER: portmgr@FreeBSD.org
+#
+.if !defined(_INCLUDE_PATHFIX_MK)
+_INCLUDE_PATHFIX_MK= yes
+
+PATHFIX_MAKEFILEIN?= Makefile.in
+
+pre-patch: pathfix-pre-patch
+
+pathfix-pre-patch:
+ @${FIND} ${WRKSRC} -name "${PATHFIX_MAKEFILEIN}" -type f | ${XARGS} ${REINPLACE_CMD} -e \
+ 's|[(]libdir[)]/locale|(prefix)/share/locale|g ; \
+ s|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
+ s|[(]datadir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
+ s|[(]prefix[)]/lib/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
+ s|[$$][(]localstatedir[)]/scrollkeeper|${SCROLLKEEPER_DIR}|g ; \
+ s|[(]libdir[)]/bonobo/servers|(prefix)/libdata/bonobo/servers|g' ; \
+ ${FIND} ${WRKSRC} -name "configure" -type f | ${XARGS} ${REINPLACE_CMD} -e \
+ 's|DATADIRNAME=lib|DATADIRNAME=share|g ; \
+ s|{libdir}/locale|{prefix}/share/locale|g'
+
+.endif
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 5d71ce564e79..7d8b8919fec7 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1153,6 +1153,7 @@ DISTDIR?= ${PORTSDIR}/distfiles
_DISTDIR?= ${DISTDIR}/${DIST_SUBDIR}
INDEXDIR?= ${PORTSDIR}
SRC_BASE?= /usr/src
+USESDIR?= ${PORTSDIR}/Mk/Uses
.include "${PORTSDIR}/Mk/bsd.commands.mk"
@@ -1544,6 +1545,15 @@ check-makefile::
_POSTMKINCLUDED= yes
+# Loading features
+.for f in ${USES}
+_f=${f:C/\:.*//g}
+.if ${_f} != ${f}
+${_f}_ARGS:= ${f:C/^[^\:]*\://g}
+.endif
+.include "${USESDIR}/${_f}.mk"
+.endfor
+
WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work
.if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB)
WRKSRC?= ${WRKDIR}/${GH_ACCOUNT}-${GH_PROJECT}-${GH_COMMIT}