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

Contents of /eclass/elisp-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Nov 3 10:01:22 2003 UTC (11 years ago) by mkennedy
Branch: MAIN
Changes since 1.2: +60 -1 lines
add an alternate compilation function

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

  ViewVC Help
Powered by ViewVC 1.1.20