aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorJoseph Mingrone <jrm@FreeBSD.org>2026-06-23 19:53:03 +0000
committerJoseph Mingrone <jrm@FreeBSD.org>2026-06-24 18:46:32 +0000
commitaa46aa4ddc210ce43ec07e0ccdfe2539d49433e8 (patch)
tree22b10940f475c3c6a2d3204962eeaf4b9754a6a2 /Mk
parent3adb1ad6f5daadcf97bddb39bda738dd39051b5e (diff)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/emacs.mk43
1 files changed, 28 insertions, 15 deletions
diff --git a/Mk/Uses/emacs.mk b/Mk/Uses/emacs.mk
index 4d4a1349cb94..2b395a2ba83b 100644
--- a/Mk/Uses/emacs.mk
+++ b/Mk/Uses/emacs.mk
@@ -2,16 +2,19 @@
#
# Feature: emacs
# Usage: USES=emacs or USES=emacs:args
-# Valid ARGS: build
+# Valid ARGS: build test
#
# build Indicates that Emacs is required at build time.
+# test Indicates that Emacs is required at test time.
#
# If build is omitted from the argument list, Emacs will not be added to
# BUILD_DEPENDS.
+# If test is omitted from the argument list, Emacs will not be added to
+# TEST_DEPENDS.
#
# Variables, which can be set in make.conf:
# DEFAULT_VERSIONS+=emacs= Select the Emacs port and flavor used for
-# USES=emacs:build.
+# USES=emacs:build and USES=emacs:test.
# Valid values: full canna nox wayland
# devel_full devel_nox
# Defaults to nox when not specified.
@@ -25,8 +28,8 @@
# EMACS_LIBDIR: Emacs Library directory without ${PREFIX} (e.g. share/emacs)
# EMACS_SITE_LISPDIR: Emacs site-lisp directory without ${PREFIX} (e.g. share/emacs/site-lisp)
#
-# Note: EMACS_CMD and EMACS_MAJOR_VER are only set if the build argument is
-# supplied.
+# Note: EMACS_CMD and EMACS_MAJOR_VER are only set if one or both of the build
+# or test argument are supplied.
#
# Note: No Emacs runtime dependency is declared here. USES=emacs ports now
# install only .el source files, avoiding the combinatorial explosion of
@@ -41,30 +44,40 @@ _INCLUDE_USES_EMACS_MK= yes
# Make sure that no dependency or some other environment variable
# pollutes the build/run dependency detection
-.undef _EMACS_BUILD_DEP
+.undef _EMACS_BUILD_DEP _EMACS_TEST_DEP
_EMACS_ARGS= ${emacs_ARGS:S/,/ /g}
. if ${_EMACS_ARGS:Mbuild}
_EMACS_BUILD_DEP= yes
_EMACS_ARGS:= ${_EMACS_ARGS:Nbuild}
. endif
+. if ${_EMACS_ARGS:Mtest}
+_EMACS_TEST_DEP= yes
+_EMACS_ARGS:= ${_EMACS_ARGS:Ntest}
+. endif
EMACS_LIBDIR= share/emacs
EMACS_SITE_LISPDIR= ${EMACS_LIBDIR}/site-lisp
-. if defined(_EMACS_BUILD_DEP)
+. if defined(_EMACS_BUILD_DEP) || defined(_EMACS_TEST_DEP)
. if defined(EMACS_DEFAULT) && ${EMACS_DEFAULT:Mdevel*}
-EMACS_VER= 32.0.50
-EMACS_PORTDIR= editors/emacs-devel
-EMACS_BUILD_FLAVOR= ${EMACS_DEFAULT:C/devel_//}
+_EMACS_VER= 32.0.50
+_EMACS_PORTDIR= editors/emacs-devel
+_EMACS_FLAVOR= ${EMACS_DEFAULT:C/devel_//}
. else
-EMACS_VER= 30.2
-EMACS_PORTDIR= editors/emacs
-EMACS_BUILD_FLAVOR= ${EMACS_DEFAULT:Unox}
+_EMACS_VER= 30.2
+_EMACS_PORTDIR= editors/emacs
+_EMACS_FLAVOR= ${EMACS_DEFAULT:Unox}
. endif
-EMACS_CMD= ${PREFIX}/bin/emacs-${EMACS_VER}
-EMACS_MAJOR_VER= ${EMACS_VER:C/\..*//}
+EMACS_CMD= ${PREFIX}/bin/emacs-${_EMACS_VER}
+EMACS_MAJOR_VER= ${_EMACS_VER:C/\..*//}
+. endif
+
+. if defined(_EMACS_BUILD_DEP)
MAKE_ARGS+= EMACS=${EMACS_CMD}
-BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_BUILD_FLAVOR}
+BUILD_DEPENDS+= ${EMACS_CMD}:${_EMACS_PORTDIR}@${_EMACS_FLAVOR}
+. endif
+. if defined(_EMACS_TEST_DEP)
+TEST_DEPENDS+= ${EMACS_CMD}:${_EMACS_PORTDIR}@${_EMACS_FLAVOR}
. endif
SCRIPTS_ENV+= EMACS_LIBDIR=${EMACS_LIBDIR} \