Annotation of pkgsrc/editors/emacs/Makefile.common, Revision 1.45
1.45 ! ryoon 1: # $NetBSD: Makefile.common,v 1.44 2019/06/08 10:40:54 rillig Exp $
1.25 wiz 2: #
3: # used by editors/emacs/Makefile
4: # used by editors/emacs-nox11/Makefile
1.1 markd 5:
1.22 minskim 6: CATEGORIES= editors
1.38 dholland 7: MASTER_SITES= # empty
8: DISTFILES= # empty
1.22 minskim 9:
1.38 dholland 10: MAINTAINER= dholland@NetBSD.org
11: COMMENT= Meta-package for installing the preferred Emacs version
1.22 minskim 12:
1.38 dholland 13: META_PACKAGE= yes
1.22 minskim 14:
1.38 dholland 15: .include "../../mk/bsd.prefs.mk"
1.1 markd 16:
1.38 dholland 17: #
18: # 1. Depend on the right emacs using ${EMACS_TYPE}. We don't have to
19: # (and in fact shouldn't) depend on the exact version, just *a*
20: # version. Do *not* include modules.mk as that will get us a tighter
21: # pattern than we want, as well as other problematic effects.
22: #
23: # XXX: it would be better to split modules.mk and share the logic
24: # that can be shared.
25: #
1.1 markd 26:
1.44 rillig 27: MY_EMACS_TYPE?= ${EMACS_TYPE}
28: EMACS_BASE_TYPE= ${MY_EMACS_TYPE:S/nox//}
29: EMACS_MAJOR= ${EMACS_BASE_TYPE:S/emacs//}
1.38 dholland 30:
31: # Sigh.
32: .if ${MY_EMACS_TYPE} == "emacs20nox"
33: MY_EMACS_TYPE:= emacs20
34: .endif
1.24 joerg 35:
1.38 dholland 36: .if !empty(MY_EMACS_TYPE:Mxemacs*)
37: PKG_FAIL_REASON+= "EMACS_TYPE is xemacs."
1.40 dholland 38: # (Set these to avoid crashing out below.)
1.38 dholland 39: EMACS_PKGDIR= ../../editors/xemacs
1.40 dholland 40: EMACS_PACKAGE= xemacs
1.45 ! ryoon 41: .elif ${MY_EMACS_TYPE} == "emacs28"
1.38 dholland 42: EMACS_PKGDIR= ../../editors/emacs-snapshot
1.40 dholland 43: EMACS_PACKAGE= ${EMACS_BASE_TYPE}
1.38 dholland 44: .elif !empty(MY_EMACS_TYPE:M*nox)
45: EMACS_PKGDIR= ../../editors/${EMACS_BASE_TYPE}-nox11
1.40 dholland 46: EMACS_PACKAGE= ${EMACS_BASE_TYPE}-nox11
1.38 dholland 47: .else
48: EMACS_PKGDIR= ../../editors/${EMACS_BASE_TYPE}
1.40 dholland 49: EMACS_PACKAGE= ${EMACS_BASE_TYPE}
1.38 dholland 50: .endif
1.1 markd 51:
1.40 dholland 52: DEPENDS+= ${EMACS_PACKAGE}>=${EMACS_MAJOR}:${EMACS_PKGDIR}
1.1 markd 53:
1.38 dholland 54: #
55: # 2. Now it gets gross. Before this meta-package was introduced, the
56: # emacs packages all had PKGNAME set to "emacs". Now the meta-package
57: # is called "emacs" and the emacs packages themselves have the emacs
58: # major version in them. But in order to make updates work properly,
59: # the version of the package called "emacs" cannot go down. We need to
60: # set MY_EMACS_VERSION accordingly. The following were the versions at
61: # the time the renaming was done:
62: # emacs20 20.7nb16
63: # emacs21 21.4anb26
64: # emacs21-nox11 21.4anb13
65: # emacs25+ n/a
66: #
67: # Set VER to the version from the above table, and REV to the
68: # PKGREVISION value.
69: #
1.1 markd 70:
1.38 dholland 71: .if ${MY_EMACS_TYPE} == "emacs20"
72: VER= 20.7
73: REV= 16
74: .elif ${MY_EMACS_TYPE} == "emacs21"
75: VER= 21.4
76: REV= 26
77: .elif ${MY_EMACS_TYPE} == "emacs21nox"
78: VER= 21.4
79: REV= 13
80: .else
81: VER= ${_EMACS_VERSION_MAJOR}
82: REV= 0
83: .endif
1.1 markd 84:
1.38 dholland 85: #
86: # Get the actual version from version.mk.
87: #
1.14 markd 88:
1.38 dholland 89: .include "${EMACS_PKGDIR}/version.mk"
1.24 joerg 90:
1.38 dholland 91: MY_EMACS_VERSION= ${_EMACS_VERSION_MAJOR}.${_EMACS_VERSION_MINOR}
92: .if defined(_EMACS_VERSION_MICRO)
93: MY_EMACS_VERSION:= ${MY_EMACS_VERSION}.${_EMACS_VERSION_MICRO}
94: .endif
1.14 markd 95:
1.38 dholland 96: #
97: # Compute PKGREVISION.
98: #
99: # If we are on the same version as VER, we need PKGREVISION to be at
100: # least REV + 1. Otherwise, it can start at 0.
101: #
102: # Use MYPKGREVISION (defined at the top of this file) to bump the
103: # version if that should become necessary.
104: #
1.1 markd 105:
1.38 dholland 106: .if ${MY_EMACS_VERSION} != ${VER}
107: PKGREVISION= ${MYPKGREVISION}
1.23 hasso 108: .else
1.44 rillig 109: PKGREVISION!= expr 1 + ${REV} + ${MYPKGREVISION}
1.23 hasso 110: .endif
111:
1.38 dholland 112: # This doesn't work; fortunately it appears to be unnecessary.
113: #
114: #.if ${PKGREVISION} == "0"
115: #.unset PKGREVISION
116: #.endif
1.1 markd 117:
1.38 dholland 118: .include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>