1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-05 06:27:37 +00:00

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...
This commit is contained in:
Baptiste Daroussin 2013-03-06 14:28:57 +00:00
parent c702d76e92
commit 05b55e937f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=313517
2 changed files with 36 additions and 0 deletions

26
Mk/Uses/pathfix.mk Normal file
View File

@ -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

View File

@ -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}