Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2019 14:33:24 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r513486 - in head: . Mk Mk/Wrappers
Message-ID:  <201910011433.x91EXOJZ028238@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Tue Oct  1 14:33:24 2019
New Revision: 513486
URL: https://svnweb.freebsd.org/changeset/ports/513486

Log:
  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

Added:
  head/Mk/Wrappers/
  head/Mk/Wrappers/gm4   (contents, props changed)
Modified:
  head/CHANGES
  head/Mk/bsd.port.mk

Modified: head/CHANGES
==============================================================================
--- head/CHANGES	Tue Oct  1 14:26:03 2019	(r513485)
+++ head/CHANGES	Tue Oct  1 14:33:24 2019	(r513486)
@@ -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
 

Added: head/Mk/Wrappers/gm4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/Mk/Wrappers/gm4	Tue Oct  1 14:33:24 2019	(r513486)
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+case " $@ " in
+*" --version "*) echo "m4 (GNU M4) 1.4.18" ;;
+*) exec m4 -g $@ ;;
+esac

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Tue Oct  1 14:26:03 2019	(r513485)
+++ head/Mk/bsd.port.mk	Tue Oct  1 14:33:24 2019	(r513486)
@@ -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:pat
 				${_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 \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910011433.x91EXOJZ028238>