summaryrefslogtreecommitdiff
path: root/sci-mathematics/coq-serapi/coq-serapi-0.18.1.ebuild
blob: c98dfba0d2968953facf17a69ea92b9d3863db9f (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-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

COQ_MIN_V=8.18.0
COQ_MAX_V=8.19.0

inherit elisp-common dune

DESCRIPTION="Serialization library and protocol for interaction with the Coq proof assistant"
HOMEPAGE="https://github.com/ejgallego/coq-serapi/"

# The tarball in SRC_URI is comprised of <supported coq>+<package version>
SRC_URI="https://github.com/ejgallego/${PN}/archive/${COQ_MIN_V}+${PV}.tar.gz
	-> ${P}.tar.gz"
S="${WORKDIR}/${PN}-${COQ_MIN_V}-${PV}"

LICENSE="GPL-3+"
SLOT="0/${PV}"
KEYWORDS="~amd64"
IUSE="emacs +ocamlopt test"
RESTRICT="!test? ( test )"

RDEPEND="
	>=sci-mathematics/coq-${COQ_MIN_V}:= <sci-mathematics/coq-${COQ_MAX_V}:=
	>=dev-ml/ppx_sexp_conv-0.13.0:=
	dev-ml/cmdliner:=
	dev-ml/ppx_compare:=
	dev-ml/ppx_deriving:=
	dev-ml/ppx_deriving_yojson:=
	dev-ml/ppx_hash:=
	dev-ml/ppx_import:=
	dev-ml/sexplib:=
	dev-ml/yojson:=
"
DEPEND="
	${RDEPEND}
"
BDEPEND="
	emacs? ( >=app-editors/emacs-23.1:* )
	test? ( sci-mathematics/coq-mathcomp )
"

SITEFILE="50sertop-gentoo.el"

PATCHES=( "${FILESDIR}/${PN}-sertop.el-path.patch" )

src_compile() {
	dune_src_compile

	use emacs && elisp-compile sertop.el
}

src_install() {
	dune_src_install

	rm -r "${ED}/usr/share/emacs" || die

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

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

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