# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # automatically generated by g-elpa # please do not edit this file # # Original Author: Jauhien Piatlicki # Purpose: support installation of elisp packages for emacs # from overlays generated by g-elpa # # Bugs to piatlicki@gmail.com # # @ECLASS: g-elpa.eclass # # @ECLASS-VARIABLE: REPO_URI # @DESCRIPTION: address of a repository of elisp packages # # @ECLASS-VARIABLE: SOURCE_TYPE # @DESCRIPTION: type of a package (single or tar) # # @ECLASS-VARIABLE: DIGEST_SOURCES # @DESCRIPTION: whether manifest for sources exists # # @ECLASS-VARIABLE: REALNAME # @DESCRIPTION: real name of a package in the repository # # @ECLASS-VARIABLE: GELPA_STORE_DIR # @DESCRIPTION: store location for downloaded sources GELPA_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}" # # @ECLASS-VARIABLE: GELPA_FETCH_CMD # @DESCRIPTION: fetch command GELPA_FETCH_CMD="wget" inherit elisp EXPORT_FUNCTIONS src_{unpack,compile,install} if [[ ${SOURCE_TYPE} != "single" ]]; then SUFFIX="${SOURCE_TYPE}" else SUFFIX="el" fi g-elpa_fetch() { addwrite "${GELPA_STORE_DIR}" pushd "${GELPA_STORE_DIR}" >/dev/null || die "can't chdir to ${GELPA_STORE_DIR}" local SOURCEFILE=${REALNAME}-${PV}.${SUFFIX} if [[ ! -f "${SOURCEFILE}" ]]; then $GELPA_FETCH_CMD ${REPO_URI}${SOURCEFILE} || die fi cp ${SOURCEFILE} ${DISTDIR}/${P}.${SUFFIX} || die popd >/dev/null || die } g-elpa_src_unpack() { if [[ x${DIGEST_SOURCES} = x ]]; then g-elpa_fetch fi if [[ ${SOURCE_TYPE} != "single" ]]; then unpack ${P}.${SOURCE_TYPE} else cp ${DISTDIR}/${P}.el . || die fi elisp_src_unpack || die } g-elpa_src_compile() { rm -f ${PN}-pkg.el || die elisp-make-autoload-file || die elisp_src_compile || die } g-elpa_src_install() { local sitefile="50${PN}-gentoo.el" cat <> ${sitefile} || die (add-to-list 'load-path "@SITELISP@") (load "${PN}-autoloads" nil t) EOF elisp-site-file-install ${sitefile} || die rm -f ${sitefile} || die elisp_src_install || die }