Changeset View
Changeset View
Standalone View
Standalone View
Mk/bsd.emacs.mk
#-*- tab-width: 4; -*- | |||||
# ex:ts=4 | |||||
# | # | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
# | |||||
# bsd.emacs.mk - 19990829 Shigeyuki Fukushima. | # bsd.emacs.mk - 19990829 Shigeyuki Fukushima. | ||||
# | # | ||||
Emacs_Include= bsd.emacs.mk | Emacs_Include= bsd.emacs.mk | ||||
Emacs_Include_MAINTAINER= ashish@FreeBSD.org | Emacs_Include_MAINTAINER= ashish@FreeBSD.org | ||||
EMACS_PORT_NAME?= emacs25 | |||||
# | |||||
# This file for ports which depend on emacs family. | |||||
# Define EMACS_PORT_NAME variable before bsd.port.[pre.]mk | |||||
# and it will automatically include this file. | |||||
# | |||||
# This file exports the following common variables: | # This file exports the following common variables: | ||||
mat: I ponder upon the `default` here. It might be a nicer to have a more descriptive name.
Also… | |||||
Done Inline Actions
jrm: - `full` and `x11` are two alternative flavor names that come to mind instead of `default`. | |||||
Done Inline ActionsI like full. mat: I like `full`. | |||||
# | # | ||||
# EMACS_NAME: | # EMACS_NAME: | ||||
# emacsen's command-line basename. | # emacsen's command-line basename. | ||||
# ex.) "emacs" when emacsen is a emacs-20.6. | # ex.) "emacs" when emacsen is a emacs-20.6. | ||||
# | # | ||||
# EMACS_VER: | # EMACS_VER: | ||||
# emacsen's version. | # emacsen's version. | ||||
# ex.) "20.6" when emacsen is a emacs-20.6. | # ex.) "20.6" when emacsen is a emacs-20.6. | ||||
Show All 9 Lines | |||||
# EMACS_LIBDIR_WITH_VER: | # EMACS_LIBDIR_WITH_VER: | ||||
# emacsen's version specific library directory name | # emacsen's version specific library directory name | ||||
# without ${PREFIX}. | # without ${PREFIX}. | ||||
# ex.) "share/emacs/20.6" when emacsen is a emacs-20.6. | # ex.) "share/emacs/20.6" when emacsen is a emacs-20.6. | ||||
# | # | ||||
# EMACS_CMD: | # EMACS_CMD: | ||||
# emacsen's command-line filename. (full path) | # emacsen's command-line filename. (full path) | ||||
# ex.) "/usr/local/bin/emacs-20.6" when emacsen is a | # ex.) "/usr/local/bin/emacs-20.6" when emacsen is a | ||||
# emacs-20.6 and ${PREFIX} is "/usr/local". | # emacs-20.6 and ${PREFIX} is "/usr/local". | ||||
# | # | ||||
# EMACS_SITE_LISPDIR: | # EMACS_SITE_LISPDIR: | ||||
# emacsen's site-lisp directory name without ${PREFIX}. | # emacsen's site-lisp directory name without ${PREFIX}. | ||||
# ex.) "share/emacs/site-lisp" when emacsen is a emacs-20.6. | # ex.) "share/emacs/site-lisp" when emacsen is a emacs-20.6. | ||||
# | # | ||||
# EMACS_VERSION_SITE_LISPDIR: | # EMACS_VERSION_SITE_LISPDIR: | ||||
# emacsen's version specific site-lisp directory name | # emacsen's version specific site-lisp directory name | ||||
# without ${PREFIX}. | # without ${PREFIX}. | ||||
# ex.) "share/emacs/20.6/site-lisp" when emacsen is a | # ex.) "share/emacs/20.6/site-lisp" when emacsen is a | ||||
# emacs-20.6. | # emacs-20.6. | ||||
# | # | ||||
# EMACS_NO_BUILD_DEPENDS: | # EMACS_NO_BUILD_DEPENDS: | ||||
# If set "YES" to this variable, port does not | # If set "YES" to this variable, port does not | ||||
# build-depend on EMACS_PORT_NAME's emacsen. | # build-depend on EMACS_PORT_NAME's emacsen. | ||||
# | # | ||||
# EMACS_NO_RUN_DEPENDS: | # EMACS_NO_RUN_DEPENDS: | ||||
# If set "YES" to this variable, port does not | # If set "YES" to this variable, port does not | ||||
# run-depend on EMACS_PORT_NAME's emacsen. | # run-depend on EMACS_PORT_NAME's emacsen. | ||||
# | |||||
EMACS_MASTERDIR_PKGFILES?= NO | .if defined(EMACS_NO_FLAVORS) | ||||
FLAVORS= full | |||||
.else | |||||
FLAVORS= full canna lite devel_full devel_lite | |||||
.for flavor in ${EMACS_EXCLUDE_FLAVORS} | |||||
FLAVORS:= ${FLAVORS:N${flavor}} | |||||
.endfor | |||||
.endif | |||||
# Emacs-25.x | EMACS_FLAVOR= ${FLAVOR} | ||||
.if (${EMACS_PORT_NAME} == "emacs25") | |||||
EMACS_NAME= emacs | .if ${FLAVOR:Mdevel*} | ||||
EMACS_VER= 27.0.50 | |||||
EMACS_PORTDIR= editors/emacs-devel | |||||
.else | |||||
EMACS_VER= 25.3 | EMACS_VER= 25.3 | ||||
EMACS_MAJOR_VER= 25 | |||||
EMACS_LIBDIR?= share/${EMACS_NAME} | |||||
EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER} | |||||
EMACS_PORTDIR= editors/emacs | EMACS_PORTDIR= editors/emacs | ||||
EMACS_COMMON_PORT= NO | |||||
EMACS_HAS_MULE= YES | |||||
EMACS_NO_SUBDIRSEL= NO | |||||
.if (${EMACS_MASTERDIR_PKGFILES} == "YES") | |||||
COMMENTFILE?= ${PKGDIR}/pkg-comment.${EMACS_PORT_NAME} | |||||
DESCR?= ${PKGDIR}/pkg-descr.${EMACS_PORT_NAME} | |||||
PLIST?= ${PKGDIR}/pkg-plist.${EMACS_PORT_NAME} | |||||
.endif | .endif | ||||
# Emacs-26.x (development version) | EMACS_MAJOR_VER= ${EMACS_VER:C/\..*//} | ||||
.elif (${EMACS_PORT_NAME} == "emacs-devel") | |||||
EMACS_NAME= emacs | EMACS_NAME= emacs | ||||
EMACS_VER= 27.0.50 | |||||
EMACS_MAJOR_VER= 27 | |||||
EMACS_LIBDIR?= share/${EMACS_NAME} | EMACS_LIBDIR?= share/${EMACS_NAME} | ||||
EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER} | EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER} | ||||
EMACS_PORTDIR= editors/emacs-devel | |||||
EMACS_COMMON_PORT= NO | |||||
EMACS_HAS_MULE= YES | EMACS_HAS_MULE= YES | ||||
EMACS_NO_SUBDIRSEL= NO | EMACS_NO_SUBDIRSEL= NO | ||||
.if (${EMACS_MASTERDIR_PKGFILES} == "YES") | EMACS_PORT_NAME= emacs${EMACS_MAJOR_VER} | ||||
.if defined(EMACS_MASTERDIR_PKGFILES) | |||||
COMMENTFILE?= ${PKGDIR}/pkg-comment.${EMACS_PORT_NAME} | COMMENTFILE?= ${PKGDIR}/pkg-comment.${EMACS_PORT_NAME} | ||||
DESCR?= ${PKGDIR}/pkg-descr.${EMACS_PORT_NAME} | DESCR?= ${PKGDIR}/pkg-descr.${EMACS_PORT_NAME} | ||||
PLIST?= ${PKGDIR}/pkg-plist.${EMACS_PORT_NAME} | PLIST?= ${PKGDIR}/pkg-plist.${EMACS_PORT_NAME} | ||||
.endif | .endif | ||||
.elif (${EMACS_PORT_NAME} == "emacs-nox11") | .if ${FLAVOR:M*lite} | ||||
EMACS_NAME= emacs | EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_lite | ||||
Done Inline ActionsI think there should be a: .if defined(EMACS_NO_FLAVORS) EMACS_FLAVOR= <a default flavor> .else EMACS_FLAVOR= ${FLAVOR} So that EMACS_FLAVOR is always set to something, and can always be used. A bit like it is done with Python. Also, I don't think it should contain the @ as it now always exist, and people see that it is a flavor because they write some:dep/end@${EMACS_FLAVOR}, otherwise, it ends up being "something that I try to add to the dependency line to see if it builds better this way". mat: I think there should be a:
```
.if defined(EMACS_NO_FLAVORS)
EMACS_FLAVOR= <a default… | |||||
EMACS_VER= 25.3 | .elif ${FLAVOR:Mcanna} | ||||
EMACS_MAJOR_VER= 25 | EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_canna | ||||
EMACS_LIBDIR= share/${EMACS_NAME} | |||||
EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER} | |||||
EMACS_PORTDIR= editors/emacs-nox11 | |||||
EMACS_COMMON_PORT= NO | |||||
EMACS_HAS_MULE= YES | |||||
EMACS_NO_SUBDIRSEL= NO | |||||
.if (${EMACS_MASTERDIR_PKGFILES} == "YES") | |||||
COMMENTFILE?= ${PKGDIR}/pkg-comment.${EMACS_PORT_NAME} | |||||
DESCR?= ${PKGDIR}/pkg-descr.${EMACS_PORT_NAME} | |||||
PLIST?= ${PKGDIR}/pkg-plist.${EMACS_PORT_NAME} | |||||
.endif | |||||
.else | .else | ||||
check-makevars:: | EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME} | ||||
Done Inline ActionsAll ports depending on a port using USE_EMACS but who are not using it themselves will need to be patched too: [00:02:17] [Dry Run] Warning: cad/dinotrace dependency on cad/verilog-mode.el has wrong PKGNAME of 'verilog-mode.el' but should be 'verilog-mode.el-emacs25' [00:02:18] [Dry Run] Warning: devel/clojure-cider dependency on lang/clojure-mode.el has wrong PKGNAME of 'clojure-mode.el' but should be 'clojure-mode.el-emacs25' [00:02:18] [Dry Run] Warning: devel/clojure-cider dependency on devel/dash.el has wrong PKGNAME of 'dash.el' but should be 'dash.el-emacs25' [00:02:18] [Dry Run] Warning: devel/clojure-cider dependency on devel/epl.el has wrong PKGNAME of 'epl.el' but should be 'epl.el-emacs25' [00:02:18] [Dry Run] Warning: devel/clojure-cider dependency on devel/pkg-info.el has wrong PKGNAME of 'pkg-info.el' but should be 'pkg-info.el-emacs25' [00:02:24] [Dry Run] Warning: lang/alchemist.el dependency on lang/elixir-mode.el has wrong PKGNAME of 'elixir-mode.el' but should be 'elixir-mode.el-emacs25' [00:02:34] [Dry Run] Warning: cad/dinotrace@devel_lite dependency on cad/verilog-mode.el has wrong PKGNAME of 'verilog-mode.el' but should be 'verilog-mode.el-emacs25' [00:02:34] [Dry Run] Warning: cad/dinotrace@devel dependency on cad/verilog-mode.el has wrong PKGNAME of 'verilog-mode.el' but should be 'verilog-mode.el-emacs25' [00:02:34] [Dry Run] Warning: cad/dinotrace@canna dependency on cad/verilog-mode.el has wrong PKGNAME of 'verilog-mode.el' but should be 'verilog-mode.el-emacs25' [...] mat: All ports depending on a port using USE_EMACS but who are not using it themselves will need to… | |||||
@${ECHO} "Makefile error: Bad value of EMACS_PORT_NAME: ${EMACS_PORT_NAME}." | |||||
@${ECHO} "Valid values are:" | |||||
@${ECHO} " Emacs family: emacs25 emacs-devel emacs-nox11" | |||||
@${FALSE} | |||||
.endif | .endif | ||||
# | # | ||||
# Common Definitions | # Common Definitions | ||||
# | # | ||||
# find where emacsen is installed | # find where emacs is installed | ||||
# look for it in PREFIX first and fall back to LOCALBASE then | # look for it in PREFIX first, then fall back to LOCALBASE | ||||
.if exists(/bin/${EMACS_NAME}-${EMACS_VER}) | .if exists(/bin/${EMACS_NAME}-${EMACS_VER}) | ||||
EMACS_BASE?= ${PREFIX} | EMACS_BASE?= ${PREFIX} | ||||
.else | .else | ||||
EMACS_BASE?= ${LOCALBASE} | EMACS_BASE?= ${LOCALBASE} | ||||
.endif | .endif | ||||
# emacsen command-line filename | # emacsen command-line filename | ||||
EMACS_CMD?= ${EMACS_BASE}/bin/${EMACS_NAME}-${EMACS_VER} | EMACS_CMD?= ${EMACS_BASE}/bin/${EMACS_NAME}-${EMACS_VER} | ||||
# emacsen core elisp filename | # emacsen core elisp filename | ||||
EMACS_CORE_DIR= ${EMACS_LIBDIR_WITH_VER}/lisp/${EMACS_CORE_SUBDIR} | EMACS_CORE_DIR= ${EMACS_LIBDIR_WITH_VER}/lisp/${EMACS_CORE_SUBDIR} | ||||
EMACS_COREEL= ${EMACS_BASE}/${EMACS_CORE_DIR}/startup.el | EMACS_COREEL= ${EMACS_BASE}/${EMACS_CORE_DIR}/startup.el | ||||
# emacsen libdir without ${LOCALBASE} | # emacsen libdir without ${LOCALBASE} | ||||
EMACS_SITE_LISPDIR?= ${EMACS_LIBDIR}/site-lisp | EMACS_SITE_LISPDIR?= ${EMACS_LIBDIR}/site-lisp | ||||
EMACS_VERSION_SITE_LISPDIR?= ${EMACS_LIBDIR_WITH_VER}/site-lisp | EMACS_VERSION_SITE_LISPDIR?= ${EMACS_LIBDIR_WITH_VER}/site-lisp | ||||
# build&run-dependency | .if !defined(EMACS_NO_BUILD_DEPENDS) | ||||
EMACS_NO_BUILD_DEPENDS?= NO | BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//} | ||||
EMACS_NO_RUN_DEPENDS?= NO | |||||
.if (${EMACS_NO_BUILD_DEPENDS} == "NO") | |||||
BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR} | |||||
.endif | .endif | ||||
.if (${EMACS_NO_RUN_DEPENDS} == "NO") | .if !defined(EMACS_NO_RUN_DEPENDS) | ||||
.if defined(EMACS_COMMON_PORT) && (${EMACS_COMMON_PORT} == "YES") | RUN_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//} | ||||
Done Inline ActionsThis does not work. When the flavor is devel it ends up passing an empty flavor. To get this to pass bulk -n -a, I had to do this: diff --git a/Mk/bsd.emacs.mk b/Mk/bsd.emacs.mk index fa39127..5e3ecb2 100644 --- a/Mk/bsd.emacs.mk +++ b/Mk/bsd.emacs.mk @@ -107,14 +107,16 @@ EMACS_COREEL= ${EMACS_BASE}/${EMACS_CORE_DIR}/startup.el EMACS_SITE_LISPDIR?= ${EMACS_LIBDIR}/site-lisp EMACS_VERSION_SITE_LISPDIR?= ${EMACS_LIBDIR_WITH_VER}/site-lisp +_DEPEND_EMACS_FLAVOR= ${FLAVOR:C/devel_?//:S/^$/default/} + # build&run-dependency EMACS_NO_BUILD_DEPENDS?= NO EMACS_NO_RUN_DEPENDS?= NO .if (${EMACS_NO_BUILD_DEPENDS} == "NO") -BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${FLAVOR:C/devel_?//} +BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${_DEPEND_EMACS_FLAVOR} .endif .if (${EMACS_NO_RUN_DEPENDS} == "NO") -RUN_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${FLAVOR:C/devel_?//} +RUN_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${_DEPEND_EMACS_FLAVOR} .endif # environments for build mat: This does not work. When the flavor is `devel` it ends up passing an empty flavor. To get this… | |||||
RUN_DEPENDS+= ${EMACS_COREEL}:${EMACS_PORTDIR}-common | |||||
.else | |||||
RUN_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR} | |||||
.endif | |||||
.endif | .endif | ||||
# environments for build | # environments for build | ||||
MAKE_ARGS+= EMACS=${EMACS_CMD} | MAKE_ARGS+= EMACS=${EMACS_CMD} | ||||
SCRIPTS_ENV+= EMACS_LIBDIR=${EMACS_LIBDIR} \ | SCRIPTS_ENV+= EMACS_LIBDIR=${EMACS_LIBDIR} \ | ||||
EMACS_VER=${EMACS_VER} \ | EMACS_VER=${EMACS_VER} \ | ||||
EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \ | EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \ | ||||
EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \ | EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \ | ||||
EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR} | EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR} | ||||
# pkg/PLIST substrings | # pkg/PLIST substrings | ||||
PLIST_SUB+= EMACS_LIBDIR=${EMACS_LIBDIR} \ | PLIST_SUB+= EMACS_LIBDIR=${EMACS_LIBDIR} \ | ||||
EMACS_VER=${EMACS_VER} \ | EMACS_VER=${EMACS_VER} \ | ||||
EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \ | EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \ | ||||
EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \ | EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \ | ||||
EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR} | EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR} |
I ponder upon the default here. It might be a nicer to have a more descriptive name.
Also, this means that any port that has USE_EMACS will now be built 5 times, that's 81 ports, so 324 new packages.