summaryrefslogtreecommitdiff
blob: 95d6375dbc5479f517b8ac6dd8cd1b9ea4dbf9dd (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
# Copyright 2021-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit edo elisp

DESCRIPTION="Modern on-the-fly syntax checking extension for GNU Emacs"
HOMEPAGE="https://www.flycheck.org/
	https://github.com/flycheck/flycheck/"

if [[ ${PV} == *9999* ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/${PN}/${PN}.git"
else
	if [[ ${PV} == *_p20230305 ]] ; then
		COMMIT=5f2ef177cb21ae8b73714575802beef04abd0f5e
		SRC_URI="https://github.com/${PN}/${PN}/archive/${COMMIT}.tar.gz
			-> ${P}.tar.gz"
		S="${WORKDIR}"/${PN}-${COMMIT}
	else
		SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz
			-> ${P}.tar.gz"
	fi
	KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~riscv"
fi

LICENSE="GPL-3+"
SLOT="0"
IUSE="test"
# Tests fail for now, need more investigation
RESTRICT="!test? ( test ) test"

RDEPEND="
	>=app-emacs/dash-2.12.1
	>=app-emacs/pkg-info-0.4
"
BDEPEND="
	test? (
		app-emacs/buttercup
		app-emacs/shut-up
	)
"

SITEFILE="50${PN}-gentoo-r1.el"
DOCS=( README.md )

src_compile() {
	elisp_src_compile
	elisp-make-autoload-file
}

src_test() {
	# Flycheck will skip test cases which require a "checker" or emacs package that is not installed.
	edo ${EMACS} \
		${EMACSFLAGS} \
		-L . \
		--load "${S}"/test/flycheck-test.el \
		--load "${S}"/test/run.el \
		-f 'flycheck-run-tests-main'
}

src_install() {
	# Remove unneeded test related files.
	rm flycheck-buttercup.el* flycheck-ert.el* || die
	elisp_src_install
}