Changeset View
Standalone View
Mk/Uses/emacs.mk
- This file was added.
# $FreeBSD$ | |||||
# bsd.emacs.mk - 19990829 Shigeyuki Fukushima. | |||||
# | |||||
mat: This is not really bsd.emacs.mk any more ;-) | |||||
# Provide support for ports requiring Emacs. This includes flavors with proper | |||||
# dependencies and useful variables. | |||||
# | |||||
# Feature: emacs | |||||
# Usage: USES=emacs or USES=emacs:args | |||||
# Valid ARGS: build, run | |||||
# | |||||
# build Indicates that Emacs is needed at build time and adds it to | |||||
# BUILD_DEPENDS. | |||||
# run Indicates that Emacs is needed at run time and adds it to | |||||
# RUN_DEPENDS. | |||||
# | |||||
# If build and run are omitted from the argument list, Emacs will be added as | |||||
# BUILD_DEPENDS and RUN_DEPENDS. EMACS_NO_DEPENDS can be set to prevent any | |||||
# dependencies. | |||||
# | |||||
# Variables, which can be set in make.conf: | |||||
# DEFAULT_VERSIONS= The default flavor for Emacs ports can be added to | |||||
# DEFAULT_VERSIONS. For example, DEFAULT_VERSIONS=emacs=nox. | |||||
# Valid flavors are: full canna nox devel_full devel_nox. | |||||
Not Done Inline Actionsuse DEFAULT_VERSIONS+=. mat: use `DEFAULT_VERSIONS+=`. | |||||
# Flavors specified on the command line take precedence. | |||||
# | |||||
# Variables, which can be set by ports: | |||||
# EMACS_FLAVORS: List of Emacs flavors to build. | |||||
# Valid flavors are: full canna nox devel_full devel_nox | |||||
# If EMACS_FLAVORS is not defined, all flavors are assumed. | |||||
# EMACS_NO_DEPENDS: Do add build or run dependencies on Emacs. | |||||
Not Done Inline ActionsI wonder if this should not be reversed, like, the "the list of flavors that I cannot build with". So that if a flavor is added later, it can be built too. (It is just a thought, not a request.) mat: I wonder if this should not be reversed, like, the "the list of flavors that I cannot build… | |||||
# | |||||
# Variables, which can be read by ports: | |||||
# EMACS_CMD: Emacs command with full path (e.g. /usr/local/bin/emacs-25.3) | |||||
# EMACS_FLAVOR: Used for dependencies (e.g. BUILD_DEPENDS= dash.el${EMACS_PKGNAMESUFFIX}>0:devel/dash@${EMACS_FLAVOR}) | |||||
Not Done Inline ActionsBut the default flavor can be something else than "full", when using the default versions thing. No ? mat: But the default flavor can be something else than "full", when using the default versions thing. | |||||
Not Done Inline ActionsThis variable is redundant now. I removed it. jrm: This variable is redundant now. I removed it. | |||||
# EMACS_LIBDIR: Emacs Library directory without ${PREFIX} (e.g. share/emacs) | |||||
# EMACS_LIBDIR_WITH_VER: Library directory without ${PREFIX} including version (e.g. share/emacs/25.3) | |||||
# EMACS_MAJOR_VER: Emacs major version (e.g. 25) | |||||
# EMACS_PKGNAMESUFFIX: PKGNAMESUFFIX to distinguish Emacs flavors | |||||
# EMACS_SITE_LISPDIR: Emacs site-lisp directory without ${PREFIX} (e.g. share/emacs/site-lisp) | |||||
# EMACS_VER: Emacs version (e.g. 25.3) | |||||
# EMACS_VERSION_SITE_LISPDIR: Include version (e.g. share/emacs/25.3/site-lisp) | |||||
#------------------------------------------------------------------------------- | |||||
# | |||||
# MAINTAINER: emacs@FreeBSD.org | |||||
.if !defined(_INCLUDE_USES_EMACS_MK) | |||||
_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_RUN_DEP | |||||
_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_ARGS:= ${_EMACS_ARGS:Nrun} | |||||
.endif | |||||
# If the port does not specify a build or run dependency, and does not define | |||||
# EMACS_NO_DEPENDS, assume both dependencies are required. | |||||
.if !defined(_EMACS_BUILD_DEP) && !defined(_EMACS_RUN_DEP) && \ | |||||
!defined(EMACS_NO_DEPENDS) | |||||
_EMACS_BUILD_DEP= yes | |||||
_EMACS_RUN_DEP= yes | |||||
.endif | |||||
.if defined(_EMACS_RUN_DEP) | |||||
. if defined(EMACS_FLAVORS) | |||||
FLAVORS= ${EMACS_FLAVORS} | |||||
. else | |||||
FLAVORS= full canna nox devel_full devel_nox | |||||
. endif | |||||
.else | |||||
FLAVORS= full | |||||
Not Done Inline Actions@jrm --- how about we change it to EMACS_FLAVOR?= ${FLAVOR} that way user can override it in make.conf(5), as remember to specifying FLAVOR explicitly for emacs dependent port seems pretty inconvenient for me, and this way it will be similar to older method ? We'll just have to add an UPDATING note that instead of EMACS_PORT_NAME, use EMACS_FLAVOR to specify your desired version of Emacs. ashish: @jrm --- how about we change it to `EMACS_FLAVOR?= ${FLAVOR}` that way user can override it in… | |||||
Not Done Inline ActionsEMACS_FLAVOR is only for dependencies and does not affect the current port, so EMACS_FLAVOR?= ${FLAVOR} won't give what you are looking for. I will have to give this some thought to see if something can be done to address your point. jrm: `EMACS_FLAVOR` is only for dependencies and does not affect the current port, so `EMACS_FLAVOR? | |||||
.endif | |||||
.if empty(FLAVOR) | |||||
.if defined(EMACS_DEFAULT) | |||||
FLAVOR= ${EMACS_DEFAULT} | |||||
.else | |||||
FLAVOR= ${FLAVORS:[1]} | |||||
Done Inline ActionsMaybe append the list of supported flavors here. mat: Maybe append the list of supported flavors here. | |||||
.endif | |||||
.endif | |||||
EMACS_FLAVOR= ${FLAVOR} | |||||
.if ${FLAVOR:Mdevel*} | |||||
EMACS_VER= 27.0.50 | |||||
EMACS_PORTDIR= editors/emacs-devel | |||||
.else | |||||
EMACS_VER= 25.3 | |||||
EMACS_PORTDIR= editors/emacs | |||||
.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*nox} | |||||
EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_nox | |||||
.elif ${FLAVOR:Mcanna} | |||||
EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_canna | |||||
.else | |||||
EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME} | |||||
.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_BUILD_DEP) | |||||
BUILD_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//} | |||||
.endif | |||||
.if defined(_EMACS_RUN_DEP) | |||||
RUN_DEPENDS+= ${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//} | |||||
.endif | |||||
MAKE_ARGS+= EMACS=${EMACS_CMD} | |||||
SCRIPTS_ENV+= EMACS_LIBDIR=${EMACS_LIBDIR} \ | |||||
EMACS_VER=${EMACS_VER} \ | |||||
EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \ | |||||
EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \ | |||||
EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR} | |||||
PLIST_SUB+= EMACS_LIBDIR=${EMACS_LIBDIR} \ | |||||
EMACS_VER=${EMACS_VER} \ | |||||
EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \ | |||||
EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \ | |||||
EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR} | |||||
.endif # _INCLUDE_USES_EMACS_MK |
This is not really bsd.emacs.mk any more ;-)