blob: 3bd41f6cd2cff03feb1d3bc6c4408fa6832ee082 (
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517="setuptools"
PYTHON_COMPAT=( python3_{13..14} )
inherit elisp-common distutils-r1
DESCRIPTION="Toolkit for literate programming in Coq/Rocq"
HOMEPAGE="https://github.com/cpitclaudel/alectryon/"
if [[ "${PV}" == *9999* ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/cpitclaudel/${PN}"
else
SRC_URI="https://github.com/cpitclaudel/${PN}/archive/v${PV}.tar.gz
-> ${P}.gh.tar.gz"
KEYWORDS="~amd64"
fi
LICENSE="MIT"
SLOT="0"
IUSE="doc emacs"
RDEPEND="
>=dev-python/beautifulsoup4-4.11.2[${PYTHON_USEDEP}]
>=dev-python/docutils-0.19[${PYTHON_USEDEP}]
>=dev-python/dominate-2.7.0[${PYTHON_USEDEP}]
>=dev-python/myst-parser-1.0.0[${PYTHON_USEDEP}]
>=dev-python/pygments-2.14.0[${PYTHON_USEDEP}]
>=dev-python/sphinx-6.1.3[${PYTHON_USEDEP}]
"
BDEPEND="
${RDEPEND}
doc? (
dev-tex/latexmk
dev-texlive/texlive-fontsrecommended
dev-texlive/texlive-latexextra
dev-texlive/texlive-luatex
dev-texlive/texlive-xetex
media-fonts/fira-code
media-fonts/libertine
)
emacs? (
>=app-emacs/flycheck-31
app-emacs/proofgeneral
)
"
DOCS=( CHANGES.rst CITATION.bib README.rst )
SITEFILE="50${PN}-gentoo.el"
src_prepare() {
# This apparently cleans latex run clutter. We do not need it.
sed -e "s|texfot --tee=/dev/null --no-stderr||g" \
-i ./recipes/Makefile ./recipes/sphinx/Makefile \
|| die
# Needs unpackaged binaries.
sed -e "s|test_validation|__test_validation|g" \
-i ./recipes/tests/unit.py \
|| die
distutils-r1_src_prepare
}
src_compile() {
distutils-r1_src_compile
if use emacs ; then
elisp-compile ./etc/elisp/alectryon.el
fi
if use doc ; then
emake -C ./recipes/sphinx TEXFOT="" latexpdf
fi
}
python_test() {
"${EPYTHON}" -m unittest -v ./recipes/tests/unit.py \
|| die "Tests failed with ${EPYTHON}"
}
src_install() {
distutils-r1_src_install
einstalldocs
if use emacs ; then
elisp-install "${PN}" ./etc/elisp/${PN}.el{,c}
elisp-site-file-install "${FILESDIR}/${SITEFILE}"
fi
if use doc ; then
docinto html
dodoc ./recipes/sphinx/_build/html/*
docinto pdf
dodoc ./recipes/sphinx/_build/latex/alectryon-demo.pdf
docinto latex
dodoc ./recipes/sphinx/_build/latex/alectryon-demo.tex
fi
}
pkg_postinst() {
use emacs && elisp-site-regen
}
pkg_postrm() {
use emacs && elisp-site-regen
}
|