summaryrefslogtreecommitdiff
blob: 6e6c60f22d9fadd59c380ffac0f79c8b0a3cba8a (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
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit elisp-common toolchain-funcs

DESCRIPTION="An object prototype based language"
HOMEPAGE="http://isaacproject.u-strasbg.fr/li.html"
SRC_URI="http://isaacproject.u-strasbg.fr/download/${P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="vim-syntax emacs examples"

DEPEND="vim-syntax? ( app-editors/vim )
	emacs? ( >=app-editors/emacs-23.1:* )"

RDEPEND="${DEPEND}"

SITEFILE=50${PN}-gentoo.el

src_prepare() {
	default
	eapply "${FILESDIR}/${P}-makefile.patch"
	rm lib/number/essai || die
}

src_compile() {
	emake CC="$(tc-getCC)"

	use emacs elisp-compile editor/emacs/lisaac-mode.el
}

src_install() {
	emake DESTDIR="${D}" DOC="/usr/share/doc/${PF}" install

	gzip -d "${D}"/usr/share/man/man1/{lisaac,shorter}.1.gz || die

	if use vim-syntax; then
		insinto /usr/share/vim/vimfiles/syntax/
		doins editor/vim/syntax/lisaac.vim
		insinto /usr/share/vim/vimfiles/indent/
		doins editor/vim/indent/lisaac.vim
	fi

	if use emacs; then
		elisp-install ${PN} editor/emacs/*.{el,elc}
		elisp-site-file-install "${FILESDIR}"/${SITEFILE}
	fi

	if use examples; then
		dodir /usr/share/${PN}
		cp -r example "${ED}"/usr/share/${PN}/examples || die
	fi
}

pkg_postinst() {
	if use vim-syntax; then
		elog "Add the following line to your vimrc if you want"
		elog "to enable the lisaac support :"
		elog
		elog "au BufNewFile,BufRead *.li setf lisaac"
	fi

	use emacs && elisp-site-regen
}

pkg_postrm() {
	use emacs && elisp-site-regen
}