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

Diff of /eclass/elisp.eclass

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

Revision 1.1 Revision 1.18
1# Copyright 1999-2002 Gentoo Technologies, Inc. 1# Copyright 1999-2007 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# Author Matthew Kennedy <mkennedy@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.1 2002/10/29 04:40:18 mkennedy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.18 2007/04/16 15:41:02 opfer Exp $
4#
5# Copyright 2007 Christian Faulhammer <opfer@gentoo.org>
6# Copyright 2002-2007 Matthew Kennedy <mkennedy@gentoo.org>
7# Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
8#
9# This eclass sets the site-lisp directory for emacs-related packages.
10#
11# Emacs support for other than pure elisp packages is handled by
12# elisp-common.eclass where you won't have a dependency on Emacs
13# itself. All elisp-* functions are documented there.
14#
15# Setting SIMPLE_ELISP=t in an ebuild means, that the package's source
16# is a single (in whatever way) compressed elisp file with the file name
17# ${PN}-${PV}. The consequences:
18#
19# 1.) ${S} is redefined
20# 2.) ${PN}-${PV}.el is moved to ${PN} in the system.
21#
5 22
6# This eclass sets the site-lisp directory for emacs-related packages. 23inherit elisp-common
7 24
8ECLASS=elisp 25# SRC_URI should be set to wherever the primary app-emacs/ maintainer
9INHERITED="$INHERITED $ECLASS" 26# keeps the local elisp mirror, since most app-emacs packages are
27# upstream as a single .el file.
10 28
11SITELISP=/usr/share/emacs/site-lisp 29if [ "${SIMPLE_ELISP}" = 't' ]; then
30 S="${WORKDIR}/"
31fi
12 32
13elisp-install() { 33DEPEND="virtual/emacs"
14 local subdir=$1 34IUSE=""
15 dodir ${SITELISP}/${subdir} 35
16 insinto ${SITELISP}/${subdir} 36elisp_src_unpack() {
17 shift 37 unpack ${A}
18 doins $@ 38 if [ "${SIMPLE_ELISP}" = 't' ]
39 then
40 cd "${S}" && mv ${P}.el ${PN}.el
41 fi
19} 42}
20 43
21elisp-site-file-install() { 44elisp_src_compile() {
22 local sitefile=$1 45 elisp-compile *.el || die
23 pushd ${S}
24 cp ${sitefile} .
25 D=${S}/ dosed "s:@SITELISP@:${SITELISP}/${PN}:g" $(basename ${sitefile})
26 insinto ${SITELISP}
27 doins ${S}/$(basename ${sitefile})
28 popd
29} 46}
30 47
31elisp-site-regen() { 48elisp_src_install() {
32 einfo "Regenerating ${SITELISP}/site-start.el..." 49 elisp-install ${PN} *.el *.elc
33 einfo "" 50 elisp-site-file-install "${FILESDIR}/${SITEFILE}"
34 cat <<EOF >${SITELISP}/site-start.el 51}
35;;; DO NOT EDIT THIS FILE -- IT IS GENERATED AUTOMATICALLY BY PORTAGE
36;;; -----------------------------------------------------------------
37 52
38EOF 53elisp_pkg_postinst() {
39 ls ${SITELISP}/[0-9][0-9]* |sort -n | \ 54 elisp-site-regen
40 while read sf
41 do
42 einfo " Addding $sf..."
43 # Great for debugging, too noisy and slow for users though
44# echo "(message \"Loading $sf...\")" >>${SITELISP}/site-start.el
45 cat $sf >>${SITELISP}/site-start.el
46 done
47 einfo ""
48} 55}
56
57elisp_pkg_postrm() {
58 elisp-site-regen
59}
60
61EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm

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

  ViewVC Help
Powered by ViewVC 1.1.20