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