Index: Mk/Uses/emacs.mk =================================================================== --- Mk/Uses/emacs.mk +++ Mk/Uses/emacs.mk @@ -5,10 +5,11 @@ # # 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. +# noflavors Prevents flavors. # # 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 @@ -24,7 +25,8 @@ # # 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 +# If EMACS_FLAVORS_EXCLUDE is not defined and 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. @@ -50,15 +52,20 @@ # 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,7 +75,7 @@ _EMACS_RUN_DEP= yes .endif -.if defined(_EMACS_RUN_DEP) +.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}} @@ -77,14 +84,16 @@ FLAVORS= full .endif +.if !defined(_EMACS_NOFLAVORS) .if empty(FLAVOR) .if defined(EMACS_DEFAULT) FLAVOR= ${EMACS_DEFAULT} .else FLAVOR= ${FLAVORS:[1]} -.endif -.endif -EMACS_FLAVOR= ${FLAVOR} +.endif # defined(EMACS_DEFAULT) +.endif # empty(FLAVOR) +.endif # !defined(_EMACS_NOFLAVORS) +EMACS_FLAVOR= ${FLAVOR:U${FLAVORS:[1]}} .if ${FLAVOR:Mdevel*} EMACS_VER= 27.0.50