freebsd-ports/Mk/Uses/pathfix.mk
Tijl Coosemans fe837ee6c6 Change the way USES is handled:
- Loop over USES twice, once to define all *_ARGS variables and once to
  include Uses/*.mk.  This allows all Uses/*.mk to examine arguments given
  to other USES entries.
- Always define *_ARGS (possibly empty) and replace commas with spaces.

Similar for _USES_POST.

Adjust all Uses/*.mk:
- defined(u_ARGS) becomes !empty(u_ARGS)
- Eliminate helper variables like _*_ARGS=${*_ARGS:C/,/ /g}
- Some Uses/*.mk used ":" as argument separator instead of ",", but no port
  used this form
- Uses/cran.mk: remove unused variable VALID_ARGS and USES+=fortran which
  has no effect
- Uses/twisted.mk: simplify handling of the case where neither "build" nor
  "run" arguments have been specified

PR:		193931
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2014-09-28 16:36:31 +00:00

33 lines
1.1 KiB
Makefile

# $FreeBSD$
#
# Lookup common paths in Makefile.in, configure and similar files, and replace
# their values to respect FreeBSD hier(7) for file installation.
#
# Feature: pathfix
# Usage: USES=pathfix
# Valid ARGS: does not require args
#
# MAINTAINER: portmgr@FreeBSD.org
.if !defined(_INCLUDE_USES_PATHFIX_MK)
_INCLUDE_USES_PATHFIX_MK= yes
.if !empty(pathfix_ARGS)
IGNORE= USES=pathfix does not require args
.endif
PATHFIX_MAKEFILEIN?= Makefile.in
pathfix:
@${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|[(]LIBDIR[)]/pkgconfig|(PREFIX)/libdata/pkgconfig|g ; \
s|[{]libdir[}]/pkgconfig|(prefix)/libdata/pkgconfig|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'
.endif