/[gentoo-x86]/eclass/elisp-common.eclass
Gentoo

Contents of /eclass/elisp-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download)
Wed Jul 6 20:20:03 2005 UTC (9 years, 1 month ago) by agriffis
Branch: MAIN
Changes since 1.10: +1 -2 lines
Remove ECLASS= and INHERITED= which haven't been necessary for a long time now

1 vapier 1.7 # Copyright 1999-2004 Gentoo Foundation
2 mkennedy 1.1 # Distributed under the terms of the GNU General Public License v2
3 agriffis 1.11 # $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.10 2005/05/03 09:20:13 usata Exp $
4 mkennedy 1.1 #
5 mkennedy 1.2 # Copyright 2002-2003 Matthew Kennedy <mkennedy@gentoo.org>
6     # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
7 mkennedy 1.1 #
8     # This is not an eclass, but it does provide emacs-related
9     # installation utilities.
10    
11     INHERITED="$INHERITED $ECLASS"
12    
13     SITELISP=/usr/share/emacs/site-lisp
14    
15 mkennedy 1.2 elisp-compile() {
16     /usr/bin/emacs --batch -f batch-byte-compile --no-site-file --no-init-file $*
17     }
18    
19 mkennedy 1.1 elisp-install() {
20     local subdir=$1
21     dodir ${SITELISP}/${subdir}
22     insinto ${SITELISP}/${subdir}
23     shift
24     doins $@
25     }
26    
27     elisp-site-file-install() {
28 usata 1.6 local sitefile=$1 my_pn=${2:-${PN}}
29 mkennedy 1.1 pushd ${S}
30 usata 1.6 cp ${sitefile} ${T}
31     sed -i "s:@SITELISP@:${SITELISP}/${my_pn}:g" ${T}/$(basename ${sitefile})
32 mkennedy 1.1 insinto ${SITELISP}
33 usata 1.10 doins ${T}/$(basename ${sitefile}) || die "failed to install site file"
34 mkennedy 1.1 popd
35     }
36    
37     elisp-site-regen() {
38 vapier 1.9 einfo "Regenerating ${SITELISP}/site-gentoo.el ..."
39 mkennedy 1.1 einfo ""
40 jbms 1.4 cat <<EOF >${SITELISP}/site-gentoo.el
41 mkennedy 1.1 ;;; DO NOT EDIT THIS FILE -- IT IS GENERATED AUTOMATICALLY BY PORTAGE
42     ;;; -----------------------------------------------------------------
43    
44     EOF
45 mkennedy 1.5 ls ${SITELISP}/[0-9][0-9]*-gentoo.el |sort -n | \
46     while read sf
47 mkennedy 1.1 do
48 vapier 1.9 einfo " Adding $(basename $sf) ..."
49 mkennedy 1.1 # Great for debugging, too noisy and slow for users though
50 vapier 1.9 # echo "(message \"Loading $sf ...\")" >>${SITELISP}/site-start.el
51 jbms 1.4 cat $sf >>${SITELISP}/site-gentoo.el
52 mkennedy 1.1 done
53 jbms 1.4 while read line; do einfo "${line}"; done <<EOF
54    
55     All site initialization for Gentoo-installed packages is now added to
56     /usr/share/emacs/site-lisp/site-gentoo.el; site-start.el is no longer
57 usata 1.8 managed by Gentoo. You are responsible for all maintenance of
58     site-start.el if there is such a file.
59 jbms 1.4
60     In order for this site initialization to be loaded for all users
61     automatically, as was done previously, you can add a line like this:
62    
63 mkennedy 1.5 (load "/usr/share/emacs/site-lisp/site-gentoo")
64 jbms 1.4
65     to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line
66     can be added by individual users to their initialization files, or for
67     greater flexibility, users can select which of the package-specific
68     initialization files in /usr/share/emacs/site-lisp to load.
69     EOF
70     echo
71 mkennedy 1.3 }
72    
73     # The following Emacs Lisp compilation routine is taken from GNU
74     # autotools.
75    
76     elisp-comp() {
77     # Copyright 1995 Free Software Foundation, Inc.
78     # François Pinard <pinard@iro.umontreal.ca>, 1995.
79     #
80     # This program is free software; you can redistribute it and/or modify
81     # it under the terms of the GNU General Public License as published by
82     # the Free Software Foundation; either version 2, or (at your option)
83     # any later version.
84     #
85     # This program is distributed in the hope that it will be useful,
86     # but WITHOUT ANY WARRANTY; without even the implied warranty of
87 mkennedy 1.5 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88 mkennedy 1.3 # GNU General Public License for more details.
89     #
90     # You should have received a copy of the GNU General Public License
91     # along with this program; if not, write to the Free Software
92     # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
93    
94     # As a special exception to the GNU General Public License, if you
95     # distribute this file as part of a program that contains a
96     # configuration script generated by Autoconf, you may include it under
97     # the same distribution terms that you use for the rest of that program.
98    
99     # This script byte-compiles all `.el' files which are part of its
100     # arguments, using GNU Emacs, and put the resulting `.elc' files into
101     # the current directory, so disregarding the original directories used
102     # in `.el' arguments.
103     #
104     # This script manages in such a way that all Emacs LISP files to
105     # be compiled are made visible between themselves, in the event
106     # they require or load-library one another.
107    
108     if test $# = 0; then
109     echo 1>&2 "No files given to $0"
110     exit 1
111     else
112     if test -z "$EMACS" || test "$EMACS" = "t"; then
113 jbms 1.4 # Value of "t" means we are running in a shell under Emacs.
114     # Just assume Emacs is called "emacs".
115 mkennedy 1.3 EMACS=emacs
116     fi
117    
118     tempdir=elc.$$
119     mkdir $tempdir
120     cp $* $tempdir
121     cd $tempdir
122    
123     echo "(add-to-list 'load-path \"../\")" > script
124     $EMACS -batch -q --no-site-file --no-init-file -l script -f batch-byte-compile *.el
125     mv *.elc ..
126    
127     cd ..
128     rm -fr $tempdir
129     fi
130 mkennedy 1.1 }
131    
132     # Local Variables: ***
133     # mode: shell-script ***
134     # tab-width: 4 ***
135     # indent-tabs-mode: t ***
136     # End: ***

  ViewVC Help
Powered by ViewVC 1.1.20