blob: 1b663407316aa246d10a73c1f59044abc1c2ace0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# 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 <piatlicki@gmail.com>
# 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: PKG_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
if [ x${DIGEST_SOURCES} = x]; then
EXPORT_FUNCTIONS src_{unpack,compile,install}
else
EXPORT_FUNCTIONS src_{compile,install}
fi
if [[ ${PKG_TYPE} != "single" ]]; then
SUFFIX="${PKG_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() {
g-elpa_fetch
if [[ ${PKG_TYPE} != "single" ]]; then
unpack ${P}.${PKG_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 <<EOF >> ${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
}
|