aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/Uses
diff options
context:
space:
mode:
authorjrm <jrm@FreeBSD.org>2018-05-15 02:28:35 +0800
committerjrm <jrm@FreeBSD.org>2018-05-15 02:28:35 +0800
commit18e561250c469394be33524f991d32f1d73f9630 (patch)
tree81d3d9b4a0755baedd6336f542507e715ee1deed /Mk/Uses
parentd51c802a7bc2d29d441b6315862c4ae9828aaf03 (diff)
downloadfreebsd-ports-gnome-18e561250c469394be33524f991d32f1d73f9630.tar.gz
freebsd-ports-gnome-18e561250c469394be33524f991d32f1d73f9630.tar.zst
freebsd-ports-gnome-18e561250c469394be33524f991d32f1d73f9630.zip
Mk/Uses/Emacs: Add noflavors argument to USES=emacs
Reported by: des Reviewed by: des Approved by: ashish Differential Revision: https://reviews.freebsd.org/D15265
Diffstat (limited to 'Mk/Uses')
-rw-r--r--Mk/Uses/emacs.mk44
1 files changed, 30 insertions, 14 deletions
diff --git a/Mk/Uses/emacs.mk b/Mk/Uses/emacs.mk
index 0d9b99e2cca1..6b05823c67bc 100644
--- a/Mk/Uses/emacs.mk
+++ b/Mk/Uses/emacs.mk
@@ -5,14 +5,16 @@
#
# Feature: emacs
# Usage: USES=emacs or USES=emacs:args
-# Valid ARGS: build, run
+# Valid ARGS: build, run, noflavors
#
-# build Indicates that Emacs is needed at build time.
-# run Indicates that Emacs is needed at run time.
+# build Indicates that Emacs is required at build time.
+# run Indicates that Emacs is required at run time.
+# noflavors Prevents flavors. This is implied when there is no run
+# dependency on Emacs.
#
# If build and run are omitted from the argument list, Emacs will be added to
# BUILD_DEPENDS and RUN_DEPENDS. EMACS_NO_DEPENDS can be set to prevent both
-# Emacs dependencies.
+# dependencies.
#
# Variables, which can be set in make.conf:
# DEFAULT_VERSIONS+= The default flavor for Emacs ports (ports with
@@ -20,14 +22,18 @@
# can be added to DEFAULT_VERSIONS. For example,
# DEFAULT_VERSIONS+= emacs=nox
# Valid flavors: full canna nox devel_full devel_nox
-# Flavors specified on the command line take precedence.
+# Flavors specified on the command line take
+# precedence.
#
# Variables, which can be set by ports:
# EMACS_FLAVORS_EXCLUDE: Do NOT build these Emacs flavors.
-# If EMACS_FLAVORS_EXCLUDE is not define then all
-# valid Emacs flavors are assumed.
+# If EMACS_FLAVORS_EXCLUDE is not defined and
+# - there is a run dependency on Emacs
+# - the noflavors argument is not specified
+# then all valid Emacs flavors are assumed.
#
# EMACS_NO_DEPENDS: Do NOT add build or run dependencies on Emacs.
+# This will prevent flavors.
#
# Variables, which can be read by ports:
# EMACS_CMD: Emacs command with full path (e.g. /usr/local/bin/emacs-25.3)
@@ -50,15 +56,20 @@ _INCLUDE_USES_EMACS_MK= yes
# pollutes the build/run dependency detection
.undef _EMACS_BUILD_DEP
.undef _EMACS_RUN_DEP
+.undef _EMACS_NOFLAVORS
_EMACS_ARGS= ${emacs_ARGS:S/,/ /g}
.if ${_EMACS_ARGS:Mbuild}
_EMACS_BUILD_DEP= yes
_EMACS_ARGS:= ${_EMACS_ARGS:Nbuild}
.endif
.if ${_EMACS_ARGS:Mrun}
-_EMACS_RUN_DEP= yes
+_EMACS_RUN_DEP= yes
_EMACS_ARGS:= ${_EMACS_ARGS:Nrun}
.endif
+.if ${_EMACS_ARGS:Mnoflavors}
+_EMACS_NOFLAVORS= yes
+_EMACS_ARGS:= ${_EMACS_ARGS:Nnoflavors}
+.endif
# If the port does not specify a build or run dependency, and does not define
# EMACS_NO_DEPENDS, assume both dependencies are required.
@@ -68,23 +79,28 @@ _EMACS_BUILD_DEP= yes
_EMACS_RUN_DEP= yes
.endif
-.if defined(_EMACS_RUN_DEP)
+# Only set FLAVORS when...
+.if defined(_EMACS_RUN_DEP) && !defined(_EMACS_NOFLAVORS)
FLAVORS= full canna nox devel_full devel_nox
.for flavor in ${EMACS_FLAVORS_EXCLUDE}
FLAVORS:= ${FLAVORS:N${flavor}}
.endfor
-.elif !defined(EMACS_NO_DEPENDS)
-FLAVORS= full
.endif
-.if empty(FLAVOR)
+# Only set FLAVOR when...
+.if defined(_EMACS_RUN_DEP) && !defined(_EMACS_NOFLAVORS) && empty(FLAVOR)
.if defined(EMACS_DEFAULT)
FLAVOR= ${EMACS_DEFAULT}
.else
FLAVOR= ${FLAVORS:[1]}
-.endif
-.endif
+.endif # defined(EMACS_DEFAULT)
+.endif # !defined(_EMACS_NOFLAVORS) && defined(_EMACS_RUN_DEP) && empty(FLAVOR)
+
+.if !empty(FLAVOR)
EMACS_FLAVOR= ${FLAVOR}
+.else
+EMACS_FLAVOR= full
+.endif
.if ${FLAVOR:Mdevel*}
EMACS_VER= 27.0.50