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

EAPI=0

inherit latex-package toolchain-funcs eutils

DESCRIPTION="A pretty printer for various programming languages with tex output."
SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${P}.tgz"

LICENSE="BSD LGrind-Jacobson"
SLOT="0"
KEYWORDS="amd64 ppc ~sparc x86"
IUSE="examples"

S=${WORKDIR}/${PN}

src_unpack() {
	unpack ${A}
	cd "${S}"
	echo 'CFLAGS+=-DDEFSFILE=\"$(DEFSFILE)\" -DVERSION=\"$(VERSION)\"' > source/Makefile
	echo 'lgrind: lgrind.o lgrindef.o regexp.o' >>	source/Makefile
	epatch "${FILESDIR}/${P}-fgets.patch"
}

src_compile() {
	tc-export CC

	latex-package_src_compile
	cd "${S}"/source
	emake DEFSFILE="/usr/share/texmf/tex/latex/${PN}/lgrindef" VERSION="${PV}" || die
}

src_install() {
	# binary first
	dobin source/lgrind

	# then the texmf stuff
	latex-package_src_install
	insinto /usr/share/texmf/tex/latex/${PN}
	doins lgrindef

	# and finally, the documentation
	dodoc FAQ README
	if use examples ; then
		docinto examples
		dodoc example/*
	fi
	cd "${S}"/source
	doman lgrind.1 lgrindef.5
}