summaryrefslogtreecommitdiff
path: root/mk/emacs.mk
diff options
context:
space:
mode:
authoruebayasi <uebayasi@pkgsrc.org>2002-09-16 12:51:34 +0000
committeruebayasi <uebayasi@pkgsrc.org>2002-09-16 12:51:34 +0000
commitbde7f9bfcb52857f7b94c4f010f1096e9a3b08a6 (patch)
treeb48f4f85b21b9cd4d19ef776a3f3e3337a83b555 /mk/emacs.mk
parenta3b9f6896ad0be33866dd815e8f3116e2a4ba2f5 (diff)
downloadpkgsrc-bde7f9bfcb52857f7b94c4f010f1096e9a3b08a6.tar.gz
* Assume each Emacs lisp package supports only (GNU) Emacs 20/21 by default.
* Slightly modify the way to prefix "xemacs-" to a package compiled for XEmacs. * Suppress warnings issued when Emacs/XEmacs are not installed.
Diffstat (limited to 'mk/emacs.mk')
-rw-r--r--mk/emacs.mk31
1 files changed, 24 insertions, 7 deletions
diff --git a/mk/emacs.mk b/mk/emacs.mk
index 61f0f5ee91e..e9a97a06e88 100644
--- a/mk/emacs.mk
+++ b/mk/emacs.mk
@@ -1,4 +1,4 @@
-# $NetBSD: emacs.mk,v 1.2 2002/09/14 02:19:29 uebayasi Exp $
+# $NetBSD: emacs.mk,v 1.3 2002/09/16 12:51:34 uebayasi Exp $
#
# A Makefile fragment for Emacs Lisp packages.
#
@@ -10,7 +10,13 @@
# XEmacs
# ->${PREFIX}/lib/xemacs/site-packages/lisp/foo/...
#
-# * XEmacs package's names are prefix'ed by "xemacs-"
+# * XEmacs package's names are prefix'ed by "xemacs-", since Emacs
+# {20,21} conflict, and XEmacs conflict.
+#
+# * Assume each package supports GNU Emacs {20,21} by default. If the
+# package supports XEmacsen too, define EMACS_VERSIONS_ACCEPTED
+# explicitly before including mk/emacs.mk. Note that the order is
+# important.
#
.if !defined(EMACS_MK)
@@ -18,7 +24,7 @@ EMACS_MK= # defined
.include "../../mk/bsd.prefs.mk"
-# XXX For now, assume only GNU emacsen are supported by default.
+# Assume only GNU emacsen are supported by default.
#
EMACS_VERSION_DEFAULT?= emacs21
.if !defined(USE_XEMACS)
@@ -43,7 +49,12 @@ _EMACS_VERSION_${v}_OK= yes
# Look for Emacs 21/Emacs 20
#
-_TMP!= ${PKG_TOOLS_BIN}/pkg_info -I emacs 2>/dev/null | ${AWK} '{print $$1}'
+_TMP!= if ${PKG_TOOLS_BIN}/pkg_info -e emacs >/dev/null 2>&1; then \
+ ${PKG_TOOLS_BIN}/pkg_info -I emacs 2>/dev/null | \
+ ${AWK} '{print $$1}'; \
+ else \
+ ${ECHO}; \
+ fi
.if ${_TMP} != ""
_EMACS_VERSION_EMACS_FULL:= ${_TMP}
_EMACS_VERSION_EMACS= ${_EMACS_VERSION_EMACS_FULL:C/^.*-//}
@@ -57,7 +68,12 @@ _EMACS_VERSION_emacs20_INSTALLED= yes
# Look for XEmacs 21.5/XEmacs 21.1
#
-_TMP!= ${PKG_TOOLS_BIN}/pkg_info -I xemacs 2>/dev/null | ${AWK} '{print $$1}'
+_TMP!= if ${PKG_TOOLS_BIN}/pkg_info -e xemacs >/dev/null 2>&1; then \
+ ${PKG_TOOLS_BIN}/pkg_info -I xemacs 2>/dev/null | \
+ ${AWK} '{print $$1}'; \
+ else \
+ ${ECHO}; \
+ fi
.if ${_TMP} != ""
_EMACS_VERSION_XEMACS_FULL:= ${_TMP:C/^.*-//}
_EMACS_VERSION_XEMACS= ${_EMACS_VERSION_XEMACS_FULL:C/^.*-//}
@@ -122,11 +138,9 @@ DEPENDS+= ${BUILDLINK_DEPENDS.leim20}:../../editors/leim20
.endif
.elif ${_EMACS_VERSION} == "xemacs215"
EMACS_DEPENDENCY= ${BUILDLINK_DEPENDS.xemacs215}:../../editors/xemacs-current
-PKGNAME= xemacs-${DISTNAME}
FOR.xemacs215= ""
.elif ${_EMACS_VERSION} == "xemacs211"
EMACS_DEPENDENCY= ${BUILDLINK_DEPENDS.xemacs211}:../../editors/xemacs
-PKGNAME= xemacs-${DISTNAME}
FOR.xemacs211= ""
.else
IGNORE+= "Accepted versions are: ${EMACS_VERSIONS_ACCEPTED}"
@@ -142,11 +156,14 @@ DEPENDS+= ${EMACS_DEPENDENCY}
#
EMACS_FLAVOR= ${_EMACS_VERSION:C|[0-9]*$||}
.if ${EMACS_FLAVOR} == "emacs"
+EMACS_BIN= ${PREFIX}/bin/emacs
EMACS_VERSION= ${_EMACS_VERSION_EMACS_FULL:C|^.*-||}
EMACS_LISPPREFIX= ${PREFIX}/share/emacs/site-lisp
.else
+EMACS_BIN= ${PREFIX}/bin/xemacs
EMACS_VERSION= ${_EMACS_VERSION_XEMACS_FULL:C|^.*-||}
EMACS_LISPPREFIX= ${PREFIX}/lib/xemacs/site-packages/lisp
+PKGNAME= xemacs-${DISTNAME}
.endif
PLIST_SUBST+= EMACS_VERSION=${EMACS_VERSION}
PLIST_SUBST+= EMACS_LISPPREFIX=${EMACS_LISPPREFIX:C|^${PREFIX}/||}