sys-apps/gawk: stable 5.0.1 for ppc64, bug #725374
[gentoo.git] / dev-lua / luacheck / luacheck-0.20.0.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit toolchain-funcs
6
7 DESCRIPTION="A tool for linting and static analysis of Lua code"
8 HOMEPAGE="https://github.com/mpeterv/luacheck"
9 SRC_URI="https://github.com/mpeterv/luacheck/archive/${PV}.tar.gz -> ${P}.tar.gz"
10
11 LICENSE="MIT"
12 SLOT="0"
13 KEYWORDS="amd64 arm ppc ppc64 x86"
14 IUSE="doc luajit test"
15 RESTRICT="!test? ( test )"
16
17 RDEPEND="
18         dev-lua/luafilesystem[luajit=]
19         !luajit? ( >=dev-lang/lua-5.1:= )
20         luajit? ( dev-lang/luajit:2 )"
21 DEPEND="${RDEPEND}
22         virtual/pkgconfig
23         doc? ( dev-python/sphinx )
24         test? ( dev-lua/busted )"
25
26 DOCS=( CHANGELOG.md README.md )
27
28 src_compile() {
29         if use doc; then
30                 sphinx-build docsrc html || die
31         fi
32 }
33
34 src_test() {
35         busted -o gtest || die
36 }
37
38 src_install() {
39         local instdir
40         instdir="$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua'))"
41         insinto "${instdir#${EPREFIX}}"
42         doins -r src/luacheck
43
44         newbin bin/luacheck.lua luacheck
45
46         use doc && HTML_DOCS+=( html/. )
47
48         einstalldocs
49 }