aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2017-10-11 19:03:24 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2017-10-11 19:03:24 +0000
commitec229aec83d786e2a79f678b20dd346361b8a06a (patch)
tree0b4db4639f09e760dc626b3c4cba7e78bc84e43b
parent86a88c2df0a9f201c58f8528809d6dedeac3586f (diff)
downloadports-ec229aec83d786e2a79f678b20dd346361b8a06a.tar.gz
ports-ec229aec83d786e2a79f678b20dd346361b8a06a.zip
Introduce the new BINARY_ALIAS variable
When defined it will create symlinks of some given binaries in a directory which will be prepended to the PATH. The syntax is the following: BINARY_ALIAS= target1=source1 target2=source2 For example to have a "swig" binary in the path which will be pointing at swig3.0 and a "sed" pointing at GNU sed: gsed BINARY_ALIAS= swig=swig3.0 sed=gsed Reviewed by: swills, adamw, mat Approved by: swills (portmgr) Differential Revision: https://reviews.freebsd.org/D12603
Notes
Notes: svn path=/head/; revision=451772
-rw-r--r--CHANGES14
-rw-r--r--Mk/bsd.port.mk21
2 files changed, 33 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index adf9da53fc1d..bb75cb0e9fe9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,20 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
+20171011:
+AUTHOR: bapt@FreeBSD.org
+
+ New BINARY_ALIAS variable has been added, when defined it will create symlinks
+ of some given binaries in a directory which will be prepended to the PATH.
+
+ The syntax is the following:
+ BINARY_ALIAS= target1=source1 target2=source2
+
+ For example to have a "swig" binary in the path which will be pointing at
+ swig3.0 and a "sed" pointing at GNU sed: gsed
+
+ BINARY_ALIAS= swig=swig3.0 sed=gsed
+
20170625:
AUTHOR: kde@FreeBSD.org
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 20f195ceaf78..440b9eaec9ec 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1063,7 +1063,7 @@ FLAVOR?=
MINIMAL_PKG_VERSION= 1.6.0
_PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \
- ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg
+ ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR}
# Ensure .CURDIR contains an absolute path without a trailing slash. Failed
# builds can occur when PORTSDIR is a symbolic link, or with something like
@@ -1607,6 +1607,13 @@ _WRKDIR= work-${FLAVOR}
.endif
WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/${_WRKDIR}
+BINARY_LINKDIR= ${WRKDIR}/.bin
+PATH:= ${BINARY_LINKDIR}:${PATH}
+.if !${MAKE_ENV:MPATH=*} && !${CONFIGURE_ENV:MPATH=*}
+MAKE_ENV+= PATH=${PATH}
+CONFIGURE_ENV+= PATH=${PATH}
+.endif
+
.if !defined(IGNORE_MASTER_SITE_GITHUB) && defined(USE_GITHUB) && empty(USE_GITHUB:Mnodefault)
WRKSRC?= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME_EXTRACT}
.endif
@@ -5182,6 +5189,15 @@ install-desktop-entries:
.endif
.endif
+.if !empty(BINARY_ALIAS)
+.if !target(create-binary-alias)
+create-binary-alias: ${BINARY_LINKDIR}
+.for target src in ${BINARY_ALIAS:C/=/ /}
+ @${RLN} `which ${src}` ${BINARY_LINKDIR}/${target}
+.endfor
+.endif
+.endif
+
.if defined(WARNING)
WARNING_WAIT?= 10
show-warnings:
@@ -5269,7 +5285,8 @@ _PATCH_SEQ= 050:ask-license 100:patch-message 150:patch-depends \
700:post-patch 850:post-patch-script \
${_OPTIONS_patch} ${_USES_patch}
_CONFIGURE_DEP= patch
-_CONFIGURE_SEQ= 150:build-depends 151:lib-depends 200:configure-message \
+_CONFIGURE_SEQ= 150:build-depends 151:lib-depends 160:create-binary-alias \
+ 200:configure-message \
300:pre-configure 450:pre-configure-script \
490:run-autotools-fixup 500:do-configure 700:post-configure \
850:post-configure-script \