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 | #------------------------------------------------------------------------------- | ||||
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`. | |||||
# USE_EMACS= yes | |||||
# | # | ||||
# This file for ports which depend on emacs family. | # Variables to be set in port Makefile: | ||||
# Define EMACS_PORT_NAME variable before bsd.port.[pre.]mk | |||||
# and it will automatically include this file. | |||||
# | # | ||||
# This file exports the following common variables: | # EMACS_NO_FLAVORS: Do not create flavors | ||||
# EMACS_EXCLUDE_FLAVORS: A list of flavors to exclude (see FLAVORS=... below) | |||||
# EMACS_NO_BUILD_DEPENDS: Do not add a build dependency on Emacs | |||||
# EMACS_NO_RUN_DEPENDS: Do not add a run dependency on Emacs | |||||
# | # | ||||
# EMACS_NAME: | # Variables to be read in port Makefile: | ||||
# emacsen's command-line basename. | |||||
# ex.) "emacs" when emacsen is a emacs-20.6. | |||||
# | # | ||||
# EMACS_VER: | # EMACS_CMD: Emacs command with full path (e.g. /usr/local/bin/emacs-25.3) | ||||
# emacsen's version. | # EMACS_VER: Emacs version (e.g. 25.3) | ||||
# ex.) "20.6" when emacsen is a emacs-20.6. | # EMACS_MAJOR_VER: Emacs major version (e.g. 25) | ||||
# | # EMACS_LIBDIR: Emacs Library directory without ${PREFIX} (e.g. share/emacs) | ||||
# EMACS_MAJOR_VER: | # EMACS_LIBDIR_WITH_VER: Library directory without ${PREFIX} including version (e.g. share/emacs/25.3) | ||||
# emacsen's major version. | # EMACS_SITE_LISPDIR: Emacs site-lisp directory without ${PREFIX} (e.g. share/emacs/site-lisp) | ||||
# ex.) "20" when emacsen is a emacs-20.6. | # EMACS_VERSION_SITE_LISPDIR: Include version (e.g. share/emacs/25.3/site-lisp) | ||||
# | # EMACS_PKGNAMESUFFIX: PKGNAMESUFFIX to distinguish Emacs flavors | ||||
# EMACS_LIBDIR: | # EMACS_FLAVOR: Used for dependencies (e.g. BUILD_DEPENDS= dash.el${EMACS_PKGNAMESUFFIX}>0:devel/dash@${EMACS_FLAVOR}) | ||||
# emacsen's library directory name without ${PREFIX}. | #------------------------------------------------------------------------------- | ||||
# ex.) "share/emacs" when emacsen is a emacs-20.6. | |||||
# | |||||
# EMACS_LIBDIR_WITH_VER: | |||||
# emacsen's version specific library directory name | |||||
# without ${PREFIX}. | |||||
# ex.) "share/emacs/20.6" when emacsen is a emacs-20.6. | |||||
# | |||||
# EMACS_CMD: | |||||
# emacsen's command-line filename. (full path) | |||||
# ex.) "/usr/local/bin/emacs-20.6" when emacsen is a | |||||
# emacs-20.6 and ${PREFIX} is "/usr/local". | |||||
# | |||||
# EMACS_SITE_LISPDIR: | |||||
# emacsen's site-lisp directory name without ${PREFIX}. | |||||
# ex.) "share/emacs/site-lisp" when emacsen is a emacs-20.6. | |||||
# | |||||
# EMACS_VERSION_SITE_LISPDIR: | |||||
# emacsen's version specific site-lisp directory name | |||||
# without ${PREFIX}. | |||||
# ex.) "share/emacs/20.6/site-lisp" when emacsen is a | |||||
# emacs-20.6. | |||||
# | |||||
# EMACS_NO_BUILD_DEPENDS: | |||||
# If set "YES" to this variable, port does not | |||||
# build-depend on EMACS_PORT_NAME's emacsen. | |||||
# | |||||
# EMACS_NO_RUN_DEPENDS: | |||||
# If set "YES" to this variable, port does not | |||||
# run-depend on EMACS_PORT_NAME's emacsen. | |||||
# | |||||
EMACS_MASTERDIR_PKGFILES?= NO | .if defined(EMACS_NO_FLAVORS) | ||||
FLAVORS= full | |||||
# Emacs-25.x | .else | ||||
.if (${EMACS_PORT_NAME} == "emacs25") | FLAVORS= full canna lite devel_full devel_lite | ||||
EMACS_NAME= emacs | .for flavor in ${EMACS_EXCLUDE_FLAVORS} | ||||
EMACS_VER= 25.3 | FLAVORS:= ${FLAVORS:N${flavor}} | ||||
EMACS_MAJOR_VER= 25 | .endfor | ||||
EMACS_LIBDIR?= share/${EMACS_NAME} | |||||
EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER} | |||||
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_FLAVOR= ${FLAVOR} | ||||
.elif (${EMACS_PORT_NAME} == "emacs-devel") | |||||
EMACS_NAME= emacs | .if ${FLAVOR:Mdevel*} | ||||
EMACS_VER= 27.0.50 | EMACS_VER= 27.0.50 | ||||
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_MAJOR_VER= 27 | |||||
EMACS_LIBDIR?= share/${EMACS_NAME} | |||||
EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER} | |||||
EMACS_PORTDIR= editors/emacs-devel | EMACS_PORTDIR= editors/emacs-devel | ||||
EMACS_COMMON_PORT= NO | .else | ||||
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 | |||||
.elif (${EMACS_PORT_NAME} == "emacs-nox11") | |||||
EMACS_NAME= emacs | |||||
EMACS_VER= 25.3 | EMACS_VER= 25.3 | ||||
EMACS_MAJOR_VER= 25 | EMACS_PORTDIR= editors/emacs | ||||
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… | |||||
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 | .endif | ||||
EMACS_MAJOR_VER= ${EMACS_VER:C/\..*//} | |||||
EMACS_LIBDIR= share/emacs | |||||
EMACS_LIBDIR_WITH_VER= share/emacs/${EMACS_VER} | |||||
EMACS_PORT_NAME= emacs${EMACS_MAJOR_VER} | |||||
.if ${FLAVOR:M*lite} | |||||
EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_lite | |||||
.elif ${FLAVOR:Mcanna} | |||||
EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_canna | |||||
.else | .else | ||||
check-makevars:: | EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME} | ||||
@${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 | ||||
EMACS_CMD= ${PREFIX}/bin/emacs-${EMACS_VER} | |||||
EMACS_SITE_LISPDIR= ${EMACS_LIBDIR}/site-lisp | |||||
EMACS_VERSION_SITE_LISPDIR= ${EMACS_LIBDIR_WITH_VER}/site-lisp | |||||
# | .if !defined(EMACS_NO_BUILD_DEPENDS) | ||||
# Common Definitions | BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//} | ||||
# | |||||
# find where emacsen is installed | |||||
# look for it in PREFIX first and fall back to LOCALBASE then | |||||
.if exists(/bin/${EMACS_NAME}-${EMACS_VER}) | |||||
EMACS_BASE?= ${PREFIX} | |||||
.else | |||||
EMACS_BASE?= ${LOCALBASE} | |||||
.endif | .endif | ||||
# emacsen command-line filename | .if !defined(EMACS_NO_RUN_DEPENDS) | ||||
EMACS_CMD?= ${EMACS_BASE}/bin/${EMACS_NAME}-${EMACS_VER} | 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… | |||||
# emacsen core elisp filename | |||||
EMACS_CORE_DIR= ${EMACS_LIBDIR_WITH_VER}/lisp/${EMACS_CORE_SUBDIR} | |||||
EMACS_COREEL= ${EMACS_BASE}/${EMACS_CORE_DIR}/startup.el | |||||
# emacsen libdir without ${LOCALBASE} | |||||
EMACS_SITE_LISPDIR?= ${EMACS_LIBDIR}/site-lisp | |||||
EMACS_VERSION_SITE_LISPDIR?= ${EMACS_LIBDIR_WITH_VER}/site-lisp | |||||
# 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} | |||||
.endif | .endif | ||||
.if (${EMACS_NO_RUN_DEPENDS} == "NO") | |||||
.if defined(EMACS_COMMON_PORT) && (${EMACS_COMMON_PORT} == "YES") | |||||
RUN_DEPENDS+= ${EMACS_COREEL}:${EMACS_PORTDIR}-common | |||||
.else | |||||
RUN_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR} | |||||
.endif | |||||
.endif | |||||
# 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 | |||||
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.