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

Diff of /eclass/elisp-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.1.1

  ViewVC Help
Powered by ViewVC 1.1.20