freebsd-ports/Mk/Uses/charsetfix.mk
Mathieu Arnold e8796ef612 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

27 lines
739 B
Makefile

# $FreeBSD$
#
# Lookup in Makefile.in to prevent a package from installing/modifying charset.alias
#
# Feature: charsetfix
# Usage: USES=charsetfix
# Valid ARGS: does not require args
#
# MAINTAINER: portmgr@FreeBSD.org
.if !defined(_INCLUDE_USES_CHARSETFIX_MK)
_INCLUDE_USES_CHARSETFIX_MK= yes
.if !empty(charsetfix_ARGS)
IGNORE= USES=charsetfix does not require args
.endif
CHARSETFIX_MAKEFILEIN?= Makefile.in
_USES_patch+= 600:charsetfix-post-patch
charsetfix-post-patch:
@${FIND} ${WRKSRC} -name "${CHARSETFIX_MAKEFILEIN}" -type f | ${XARGS} ${REINPLACE_CMD} \
-e 's|need_charset_alias=true|need_charset_alias=false|g ; \
s|test -f $$(charset_alias)|false|g ;\
s|test -f $$(DESTDIR)$$(libdir)/charset.alias|false|g'
.endif