diff options
Diffstat (limited to 'eclass/elisp.eclass')
-rw-r--r-- | eclass/elisp.eclass | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index d763a49..10c16ce 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -9,7 +9,7 @@ # Jeremy Maitin-Shepard <jbms@attbi.com> # Christian Faulhammer <fauli@gentoo.org> # Ulrich Müller <ulm@gentoo.org> -# @SUPPORTED_EAPIS: 6 7 +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: Eclass for Emacs Lisp packages # @DESCRIPTION: # @@ -40,7 +40,7 @@ # Space separated list of patches to apply after unpacking the sources. # Patch files are searched for in the current working dir, WORKDIR, and # FILESDIR. This variable is semi-deprecated, preferably use the -# PATCHES array instead. +# PATCHES array instead if the EAPI supports it. # @ECLASS-VARIABLE: ELISP_REMOVE # @DEFAULT_UNSET @@ -64,6 +64,7 @@ inherit elisp-common case ${EAPI:-0} in + 4|5) inherit epatch ;; 6|7) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -73,7 +74,8 @@ EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ RDEPEND=">=app-editors/emacs-${NEED_EMACS}:*" case ${EAPI} in - 6) DEPEND="${RDEPEND}" ;; + 4) RDEPEND="${RDEPEND%:*}"; DEPEND="${RDEPEND}" ;; + 5|6) DEPEND="${RDEPEND}" ;; *) BDEPEND="${RDEPEND}" ;; esac @@ -117,11 +119,17 @@ elisp_src_prepare() { else die "Cannot find ${patch}" fi - eapply "${file}" + case ${EAPI} in + 4|5) epatch "${file}" ;; + *) eapply "${file}" ;; + esac done - # apply PATCHES and any user patches - default + # apply PATCHES (if supported in EAPI), and any user patches + case ${EAPI} in + 4|5) epatch_user ;; + *) default ;; + esac if [[ -n ${ELISP_REMOVE} ]]; then rm ${ELISP_REMOVE} || die @@ -165,7 +173,10 @@ elisp_src_install() { doinfo ${@/%.*/.info*} fi # install documentation only when explicitly requested - [[ $(declare -p DOCS 2>/dev/null) == *=* ]] && einstalldocs + case ${EAPI} in + 4|5) [[ -n ${DOCS} ]] && dodoc ${DOCS} ;; + *) [[ $(declare -p DOCS 2>/dev/null) == *=* ]] && einstalldocs ;; + esac if declare -f readme.gentoo_create_doc >/dev/null; then readme.gentoo_create_doc fi |