/[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.85 Revision 1.86
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.85 2013/08/02 16:48:18 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.86 2013/09/04 19:16:40 ulm Exp $
4# 4#
5# @ECLASS: elisp-common.eclass 5# @ECLASS: elisp-common.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo Emacs team <emacs@gentoo.org> 7# Gentoo Emacs team <emacs@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
21# package (especially compilation), so this is mainly for standalone 21# package (especially compilation), so this is mainly for standalone
22# elisp files you gathered from somewhere else. 22# elisp files you gathered from somewhere else.
23# 23#
24# When relying on the emacs USE flag, you need to add 24# When relying on the emacs USE flag, you need to add
25# 25#
26# @CODE
26# emacs? ( virtual/emacs ) 27# emacs? ( virtual/emacs )
28# @CODE
27# 29#
28# to your DEPEND/RDEPEND line and use the functions provided here to 30# to your DEPEND/RDEPEND line and use the functions provided here to
29# bring the files to the correct locations. 31# bring the files to the correct locations.
30# 32#
31# If your package requires a minimum Emacs version, e.g. Emacs 23, then 33# If your package requires a minimum Emacs version, e.g. Emacs 23, then
33# user can select the Emacs executable with eselect, you should also 35# user can select the Emacs executable with eselect, you should also
34# make sure that the active Emacs version is sufficient. This can be 36# make sure that the active Emacs version is sufficient. This can be
35# tested with function elisp-need-emacs(), which would typically be 37# tested with function elisp-need-emacs(), which would typically be
36# called from pkg_setup(), as in the following example: 38# called from pkg_setup(), as in the following example:
37# 39#
40# @CODE
38# elisp-need-emacs 23 || die "Emacs version too low" 41# elisp-need-emacs 23 || die "Emacs version too low"
42# @CODE
39# 43#
40# Please note that such tests should be limited to packages that are 44# Please note that such tests should be limited to packages that are
41# known to fail with lower Emacs versions; the standard case is to 45# known to fail with lower Emacs versions; the standard case is to
42# depend on virtual/emacs without version. 46# depend on virtual/emacs without version.
43# 47#
48# here and simply takes the source files as arguments. The case of 52# here and simply takes the source files as arguments. The case of
49# interdependent elisp files is also supported, since the current 53# interdependent elisp files is also supported, since the current
50# directory is added to the load-path which makes sure that all files 54# directory is added to the load-path which makes sure that all files
51# are loadable. 55# are loadable.
52# 56#
57# @CODE
53# elisp-compile *.el 58# elisp-compile *.el
59# @CODE
54# 60#
55# Function elisp-make-autoload-file() can be used to generate a file 61# Function elisp-make-autoload-file() can be used to generate a file
56# with autoload definitions for the lisp functions. It takes the output 62# with autoload definitions for the lisp functions. It takes the output
57# file name (default: "${PN}-autoloads.el") and a list of directories 63# file name (default: "${PN}-autoloads.el") and a list of directories
58# (default: working directory) as its arguments. Use of this function 64# (default: working directory) as its arguments. Use of this function
68# of elisp-install(). The following parameters are the files to be put 74# of elisp-install(). The following parameters are the files to be put
69# in that directory. Usually the subdirectory should be ${PN}, you can 75# in that directory. Usually the subdirectory should be ${PN}, you can
70# choose something else, but remember to tell elisp-site-file-install() 76# choose something else, but remember to tell elisp-site-file-install()
71# (see below) the change, as it defaults to ${PN}. 77# (see below) the change, as it defaults to ${PN}.
72# 78#
79# @CODE
73# elisp-install ${PN} *.el *.elc 80# elisp-install ${PN} *.el *.elc
81# @CODE
74# 82#
75# To let the Emacs support be activated by Emacs on startup, you need 83# To let the Emacs support be activated by Emacs on startup, you need
76# to provide a site file (shipped in ${FILESDIR}) which contains the 84# to provide a site file (shipped in ${FILESDIR}) which contains the
77# startup code (have a look in the documentation of your software). 85# startup code (have a look in the documentation of your software).
78# Normally this would look like this: 86# Normally this would look like this:
79# 87#
88# @CODE
80# (add-to-list 'load-path "@SITELISP@") 89# (add-to-list 'load-path "@SITELISP@")
81# (add-to-list 'auto-mode-alist '("\\.csv\\'" . csv-mode)) 90# (add-to-list 'auto-mode-alist '("\\.csv\\'" . csv-mode))
82# (autoload 'csv-mode "csv-mode" "Major mode for csv files." t) 91# (autoload 'csv-mode "csv-mode" "Major mode for csv files." t)
92# @CODE
83# 93#
84# If your Emacs support files are installed in a subdirectory of 94# If your Emacs support files are installed in a subdirectory of
85# /usr/share/emacs/site-lisp/ (which is strongly recommended), you need 95# /usr/share/emacs/site-lisp/ (which is strongly recommended), you need
86# to extend Emacs' load-path as shown in the first non-comment line. 96# to extend Emacs' load-path as shown in the first non-comment line.
87# The elisp-site-file-install() function of this eclass will replace 97# The elisp-site-file-install() function of this eclass will replace
106# divisible by 10 are preferred. 116# divisible by 10 are preferred.
107# 117#
108# Best practice is to define a SITEFILE variable in the global scope of 118# Best practice is to define a SITEFILE variable in the global scope of
109# your ebuild (e.g., right after S or RDEPEND): 119# your ebuild (e.g., right after S or RDEPEND):
110# 120#
121# @CODE
111# SITEFILE="50${PN}-gentoo.el" 122# SITEFILE="50${PN}-gentoo.el"
123# @CODE
112# 124#
113# Which is then installed by 125# Which is then installed by
114# 126#
127# @CODE
115# elisp-site-file-install "${FILESDIR}/${SITEFILE}" 128# elisp-site-file-install "${FILESDIR}/${SITEFILE}"
129# @CODE
116# 130#
117# in src_install(). Any characters after the "-gentoo" part and before 131# in src_install(). Any characters after the "-gentoo" part and before
118# the extension will be stripped from the destination file's name. 132# the extension will be stripped from the destination file's name.
119# For example, a file "50${PN}-gentoo-${PV}.el" will be installed as 133# For example, a file "50${PN}-gentoo-${PV}.el" will be installed as
120# "50${PN}-gentoo.el". If your subdirectory is not named ${PN}, give 134# "50${PN}-gentoo.el". If your subdirectory is not named ${PN}, give
124# pkg_postinst() / pkg_postrm() usage: 138# pkg_postinst() / pkg_postrm() usage:
125# 139#
126# After that you need to recreate the start-up file of Emacs after 140# After that you need to recreate the start-up file of Emacs after
127# emerging and unmerging by using 141# emerging and unmerging by using
128# 142#
143# @CODE
129# pkg_postinst() { 144# pkg_postinst() {
130# elisp-site-regen 145# elisp-site-regen
131# } 146# }
132# 147#
133# pkg_postrm() { 148# pkg_postrm() {
134# elisp-site-regen 149# elisp-site-regen
135# } 150# }
151# @CODE
136# 152#
137# When having optional Emacs support, you should prepend "use emacs &&" 153# When having optional Emacs support, you should prepend "use emacs &&"
138# to above calls of elisp-site-regen(). 154# to above calls of elisp-site-regen().
139# Don't use "has_version virtual/emacs"! When unmerging the state of 155# Don't use "has_version virtual/emacs"! When unmerging the state of
140# the emacs USE flag is taken from the package database and not from the 156# the emacs USE flag is taken from the package database and not from the

Legend:
Removed from v.1.85  
changed lines
  Added in v.1.86

  ViewVC Help
Powered by ViewVC 1.1.20