aboutsummaryrefslogtreecommitdiff
blob: d887c27a9eb28742cab442de479fa56dd71e71e8 (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
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# automatically generated by gs-elpa
# please do not edit this file
#
# Original Author: Jauhien Piatlicki <jauhien@gentoo.org>
# Purpose: support installation of elisp packages for emacs
# from overlays generated by gs-elpa
#
# Bugs to jauhien@gentoo.org
#
# @ECLASS: gs-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
#

inherit elisp g-sorcery

EXPORT_FUNCTIONS src_{unpack,compile,install}

if [[ ${SOURCE_TYPE} != "single" ]]; then
	SUFFIX="${SOURCE_TYPE}"
else
	SUFFIX="el"
fi

SOURCEFILE=${REALNAME}-${PV}.${SUFFIX}

gs-elpa_src_unpack() {
	g-sorcery_src_unpack
	if [[ ${SOURCE_TYPE} = "single" ]]; then
		mkdir ${P} || die
		mv ./${SOURCEFILE} ./${P}/${REALNAME}.${SUFFIX} || die
	fi
}

gs-elpa_src_compile() {
	rm -f ${PN}-pkg.el || die
	elisp-make-autoload-file || die
	elisp_src_compile || die
}

gs-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
}