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: Tue, 25 Sep 2007 18:35:38
Message-Id: E1IaF7p-0002DK-CB@stork.gentoo.org
1 graaff 07/09/25 18:27:13
2
3 Modified: xemacs-elisp-common.eclass xemacs-elisp.eclass
4 Log:
5 Add xemacs-elisp-comp to allow compiling of interdependent elisp
6 files, needed for octave ebuild patch. Fix documentation. Die
7 consistently at the same level and document this behavior.
8
9 Revision Changes Path
10 1.2 eclass/xemacs-elisp-common.eclass
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp-common.eclass?rev=1.2&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp-common.eclass?rev=1.2&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp-common.eclass?r1=1.1&r2=1.2
15
16 Index: xemacs-elisp-common.eclass
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp-common.eclass,v
19 retrieving revision 1.1
20 retrieving revision 1.2
21 diff -u -r1.1 -r1.2
22 --- xemacs-elisp-common.eclass 15 Sep 2007 07:19:22 -0000 1.1
23 +++ xemacs-elisp-common.eclass 25 Sep 2007 18:27:12 -0000 1.2
24 @@ -1,6 +1,6 @@
25 # Copyright 1999-2007 Gentoo Foundation
26 # Distributed under the terms of the GNU General Public License v2
27 -# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp-common.eclass,v 1.1 2007/09/15 07:19:22 graaff Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp-common.eclass,v 1.2 2007/09/25 18:27:12 graaff Exp $
29 #
30 # Copyright 2007 Hans de Graaff <graaff@g.o>
31 #
32 @@ -37,7 +37,13 @@
33 # An elisp file is compiled by the xemacs-elisp-compile() function
34 # defined here and simply takes the source files as arguments.
35 #
36 -# xemacs-elisp-compile *.el || die "xemacs-elisp-compile failed"
37 +# xemacs-elisp-compile *.el
38 +#
39 +# In the case of interdependent elisp files, you can use the
40 +# xemacs-elisp-comp() function which makes sure all files are
41 +# loadable.
42 +#
43 +# xemacs-elisp-comp *.el
44 #
45 # Function xemacs-elisp-make-autoload-file() can be used to generate a
46 # file with autoload definitions for the lisp functions. It takes a
47 @@ -49,14 +55,13 @@
48 # .SS
49 # src_install() usage:
50 #
51 -# The resulting compiled files (.elc) should be put in a subdirectory of
52 -# /usr/lib/xemacs/site-lisp/ which is named after the first argument
53 -# of elisp-install(). The following parameters are the files to be put in
54 -# that directory. Usually the subdirectory should be ${PN}, you can choose
55 -# something else, but remember to tell elisp-site-file-install() (see below)
56 -# the change, as it defaults to ${PN}.
57 +# The resulting compiled files (.elc) should be put in a subdirectory
58 +# of /usr/lib/xemacs/site-lisp/ which is named after the first
59 +# argument of xemacs-elisp-install(). The following parameters are
60 +# the files to be put in that directory. Usually the subdirectory
61 +# should be ${PN}, but you can choose something else.
62 #
63 -# elisp-install ${PN} *.el *.elc || die "elisp-install failed"
64 +# xemacs-elisp-install ${PN} *.el *.elc
65 #
66
67
68 @@ -67,10 +72,13 @@
69 # @FUNCTION: xemacs-elisp-compile
70 # @USAGE: <list of elisp files>
71 # @DESCRIPTION:
72 -# Byte-compile elisp files with xemacs
73 +# Byte-compile elisp files with xemacs. This function will die when
74 +# there is a problem compiling the lisp files.
75 xemacs-elisp-compile () {
76 - ${XEMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
77 - xemacs-elisp-make-autoload-file "$@"
78 + {
79 + ${XEMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
80 + xemacs-elisp-make-autoload-file "$@"
81 + } || die "Compile lisp files failed"
82 }
83
84 xemacs-elisp-make-autoload-file () {
85 @@ -85,7 +93,8 @@
86 # @DESCRIPTION:
87 # Install elisp source and byte-compiled files. All files are installed
88 # in site-packages in their own directory, indicated by the first
89 -# argument to the function.
90 +# argument to the function. This function will die if there is a problem
91 +# installing the list files.
92
93 xemacs-elisp-install () {
94 local subdir="$1"
95 @@ -96,3 +105,42 @@
96 doins "$@"
97 ) || die "Installing lisp files failed"
98 }
99 +
100 +# @FUNCTION: xemacs-elisp-comp
101 +# @USAGE: <list of elisp files>
102 +# @DESCRIPTION:
103 +# Byte-compile interdependent XEmacs lisp files.
104 +# Originally taken from GNU autotools, but some configuration options
105 +# removed as they don't make sense with the current status of XEmacs
106 +# in Gentoo.
107 +
108 +xemacs-elisp-comp() {
109 + # Copyright 1995 Free Software Foundation, Inc.
110 + # François Pinard <pinard@×××××××××××××.ca>, 1995.
111 + # This script byte-compiles all `.el' files which are part of its
112 + # arguments, using XEmacs, and put the resulting `.elc' files into
113 + # the current directory, so disregarding the original directories used
114 + # in `.el' arguments.
115 + #
116 + # This script manages in such a way that all XEmacs LISP files to
117 + # be compiled are made visible between themselves, in the event
118 + # they require or load-library one another.
119 +
120 + test $# -gt 0 || return 1
121 +
122 + einfo "Compiling XEmacs Elisp files ..."
123 +
124 + tempdir=elc.$$
125 + mkdir ${tempdir}
126 + cp "$@" ${tempdir}
127 + pushd ${tempdir}
128 +
129 + echo "(add-to-list 'load-path \"../\")" > script
130 + ${XEMACS_BATCH_CLEAN} -l script -f batch-byte-compile *.el
131 + local ret=$?
132 + mv *.elc ..
133 +
134 + popd
135 + rm -fr ${tempdir}
136 + return ${ret}
137 +}
138
139
140
141 1.2 eclass/xemacs-elisp.eclass
142
143 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp.eclass?rev=1.2&view=markup
144 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp.eclass?rev=1.2&content-type=text/plain
145 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/xemacs-elisp.eclass?r1=1.1&r2=1.2
146
147 Index: xemacs-elisp.eclass
148 ===================================================================
149 RCS file: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp.eclass,v
150 retrieving revision 1.1
151 retrieving revision 1.2
152 diff -u -r1.1 -r1.2
153 --- xemacs-elisp.eclass 15 Sep 2007 07:19:22 -0000 1.1
154 +++ xemacs-elisp.eclass 25 Sep 2007 18:27:12 -0000 1.2
155 @@ -1,6 +1,6 @@
156 # Copyright 1999-2007 Gentoo Foundation
157 # Distributed under the terms of the GNU General Public License v2
158 -# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp.eclass,v 1.1 2007/09/15 07:19:22 graaff Exp $
159 +# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp.eclass,v 1.2 2007/09/25 18:27:12 graaff Exp $
160 #
161 # Copyright 2007 Hans de Graaff <graaff@g.o>
162 #
163 @@ -45,7 +45,7 @@
164 }
165
166 xemacs-elisp_src_compile() {
167 - xemacs-elisp-compile *.el || die "Compilation of lisp files failed"
168 + xemacs-elisp-compile *.el
169 }
170
171 xemacs-elisp_src_install () {
172
173
174
175 --
176 gentoo-commits@g.o mailing list