Gentoo Archives: gentoo-commits

From: "Hans de Graaff (graaff)" <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: xemacs-elisp-common.eclass xemacs-elisp.eclass
Date: Sat, 15 Sep 2007 07:26:56
Message-Id: E1IWRw6-0006SH-7i@stork.gentoo.org
1 graaff 07/09/15 07:19:26
2
3 Added: xemacs-elisp-common.eclass xemacs-elisp.eclass
4 Log:
5 Initial releases of the xemacs elisp eclasses
6
7 Revision Changes Path
8 1.1 eclass/xemacs-elisp-common.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp-common.eclass?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp-common.eclass?rev=1.1&content-type=text/plain
12
13 Index: xemacs-elisp-common.eclass
14 ===================================================================
15 # Copyright 1999-2007 Gentoo Foundation
16 # Distributed under the terms of the GNU General Public License v2
17 # $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp-common.eclass,v 1.1 2007/09/15 07:19:22 graaff Exp $
18 #
19 # Copyright 2007 Hans de Graaff <graaff@g.o>
20 #
21 # Based on elisp-common.eclass:
22 # Copyright 2007 Christian Faulhammer <opfer@g.o>
23 # Copyright 2002-2004 Matthew Kennedy <mkennedy@g.o>
24 # Copyright 2004-2005 Mamoru Komachi <usata@g.o>
25 # Copyright 2003 Jeremy Maitin-Shepard <jbms@×××××.com>
26 # Copyright 2007 Ulrich Mueller <ulm@g.o>
27 #
28 # @ECLASS: xemacs-elisp-common.eclass
29 # @MAINTAINER:
30 # xemacs@g.o
31 # @BLURB: XEmacs-related installation utilities
32 # @DESCRIPTION:
33 #
34 # Usually you want to use this eclass for (optional) XEmacs support of
35 # your package. This is NOT for GNU Emacs!
36 #
37 # Many of the steps here are sometimes done by the build system of your
38 # package (especially compilation), so this is mainly for standalone elisp
39 # files you gathered from somewhere else.
40 #
41 # When relying on the xemacs USE flag, you need to add
42 #
43 # xemacs? ( virtual/xemacs )
44 #
45 # to your DEPEND/RDEPEND line and use the functions provided here to bring
46 # the files to the correct locations.
47 #
48 # .SS
49 # src_compile() usage:
50 #
51 # An elisp file is compiled by the xemacs-elisp-compile() function
52 # defined here and simply takes the source files as arguments.
53 #
54 # xemacs-elisp-compile *.el || die "xemacs-elisp-compile failed"
55 #
56 # Function xemacs-elisp-make-autoload-file() can be used to generate a
57 # file with autoload definitions for the lisp functions. It takes a
58 # list of directories (default: working directory) as its argument.
59 # Use of this function requires that the elisp source files contain
60 # magic ";;;###autoload" comments. See the XEmacs Lisp Reference Manual
61 # (node "Autoload") for a detailed explanation.
62 #
63 # .SS
64 # src_install() usage:
65 #
66 # The resulting compiled files (.elc) should be put in a subdirectory of
67 # /usr/lib/xemacs/site-lisp/ which is named after the first argument
68 # of elisp-install(). The following parameters are the files to be put in
69 # that directory. Usually the subdirectory should be ${PN}, you can choose
70 # something else, but remember to tell elisp-site-file-install() (see below)
71 # the change, as it defaults to ${PN}.
72 #
73 # elisp-install ${PN} *.el *.elc || die "elisp-install failed"
74 #
75
76
77 SITEPACKAGE=/usr/lib/xemacs/site-packages
78 XEMACS=/usr/bin/xemacs
79 XEMACS_BATCH_CLEAN="${XEMACS} --batch --no-site-file --no-init-file"
80
81 # @FUNCTION: xemacs-elisp-compile
82 # @USAGE: <list of elisp files>
83 # @DESCRIPTION:
84 # Byte-compile elisp files with xemacs
85 xemacs-elisp-compile () {
86 ${XEMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
87 xemacs-elisp-make-autoload-file "$@"
88 }
89
90 xemacs-elisp-make-autoload-file () {
91 ${XEMACS_BATCH_CLEAN} \
92 -eval "(setq autoload-package-name \"${PN}\")" \
93 -eval "(setq generated-autoload-file \"${S}/auto-autoloads.el\")" \
94 -l autoload -f batch-update-autoloads "$@"
95 }
96
97 # @FUNCTION: xemacs-elisp-install
98 # @USAGE: <subdirectory> <list of files>
99 # @DESCRIPTION:
100 # Install elisp source and byte-compiled files. All files are installed
101 # in site-packages in their own directory, indicated by the first
102 # argument to the function.
103
104 xemacs-elisp-install () {
105 local subdir="$1"
106 shift
107 ( # use sub-shell to avoid possible environment polution
108 dodir "${SITEPACKAGE}"/lisp/"${subdir}"
109 insinto "${SITEPACKAGE}"/lisp/"${subdir}"
110 doins "$@"
111 ) || die "Installing lisp files failed"
112 }
113
114
115
116 1.1 eclass/xemacs-elisp.eclass
117
118 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp.eclass?rev=1.1&view=markup
119 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp.eclass?rev=1.1&content-type=text/plain
120
121 Index: xemacs-elisp.eclass
122 ===================================================================
123 # Copyright 1999-2007 Gentoo Foundation
124 # Distributed under the terms of the GNU General Public License v2
125 # $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp.eclass,v 1.1 2007/09/15 07:19:22 graaff Exp $
126 #
127 # Copyright 2007 Hans de Graaff <graaff@g.o>
128 #
129 # Based on elisp.eclass:
130 # Copyright 2007 Christian Faulhammer <opfer@g.o>
131 # Copyright 2002-2003 Matthew Kennedy <mkennedy@g.o>
132 # Copyright 2003 Jeremy Maitin-Shepard <jbms@×××××.com>
133 #
134 # @ECLASS: xemacs-elisp.eclass
135 # @MAINTAINER:
136 # xemacs@g.o
137 # @BLURB: Eclass for XEmacs Lisp packages
138 # @DESCRIPTION:
139 #
140 # Emacs support for other than pure elisp packages is handled by
141 # xemacs-elisp-common.eclass where you won't have a dependency on XEmacs
142 # itself. All elisp-* functions are documented there.
143 #
144 # @VARIABLE: SIMPLE_ELISP
145 # @DESCRIPTION:
146 # Setting SIMPLE_ELISP=t in an ebuild means, that the package's source
147 # is a single (in whatever way) compressed elisp file with the file name
148 # ${PN}-${PV}. This eclass will then redefine ${S}, and move
149 # ${PN}-${PV}.el to ${PN}.el in src_unpack().
150
151 inherit xemacs-elisp-common
152
153 if [ "${SIMPLE_ELISP}" = 't' ]; then
154 S="${WORKDIR}/"
155 fi
156
157
158 DEPEND="app-editors/xemacs"
159 IUSE=""
160
161 xemacs-elisp_src_unpack() {
162 unpack ${A}
163 if [ "${SIMPLE_ELISP}" = 't' ]
164 then
165 cd "${S}" && mv ${P}.el ${PN}.el
166 fi
167 }
168
169 xemacs-elisp_src_compile() {
170 xemacs-elisp-compile *.el || die "Compilation of lisp files failed"
171 }
172
173 xemacs-elisp_src_install () {
174 xemacs-elisp-install "${PN}" *.el *.elc
175 }
176
177 EXPORT_FUNCTIONS src_unpack src_compile src_install
178
179
180
181 --
182 gentoo-commits@g.o mailing list