2013-03-06 14:28:57 +00:00
|
|
|
# $FreeBSD$
|
2013-03-06 15:12:29 +00:00
|
|
|
#
|
2014-04-09 12:45:54 +00:00
|
|
|
# Lookup common paths in Makefile.in, configure and similar files, and replace
|
|
|
|
# their values to respect FreeBSD hier(7) for file installation.
|
2013-03-06 14:28:57 +00:00
|
|
|
#
|
2013-03-08 15:04:18 +00:00
|
|
|
# Feature: pathfix
|
|
|
|
# Usage: USES=pathfix
|
2013-03-11 06:43:13 +00:00
|
|
|
# Valid ARGS: does not require args
|
2013-03-08 15:04:18 +00:00
|
|
|
#
|
2014-03-15 10:31:54 +00:00
|
|
|
# MAINTAINER: portmgr@FreeBSD.org
|
|
|
|
|
2013-03-11 06:43:13 +00:00
|
|
|
.if !defined(_INCLUDE_USES_PATHFIX_MK)
|
|
|
|
_INCLUDE_USES_PATHFIX_MK= yes
|
2013-03-06 14:28:57 +00:00
|
|
|
|
2014-09-28 16:36:31 +00:00
|
|
|
.if !empty(pathfix_ARGS)
|
2013-03-08 15:04:18 +00:00
|
|
|
IGNORE= USES=pathfix does not require args
|
|
|
|
.endif
|
|
|
|
|
2016-01-07 14:54:03 +00:00
|
|
|
PATHFIX_CMAKELISTSTXT?= CMakeLists.txt
|
2016-10-21 15:19:54 +00:00
|
|
|
.if ${USES:Mautoreconf*}
|
2016-10-21 15:19:57 +00:00
|
|
|
PATHFIX_MAKEFILEIN?= Makefile.am Makefile.in
|
2016-10-21 15:19:54 +00:00
|
|
|
.else
|
2013-03-06 14:28:57 +00:00
|
|
|
PATHFIX_MAKEFILEIN?= Makefile.in
|
2016-10-21 15:19:54 +00:00
|
|
|
.endif
|
Change the meaning of NO_WRKSUBDIR to force a WRKDIR != WRKSRC.
Right now, NO_WRKSUBDIR means that the extraction does not produce a
subdirectory, and that everything goes straight into WRKDIR. It is
problematic, because during the build of a port, quite a few files are
created in there, and then, a stage directory, where everything is
installed, and then a pkg directory where the package is created, and
those often conflict, or get in the way, of the building process.
With this, NO_WRKSUBDIR will extract the distfiles directly into WRKSRC
instead of WRKDIR. In this case, WRKSRC is artificial and is based on
PKGNAME and not DISTNAME, mitigate conflicts with rc files.
PR: 204056
Submitted by: mat
Reviewed by: bapt
Exp-run: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D2735
2015-11-05 12:35:26 +00:00
|
|
|
PATHFIX_WRKSRC?= ${WRKSRC}
|
2013-03-06 14:28:57 +00:00
|
|
|
|
Rewrite the target ordering code.
The targets now have priority assigned to them, and, when the dependency
ordering magic is done at the end of bsd.port.mk, they are sorted
according to their priority.
This allows USES to add targets easily and have them run whenever they
want without touching bsd.port.mk.
To add a target that runs just before post-configure run, do:
_USES_configure+= 695:my-post-configure
my-post-configure:
do something
To fine tune when the target is ran, look at the values in the *_SEQ
variables at the end of bsd.port.mk, and the other USES.
Allow ports Makefiles to override the priority of targets with the
TARGET_ORDER_OVERRIDE variable. For example, to get post-install
running earlier, (its default is 700) do:
TARGET_ORDER_OVERRIDE= 650:post-install
While there, add options target helpers for the do-* targets when they
exist.
Reviewed by: antoine, bapt
Exp-run by: antoine
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D3099
2015-08-17 13:31:25 +00:00
|
|
|
_USES_patch+= 190:pathfix
|
2014-05-22 06:42:20 +00:00
|
|
|
pathfix:
|
2016-01-07 14:54:03 +00:00
|
|
|
.if ${USES:Mcmake*}
|
2016-10-21 15:19:57 +00:00
|
|
|
.for file in ${PATHFIX_CMAKELISTSTXT}
|
|
|
|
@${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${REINPLACE_CMD} -e \
|
2016-01-07 14:54:03 +00:00
|
|
|
's|[{]CMAKE_INSTALL_LIBDIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
|
|
|
s|[{]INSTALL_LIB_DIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
|
|
|
s|[{]INSTALL_LIBDIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
2016-10-04 06:18:32 +00:00
|
|
|
s|[{]LIB_DESTINATION[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
2016-01-07 14:54:03 +00:00
|
|
|
s|[{]LIB_DIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
|
|
|
s|[{]LIB_INSTALL_DIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
2016-09-30 17:45:19 +00:00
|
|
|
s|[{]KDE_INSTALL_LIBDIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
2016-01-07 14:54:03 +00:00
|
|
|
s|[{]LIBRARY_INSTALL_DIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
|
|
|
s|[{]libdir[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \
|
|
|
|
s|lib/pkgconfig|libdata/pkgconfig|g'
|
2016-10-21 15:19:57 +00:00
|
|
|
.endfor
|
2016-01-07 14:54:03 +00:00
|
|
|
.else
|
2016-10-21 15:19:57 +00:00
|
|
|
.for file in ${PATHFIX_MAKEFILEIN}
|
|
|
|
@${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${REINPLACE_CMD} -e \
|
2013-03-06 14:28:57 +00:00
|
|
|
's|[(]libdir[)]/locale|(prefix)/share/locale|g ; \
|
|
|
|
s|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
|
2014-04-09 12:45:54 +00:00
|
|
|
s|[(]LIBDIR[)]/pkgconfig|(PREFIX)/libdata/pkgconfig|g ; \
|
2016-10-21 15:19:50 +00:00
|
|
|
s|@libdir@/locale|@prefix@/share/locale|g ; \
|
|
|
|
s|@libdir@/pkgconfig|@prefix@/libdata/pkgconfig|g ; \
|
2013-04-16 15:45:03 +00:00
|
|
|
s|[{]libdir[}]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
|
2014-04-09 12:45:54 +00:00
|
|
|
s|[{]LIBDIR[}]/pkgconfig|(PREFIX)/libdata/pkgconfig|g ; \
|
2013-03-06 14:28:57 +00:00
|
|
|
s|[(]datadir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
|
2016-10-21 15:19:50 +00:00
|
|
|
s|[{]datadir[}]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
|
2013-03-06 14:28:57 +00:00
|
|
|
s|[(]prefix[)]/lib/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
|
2016-10-21 15:19:50 +00:00
|
|
|
s|[[:<:]]lib/pkgconfig|libdata/pkgconfig|g; \
|
2013-03-06 14:28:57 +00:00
|
|
|
s|[$$][(]localstatedir[)]/scrollkeeper|${SCROLLKEEPER_DIR}|g ; \
|
2014-09-25 15:18:27 +00:00
|
|
|
s|[(]libdir[)]/bonobo/servers|(prefix)/libdata/bonobo/servers|g'
|
2016-10-21 15:19:57 +00:00
|
|
|
.endfor
|
2016-01-07 14:54:03 +00:00
|
|
|
.endif
|
2013-03-06 14:28:57 +00:00
|
|
|
|
|
|
|
.endif
|