Tweak sysutils/healthd version 0.7.9_2
[dports.git] / Mk / bsd.emacs.mk
1 #
2 #       $FreeBSD$
3 #
4 #       bsd.emacs.mk - 19990829 Shigeyuki Fukushima.
5 #
6
7 Emacs_Include=                  bsd.emacs.mk
8 Emacs_Include_MAINTAINER=       ashish@FreeBSD.org
9
10 EMACS_PORT_NAME?=       emacs24
11
12 #
13 # This file for ports which depend on emacs family.
14 # Define EMACS_PORT_NAME variable before bsd.port.[pre.]mk
15 # and it will automatically include this file.
16 #
17 # This file exports the following common variables:
18 #
19 # EMACS_NAME:
20 #               emacsen's command-line basename.
21 #               ex.) "emacs" when emacsen is a emacs-20.6.
22 #
23 # EMACS_VER:
24 #               emacsen's version.
25 #               ex.) "20.6" when emacsen is a emacs-20.6.
26 #
27 # EMACS_MAJOR_VER:
28 #               emacsen's major version.
29 #               ex.) "20" when emacsen is a emacs-20.6.
30 #
31 # EMACS_LIBDIR:
32 #               emacsen's library directory name without ${PREFIX}.
33 #               ex.) "share/emacs" when emacsen is a emacs-20.6.
34 #
35 # EMACS_LIBDIR_WITH_VER:
36 #               emacsen's version specific library directory name
37 #               without ${PREFIX}.
38 #               ex.) "share/emacs/20.6" when emacsen is a emacs-20.6.
39 #
40 # EMACS_CMD:
41 #               emacsen's command-line filename. (full path)
42 #               ex.) "/usr/local/bin/emacs-20.6" when emacsen is a
43 #                    emacs-20.6 and ${PREFIX} is "/usr/local".
44 #
45 # EMACS_SITE_LISPDIR:
46 #               emacsen's site-lisp directory name without ${PREFIX}.
47 #               ex.) "share/emacs/site-lisp" when emacsen is a emacs-20.6.
48 #
49 # EMACS_VERSION_SITE_LISPDIR:
50 #               emacsen's version specific site-lisp directory name
51 #               without ${PREFIX}.
52 #               ex.) "share/emacs/20.6/site-lisp" when emacsen is a
53 #               emacs-20.6.
54 #
55 # EMACS_NO_BUILD_DEPENDS:
56 #               If set "YES" to this variable, port does not
57 #               build-depend on EMACS_PORT_NAME's emacsen.
58 #
59 # EMACS_NO_RUN_DEPENDS:
60 #               If set "YES" to this variable, port does not
61 #               run-depend on EMACS_PORT_NAME's emacsen.
62 #
63
64 EMACS_MASTERDIR_PKGFILES?=      NO
65
66 # Emacs-23.x
67 .if (${EMACS_PORT_NAME} == "emacs23")
68 EMACS_NAME=             emacs
69 EMACS_VER=              23.4
70 EMACS_MAJOR_VER=        23
71 EMACS_LIBDIR?=          share/${EMACS_NAME}
72 EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER}
73 EMACS_PORTSDIR=         ${PORTSDIR}/editors/emacs
74 EMACS_COMMON_PORT=      NO
75 EMACS_HAS_MULE=         YES
76 EMACS_NO_SUBDIRSEL=     NO
77 .if (${EMACS_MASTERDIR_PKGFILES} == "YES")
78 COMMENTFILE?=           ${PKGDIR}/pkg-comment.${EMACS_PORT_NAME}
79 DESCR?=                 ${PKGDIR}/pkg-descr.${EMACS_PORT_NAME}
80 PLIST?=                 ${PKGDIR}/pkg-plist.${EMACS_PORT_NAME}
81 .endif
82
83 # Emacs-24.x
84 .elif (${EMACS_PORT_NAME} == "emacs24")
85 EMACS_NAME=             emacs
86 EMACS_VER=              24.4
87 EMACS_MAJOR_VER=        24
88 EMACS_LIBDIR?=          share/${EMACS_NAME}
89 EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER}
90 EMACS_PORTSDIR=         ${PORTSDIR}/editors/emacs
91 EMACS_COMMON_PORT=      NO
92 EMACS_HAS_MULE=         YES
93 EMACS_NO_SUBDIRSEL=     NO
94 .if (${EMACS_MASTERDIR_PKGFILES} == "YES")
95 COMMENTFILE?=           ${PKGDIR}/pkg-comment.${EMACS_PORT_NAME}
96 DESCR?=                 ${PKGDIR}/pkg-descr.${EMACS_PORT_NAME}
97 PLIST?=                 ${PKGDIR}/pkg-plist.${EMACS_PORT_NAME}
98 .endif
99
100 # Emacs-24.x (development version)
101 .elif (${EMACS_PORT_NAME} == "emacs-devel")
102 EMACS_NAME=             emacs
103 EMACS_VER=              25.0.50
104 EMACS_MAJOR_VER=        25
105 EMACS_LIBDIR?=          share/${EMACS_NAME}
106 EMACS_LIBDIR_WITH_VER?= share/${EMACS_NAME}/${EMACS_VER}
107 EMACS_PORTSDIR=         ${PORTSDIR}/editors/emacs-devel
108 EMACS_COMMON_PORT=      NO
109 EMACS_HAS_MULE=         YES
110 EMACS_NO_SUBDIRSEL=     NO
111 .if (${EMACS_MASTERDIR_PKGFILES} == "YES")
112 COMMENTFILE?=           ${PKGDIR}/pkg-comment.${EMACS_PORT_NAME}
113 DESCR?=                 ${PKGDIR}/pkg-descr.${EMACS_PORT_NAME}
114 PLIST?=                 ${PKGDIR}/pkg-plist.${EMACS_PORT_NAME}
115 .endif
116
117 .else
118 check-makevars::
119         @${ECHO} "Makefile error: Bad value of EMACS_PORT_NAME: ${EMACS_PORT_NAME}."
120         @${ECHO} "Valid values are:"
121         @${ECHO} "      Emacs  family: emacs23 emacs24 emacs-devel"
122         @${FALSE}
123 .endif
124
125
126 #
127 # Common Definitions
128 #
129
130 # find where emacsen is installed
131 # look for it in PREFIX first and fall back to LOCALBASE then
132 .if exists(/bin/${EMACS_NAME}-${EMACS_VER})
133 EMACS_BASE?=                    ${PREFIX}
134 .else
135 EMACS_BASE?=                    ${LOCALBASE}
136 .endif
137 # emacsen command-line filename
138 EMACS_CMD?=                     ${EMACS_BASE}/bin/${EMACS_NAME}-${EMACS_VER}
139 # emacsen core elisp filename
140 EMACS_CORE_DIR=                 ${EMACS_LIBDIR_WITH_VER}/lisp/${EMACS_CORE_SUBDIR}
141 EMACS_COREEL=                   ${EMACS_BASE}/${EMACS_CORE_DIR}/startup.el
142 # emacsen libdir without ${LOCALBASE}
143 EMACS_SITE_LISPDIR?=            ${EMACS_LIBDIR}/site-lisp
144 EMACS_VERSION_SITE_LISPDIR?=    ${EMACS_LIBDIR_WITH_VER}/site-lisp
145
146 # build&run-dependency
147 EMACS_NO_BUILD_DEPENDS?=        NO
148 EMACS_NO_RUN_DEPENDS?=          NO
149 .if (${EMACS_NO_BUILD_DEPENDS} == "NO")
150 BUILD_DEPENDS+=         ${EMACS_CMD}:${EMACS_PORTSDIR}
151 .endif
152 .if (${EMACS_NO_RUN_DEPENDS} == "NO")
153 .if defined(EMACS_COMMON_PORT) && (${EMACS_COMMON_PORT} == "YES")
154 RUN_DEPENDS+=   ${EMACS_COREEL}:${EMACS_PORTSDIR}-common
155 .else
156 RUN_DEPENDS+=   ${EMACS_CMD}:${EMACS_PORTSDIR}
157 .endif
158 .endif
159
160 # environments for build
161 MAKE_ARGS+=     EMACS=${EMACS_CMD}
162 SCRIPTS_ENV+=   EMACS_LIBDIR=${EMACS_LIBDIR} \
163                 EMACS_VER=${EMACS_VER} \
164                 EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \
165                 EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \
166                 EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR}
167 # pkg/PLIST substrings
168 PLIST_SUB+=     EMACS_LIBDIR=${EMACS_LIBDIR} \
169                 EMACS_VER=${EMACS_VER} \
170                 EMACS_LIBDIR_WITH_VER=${EMACS_LIBDIR_WITH_VER} \
171                 EMACS_SITE_LISPDIR=${EMACS_SITE_LISPDIR} \
172                 EMACS_VERSION_SITE_LISPDIR=${EMACS_VERSION_SITE_LISPDIR}