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

Contents of /eclass/xemacs-elisp-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sat Sep 15 07:19:22 2007 UTC (6 years, 7 months ago) by graaff
Branch: MAIN
Initial releases of the xemacs elisp eclasses

1 graaff 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.20 2007/04/29 12:59:39 ulm Exp $
4     #
5     # Copyright 2007 Hans de Graaff <graaff@gentoo.org>
6     #
7     # Based on elisp-common.eclass:
8     # Copyright 2007 Christian Faulhammer <opfer@gentoo.org>
9     # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org>
10     # Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org>
11     # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com>
12     # Copyright 2007 Ulrich Mueller <ulm@gentoo.org>
13     #
14     # @ECLASS: xemacs-elisp-common.eclass
15     # @MAINTAINER:
16     # xemacs@gentoo.org
17     # @BLURB: XEmacs-related installation utilities
18     # @DESCRIPTION:
19     #
20     # Usually you want to use this eclass for (optional) XEmacs support of
21     # your package. This is NOT for GNU Emacs!
22     #
23     # Many of the steps here are sometimes done by the build system of your
24     # package (especially compilation), so this is mainly for standalone elisp
25     # files you gathered from somewhere else.
26     #
27     # When relying on the xemacs USE flag, you need to add
28     #
29     # xemacs? ( virtual/xemacs )
30     #
31     # to your DEPEND/RDEPEND line and use the functions provided here to bring
32     # the files to the correct locations.
33     #
34     # .SS
35     # src_compile() usage:
36     #
37     # An elisp file is compiled by the xemacs-elisp-compile() function
38     # defined here and simply takes the source files as arguments.
39     #
40     # xemacs-elisp-compile *.el || die "xemacs-elisp-compile failed"
41     #
42     # Function xemacs-elisp-make-autoload-file() can be used to generate a
43     # file with autoload definitions for the lisp functions. It takes a
44     # list of directories (default: working directory) as its argument.
45     # Use of this function requires that the elisp source files contain
46     # magic ";;;###autoload" comments. See the XEmacs Lisp Reference Manual
47     # (node "Autoload") for a detailed explanation.
48     #
49     # .SS
50     # src_install() usage:
51     #
52     # The resulting compiled files (.elc) should be put in a subdirectory of
53     # /usr/lib/xemacs/site-lisp/ which is named after the first argument
54     # of elisp-install(). The following parameters are the files to be put in
55     # that directory. Usually the subdirectory should be ${PN}, you can choose
56     # something else, but remember to tell elisp-site-file-install() (see below)
57     # the change, as it defaults to ${PN}.
58     #
59     # elisp-install ${PN} *.el *.elc || die "elisp-install failed"
60     #
61    
62    
63     SITEPACKAGE=/usr/lib/xemacs/site-packages
64     XEMACS=/usr/bin/xemacs
65     XEMACS_BATCH_CLEAN="${XEMACS} --batch --no-site-file --no-init-file"
66    
67     # @FUNCTION: xemacs-elisp-compile
68     # @USAGE: <list of elisp files>
69     # @DESCRIPTION:
70     # Byte-compile elisp files with xemacs
71     xemacs-elisp-compile () {
72     ${XEMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
73     xemacs-elisp-make-autoload-file "$@"
74     }
75    
76     xemacs-elisp-make-autoload-file () {
77     ${XEMACS_BATCH_CLEAN} \
78     -eval "(setq autoload-package-name \"${PN}\")" \
79     -eval "(setq generated-autoload-file \"${S}/auto-autoloads.el\")" \
80     -l autoload -f batch-update-autoloads "$@"
81     }
82    
83     # @FUNCTION: xemacs-elisp-install
84     # @USAGE: <subdirectory> <list of files>
85     # @DESCRIPTION:
86     # Install elisp source and byte-compiled files. All files are installed
87     # in site-packages in their own directory, indicated by the first
88     # argument to the function.
89    
90     xemacs-elisp-install () {
91     local subdir="$1"
92     shift
93     ( # use sub-shell to avoid possible environment polution
94     dodir "${SITEPACKAGE}"/lisp/"${subdir}"
95     insinto "${SITEPACKAGE}"/lisp/"${subdir}"
96     doins "$@"
97     ) || die "Installing lisp files failed"
98     }

  ViewVC Help
Powered by ViewVC 1.1.20