BINARY_WRAPPERS allow to push in front of the PATH wrappers for binaries.

This is useful when 2 tools do provide the same feature, but the configure
scripts do test for some variables which are not in one of the tool.

For example m4 in base is mostly compatible with GNU m4 when called with the -g
arguement. This wrapper allows to use it with build systems that do check for it
calling --version and expecting GNU in the arguments.

Reviewed by:	mat (final discussions on irc)
Differential Revision:	https://reviews.freebsd.org/D21835
This commit is contained in:
Baptiste Daroussin 2019-10-01 14:33:24 +00:00
parent 37203c22d9
commit f6fd84cfb5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=513486
3 changed files with 26 additions and 0 deletions

View File

@ -10,6 +10,13 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
20191001:
AUTHOR: bapt@FreeBSD.org
BINARY_WRAPPERS allow to push in front of the PATH wrappers for binaries.
This is useful when 2 tools do provide the same feature, but the configure
scripts do test for some variables which are not in one of the tool.
20190919:
AUTHOR: madpilot@FreeBSD.org

8
Mk/Wrappers/gm4 Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
#
# $FreeBSD$
case " $@ " in
*" --version "*) echo "m4 (GNU M4) 1.4.18" ;;
*) exec m4 -g $@ ;;
esac

View File

@ -1334,6 +1334,7 @@ INDEXFILE?= INDEX-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/}
PACKAGES?= ${PORTSDIR}/packages
TEMPLATES?= ${PORTSDIR}/Templates
KEYWORDS?= ${PORTSDIR}/Keywords
WRAPPERSDIR?= ${PORTSDIR}/Mk/Wrappers/
PATCHDIR?= ${MASTERDIR}/files
FILESDIR?= ${MASTERDIR}/files
@ -5101,6 +5102,15 @@ create-binary-alias: ${BINARY_LINKDIR}
.endif
.endif
.if !empty(BINARY_WRAPPERS)
.if !target(create-binary-wrappers)
create-binary-wrappers: ${BINARY_LINKDIR}
.for bin in ${BINARY_WRAPPERS}
@${INSTALL_SCRIPT} ${WRAPPERSDIR}/${bin} ${BINARY_LINKDIR}
.endfor
.endif
.endif
.if defined(WARNING)
WARNING_WAIT?= 10
show-warnings:
@ -5201,6 +5211,7 @@ _PATCH_SEQ= 050:ask-license 100:patch-message 150:patch-depends \
${_OPTIONS_patch} ${_USES_patch}
_CONFIGURE_DEP= patch
_CONFIGURE_SEQ= 150:build-depends 151:lib-depends 160:create-binary-alias \
161:create-binary-wrappers \
200:configure-message \
300:pre-configure 450:pre-configure-script \
490:run-autotools-fixup 500:do-configure 700:post-configure \