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

EAPI=7

inherit autotools

DESCRIPTION="Checks latex source for common mistakes"
HOMEPAGE="http://www.nongnu.org/chktex/"
SRC_URI="http://download.savannah.gnu.org/releases/chktex/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ia64 ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
IUSE="debug doc +pcre test"
RESTRICT="!test? ( test )"
# Tests fail without pcre. Enable pcre by default and make tests depend on it.
REQUIRED_USE="test? ( pcre )"

RDEPEND="pcre? ( dev-libs/libpcre )"

DEPEND="${RDEPEND}
	sys-apps/groff
	dev-texlive/texlive-fontsrecommended
	doc? ( dev-tex/latex2html )"

BDEPEND="virtual/latex-base
	dev-lang/perl:="

PATCHES=( "${FILESDIR}/${PN}-1.7.1-asneeded.patch"
	  "${FILESDIR}/tex-inputenc.patch" )

AT_M4DIR="${S}/m4"

src_configure() {
	export VARTEXFONTS="${T}/fonts" #538672

	local myeconfargs=(
		$(use_enable debug debug-info)
		$(use_enable pcre)
	)
	econf ${myconfargs[@]}
}

src_compile() {
	default
	emake ChkTeX.dvi
	use doc && emake html
}

src_install() {
	default
	if use doc ; then
	      dodoc HTML/ChkTeX.tex
	fi
	dodoc ChkTeX.dvi NEWS
	doman *.1
}