Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Feb 2018 13:43:14 +0000 (UTC)
From:      Joseph Mingrone <jrm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r460701 - in head: Mk/Uses japanese/migemo-emacs
Message-ID:  <201802021343.w12DhEYV078550@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jrm
Date: Fri Feb  2 13:43:14 2018
New Revision: 460701
URL: https://svnweb.freebsd.org/changeset/ports/460701

Log:
  Flavorize and modernize Emacs ports
  
  This is an addendum to r460621 to fix the histories of Mk/Uses/emacs.mk
  (copied from Mk/bsd.emacs.mk) and japanese/migemo-emacs (copied from
  japanese/migemo-emacs23).
  
  - Convert USE_EMACS to USES=emacs
  - Rename japanese/migemo-emacs23 to japanese/migemo-emacs
  
  Differential Revision:	https://reviews.freebsd.org/D13506

Added:
  head/Mk/Uses/emacs.mk
     - copied, changed from r460620, head/Mk/bsd.emacs.mk
  head/japanese/migemo-emacs/
     - copied from r460620, head/japanese/migemo-emacs23/
Modified:
  head/japanese/migemo-emacs/Makefile

Copied and modified: head/Mk/Uses/emacs.mk (from r460620, head/Mk/bsd.emacs.mk)
==============================================================================
--- head/Mk/bsd.emacs.mk	Thu Feb  1 17:31:35 2018	(r460620, copy source)
+++ head/Mk/Uses/emacs.mk	Fri Feb  2 13:43:14 2018	(r460701)
@@ -1,171 +1,133 @@
+# $FreeBSD$
 #
-#	$FreeBSD$
+# Provide support for ports requiring Emacs.  This includes flavors with proper
+# dependencies and useful variables.
 #
-#	bsd.emacs.mk - 19990829 Shigeyuki Fukushima.
+# Feature:		emacs
+# Usage:		USES=emacs or USES=emacs:args
+# Valid ARGS:	build, run
 #
-
-Emacs_Include=			bsd.emacs.mk
-Emacs_Include_MAINTAINER=	ashish@FreeBSD.org
-
-EMACS_PORT_NAME?=	emacs25
-
+# build			Indicates that Emacs is needed at build time.
+# run			Indicates that Emacs is needed at run time.
 #
-# 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.
+# 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
+# Emacs dependencies.
 #
-# This file exports the following common variables:
+# 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: full canna nox devel_full devel_nox
+#                             Flavors specified on the command line take precedence.
 #
-# EMACS_NAME:
-#		emacsen's command-line basename.
-#		ex.) "emacs" when emacsen is a emacs-20.6.
+# 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
+#                             valid Emacs flavors are assumed.
 #
-# EMACS_VER:
-#		emacsen's version.
-#		ex.) "20.6" when emacsen is a emacs-20.6.
+# EMACS_NO_DEPENDS:           Do NOT add build or run dependencies on Emacs.
 #
-# EMACS_MAJOR_VER:
-#		emacsen's major version.
-#		ex.) "20" when emacsen is a emacs-20.6.
+# 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})
+# 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)
+#-------------------------------------------------------------------------------
 #
-# EMACS_LIBDIR:
-#		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.
-#
+# MAINTAINER:	emacs@FreeBSD.org
 
-EMACS_MASTERDIR_PKGFILES?=	NO
+.if !defined(_INCLUDE_USES_EMACS_MK)
+_INCLUDE_USES_EMACS_MK=	yes
 
-# Emacs-25.x
-.if (${EMACS_PORT_NAME} == "emacs25")
-EMACS_NAME=		emacs
-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_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}
+# 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
 
-# Emacs-26.x (development version)
-.elif (${EMACS_PORT_NAME} == "emacs-devel")
-EMACS_NAME=		emacs
-EMACS_VER=		27.0.50
-EMACS_MAJOR_VER=	27
-EMACS_LIBDIR?=		share/${EMACS_NAME}
-EMACS_LIBDIR_WITH_VER?=	share/${EMACS_NAME}/${EMACS_VER}
-EMACS_PORTDIR=		editors/emacs-devel
-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}
+# 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
 
-.elif (${EMACS_PORT_NAME} == "emacs-nox11")
-EMACS_NAME=		emacs
-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-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}
+.if defined(_EMACS_RUN_DEP)
+FLAVORS=	full canna nox devel_full devel_nox
+.for flavor in ${EMACS_FLAVORS_EXCLUDE}
+FLAVORS:=	${FLAVORS:N${flavor}}
+.endfor
+.else
+FLAVORS=	full
 .endif
 
+.if empty(FLAVOR)
+.if defined(EMACS_DEFAULT)
+FLAVOR=	${EMACS_DEFAULT}
 .else
-check-makevars::
-	@${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}
+FLAVOR=	${FLAVORS:[1]}
 .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
 
-#
-# Common Definitions
-#
+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}
 
-# 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}
+.if ${FLAVOR:M*nox}
+EMACS_PKGNAMESUFFIX=		-${EMACS_PORT_NAME}_nox
+.elif ${FLAVOR:Mcanna}
+EMACS_PKGNAMESUFFIX=		-${EMACS_PORT_NAME}_canna
 .else
-EMACS_BASE?=			${LOCALBASE}
+EMACS_PKGNAMESUFFIX=		-${EMACS_PORT_NAME}
 .endif
-# emacsen command-line filename
-EMACS_CMD?=			${EMACS_BASE}/bin/${EMACS_NAME}-${EMACS_VER}
-# 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}
+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 (${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}
+.if defined(_EMACS_RUN_DEP)
+RUN_DEPENDS+=	${EMACS_CMD}:${EMACS_PORTDIR}@${EMACS_FLAVOR:C/devel_//}
 .endif
-.endif
 
-# environments for build
 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}
-# pkg/PLIST substrings
+
 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

Modified: head/japanese/migemo-emacs/Makefile
==============================================================================
--- head/japanese/migemo-emacs23/Makefile	Thu Feb  1 17:31:35 2018	(r460620)
+++ head/japanese/migemo-emacs/Makefile	Fri Feb  2 13:43:14 2018	(r460701)
@@ -1,22 +1,21 @@
 # Created by: MANTANI Nobutaka <nobutaka@FreeBSD.org>
 # $FreeBSD$
 
-PORTREVISION=	1
-PKGNAMESUFFIX=	-${EMACS_PORT_NAME}
-COMMENT=	Japanese incremental search tool for emacs
+PKGNAMESUFFIX=	${EMACS_PKGNAMESUFFIX}
+COMMENT=	Japanese incremental search tool for Emacs
 MASTERDIR=	${.CURDIR}/../../japanese/migemo
-PKGDIR=	${.CURDIR}
+PKGDIR=		${.CURDIR}
 PLIST=		${MASTERDIR}/pkg-plist
 PKGMESSAGE=	${MASTERDIR}/pkg-message
 
-USE_EMACS=	yes
-BUILD_DEPENDS=	${LOCALBASE}/${EMACS_LIBDIR_WITH_VER}/site-lisp/emu/emu.el:editors/apel
-RUN_DEPENDS=	${LOCALBASE}/${EMACS_LIBDIR_WITH_VER}/site-lisp/emu/emu.el:editors/apel \
+BUILD_DEPENDS=	apel${EMACS_PKGNAMESUFFIX}>=10.8:editors/apel@${EMACS_FLAVOR}
+RUN_DEPENDS=	apel${EMACS_PKGNAMESUFFIX}>=10.8:editors/apel@${EMACS_FLAVOR} \
 		migemo:japanese/migemo
 
-CONFLICTS=	ja-migemo-emacs22-[0-9]* \
-	ja-migemo-emacs21-[0-9]*
+USES=		emacs
 
+CONFLICTS=	ja-migemo.el
+
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	--with-emacs=${EMACS_CMD}
 ALL_TARGET=	migemo.elc
@@ -27,4 +26,5 @@ SLAVE_PORT=	yes
 do-install:
 	${INSTALL_DATA} ${WRKSRC}/migemo.el ${STAGEDIR}${PREFIX}/${EMACS_LIBDIR}/site-lisp
 	${INSTALL_DATA} ${WRKSRC}/migemo.elc ${STAGEDIR}${PREFIX}/${EMACS_LIBDIR}/site-lisp
+
 .include "${MASTERDIR}/Makefile"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802021343.w12DhEYV078550>