| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 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.eclass,v 1.39 2009/03/26 14:14:22 ulm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.40 2009/03/29 19:49:45 ulm Exp $ |
| 4 | # |
4 | # |
| 5 | # Copyright 2002-2003 Matthew Kennedy <mkennedy@gentoo.org> |
5 | # Copyright 2002-2003 Matthew Kennedy <mkennedy@gentoo.org> |
| 6 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
6 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
| 7 | # Copyright 2007-2009 Christian Faulhammer <fauli@gentoo.org> |
7 | # Copyright 2007-2009 Christian Faulhammer <fauli@gentoo.org> |
| 8 | # Copyright 2007-2009 Ulrich Müller <ulm@gentoo.org> |
8 | # Copyright 2007-2009 Ulrich Müller <ulm@gentoo.org> |
| … | |
… | |
| 36 | # @ECLASS-VARIABLE: DOCS |
36 | # @ECLASS-VARIABLE: DOCS |
| 37 | # @DESCRIPTION: |
37 | # @DESCRIPTION: |
| 38 | # DOCS="blah.txt ChangeLog" is automatically used to install the given |
38 | # DOCS="blah.txt ChangeLog" is automatically used to install the given |
| 39 | # files by dodoc in src_install(). |
39 | # files by dodoc in src_install(). |
| 40 | |
40 | |
|
|
41 | # @ECLASS-VARIABLE: ELISP_PATCHES |
|
|
42 | # @DESCRIPTION: |
|
|
43 | # Any patches to apply after unpacking the sources. Patches are searched |
|
|
44 | # both in ${PWD} and ${FILESDIR}. |
|
|
45 | |
| 41 | # @ECLASS-VARIABLE: SITEFILE |
46 | # @ECLASS-VARIABLE: SITEFILE |
| 42 | # @DESCRIPTION: |
47 | # @DESCRIPTION: |
| 43 | # Name of package's site-init file. The filename must match the shell |
48 | # Name of package's site-init file. The filename must match the shell |
| 44 | # pattern "[1-8][0-9]*-gentoo.el"; numbers below 10 and above 89 are |
49 | # pattern "[1-8][0-9]*-gentoo.el"; numbers below 10 and above 89 are |
| 45 | # reserved for internal use. "50${PN}-gentoo.el" is a reasonable choice |
50 | # reserved for internal use. "50${PN}-gentoo.el" is a reasonable choice |
| 46 | # in most cases. |
51 | # in most cases. |
| 47 | |
52 | |
| 48 | inherit elisp-common versionator |
53 | inherit elisp-common eutils versionator |
| 49 | |
54 | |
| 50 | EXPORT_FUNCTIONS \ |
55 | case "${EAPI:-0}" in |
| 51 | src_unpack src_compile src_install \ |
56 | 0|1) EXPORT_FUNCTIONS src_{unpack,compile,install} \ |
| 52 | pkg_setup pkg_postinst pkg_postrm |
57 | pkg_{setup,postinst,postrm} ;; |
|
|
58 | *) EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ |
|
|
59 | pkg_{setup,postinst,postrm} ;; |
|
|
60 | esac |
| 53 | |
61 | |
| 54 | DEPEND=">=virtual/emacs-${NEED_EMACS:-21}" |
62 | DEPEND=">=virtual/emacs-${NEED_EMACS:-21}" |
| 55 | RDEPEND=">=virtual/emacs-${NEED_EMACS:-21}" |
63 | RDEPEND="${DEPEND}" |
| 56 | IUSE="" |
64 | IUSE="" |
| 57 | |
65 | |
| 58 | elisp_pkg_setup() { |
66 | elisp_pkg_setup() { |
| 59 | local need_emacs=${NEED_EMACS:-21} |
67 | local need_emacs=${NEED_EMACS:-21} |
| 60 | local have_emacs=$(elisp-emacs-version) |
68 | local have_emacs=$(elisp-emacs-version) |
| … | |
… | |
| 71 | if [ -f ${P}.el ]; then |
79 | if [ -f ${P}.el ]; then |
| 72 | # the "simple elisp" case with a single *.el file in WORKDIR |
80 | # the "simple elisp" case with a single *.el file in WORKDIR |
| 73 | mv ${P}.el ${PN}.el || die |
81 | mv ${P}.el ${PN}.el || die |
| 74 | [ -d "${S}" ] || S=${WORKDIR} |
82 | [ -d "${S}" ] || S=${WORKDIR} |
| 75 | fi |
83 | fi |
|
|
84 | |
|
|
85 | case "${EAPI:-0}" in |
|
|
86 | 0|1) elisp_src_prepare ;; |
|
|
87 | esac |
| 76 | } |
88 | } |
|
|
89 | |
|
|
90 | elisp_src_prepare() { |
|
|
91 | local patch |
|
|
92 | for patch in ${ELISP_PATCHES}; do |
|
|
93 | if [ -f "${patch}" ]; then |
|
|
94 | epatch "${patch}" |
|
|
95 | elif [ -f "${FILESDIR}/${patch}" ]; then |
|
|
96 | epatch "${FILESDIR}/${patch}" |
|
|
97 | else |
|
|
98 | die "Cannot find ${patch}" |
|
|
99 | fi |
|
|
100 | done |
|
|
101 | } |
|
|
102 | |
|
|
103 | elisp_src_configure() { :; } |
| 77 | |
104 | |
| 78 | elisp_src_compile() { |
105 | elisp_src_compile() { |
| 79 | elisp-compile *.el || die |
106 | elisp-compile *.el || die |
| 80 | } |
107 | } |
| 81 | |
108 | |