summaryrefslogtreecommitdiff
path: root/app-emacs/treemacs/treemacs-2.9.ebuild
blob: 5031b4c97f9eeade429878a5f7a50077193f5278 (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
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

NEED_EMACS="26.1"

PYTHON_COMPAT=( python3_9 )

inherit elisp python-single-r1

DESCRIPTION="A tree layout file explorer for Emacs"
HOMEPAGE="https://github.com/Alexander-Miller/treemacs"
SRC_URI="https://github.com/Alexander-Miller/treemacs/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="evil magit icons-dired"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
# TODO: extra flags that need packages not yet in gentoo
# all-the-icons: app-emacs/all-the-icons
# persp:         app-emacs/persp
# perspective:   app-emacs/perspective
# projectile:    app-emacs/projectile

RDEPEND="${PYTHON_DEPS}
	>=app-emacs/ace-window-0.10.0_p20200706
	>=app-emacs/ht-2.3
	>=app-emacs/hydra-0.15.0
	>=app-emacs/pfuture-1.9
	>=app-emacs/cfrs-1.3.2
	evil? ( app-emacs/evil )
	magit? ( app-emacs/magit )"
DEPEND="${RDEPEND}"

RESTRICT="test" # test requires cask and buttercup.el which is not packaged
SITEFILE="50treemacs-gentoo.el"
DOCS=( README.org Changelog.org Extensions.org )

src_unpack() {
	elisp_src_unpack
	mv "${S}"/src/{elisp,scripts}/* "${S}/" || die

	if use evil; then
		mv "${S}/src/extra/treemacs-evil.el" "${S}/" || die
	fi

	if use magit; then
		mv "${S}/src/extra/treemacs-magit.el" "${S}/" || die
	fi

	if use icons-dired; then
		mv "${S}/src/extra/treemacs-icons-dired.el" "${S}/" || die
	fi
}

src_compile() {
	elisp-make-autoload-file "${S}/${PN}-autoload.el" "${S}/"
	elisp_src_compile
}

src_install() {
	elisp_src_install

	dodir "/usr/share/${PN}/"
	dodir "/usr/share/${PN}/icons"
	insinto "/usr/share/${PN}/icons/"
	doins -r "${S}/icons/default"
	dosym \
		"${EPREFIX}/usr/share/${PN}/icons" \
		"${EPREFIX}/${SITELISP}/${PN}/icons"
	insinto "${SITELISP}/${PN}/"
	doins "${S}"/*.py
}