summaryrefslogtreecommitdiff
blob: 660166d01089e02cc5ecdfb088424e1d23949fd2 (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
PERL_EXPORT_PHASE_FUNCTIONS=no
inherit perl-module eutils flag-o-matic toolchain-funcs autotools-utils

DESCRIPTION="Online hand recognition system with machine learning"
HOMEPAGE="http://zinnia.sourceforge.net/"
SRC_URI="mirror://sourceforge/zinnia/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 x86"
# Package warrants IUSE doc
IUSE="perl static-libs"
DOCS=( AUTHORS ChangeLog NEWS README )
PATCHES=(
	"${FILESDIR}/${P}-ricedown.patch"
	"${FILESDIR}/${P}-perl.patch"
	"${FILESDIR}/${P}-gcc6.patch"
)
AUTOTOOLS_AUTORECONF=yes

src_prepare() {
	autotools-utils_src_prepare
	if use perl ; then
			pushd "${S}/perl" >/dev/null
			PATCHES=()
			perl-module_src_prepare
			popd >/dev/null
	fi
}

src_compile() {
	autotools-utils_src_compile
	if use perl ; then
			pushd "${S}"/perl >/dev/null

			# We need to run this here as otherwise it won't pick up the
			# just-built -lzinnia and cause the extension to have
			# undefined symbols.
			perl-module_src_configure

			append-cppflags "-I${S}"
			append-ldflags "-L${S}/.libs"

			emake \
				LDDLFLAGS="-shared" \
				OTHERLDFLAGS="${LDFLAGS}" \
				CC="$(tc-getCXX)" LD="$(tc-getCXX)" \
				OPTIMIZE="${CPPFLAGS} ${CXXFLAGS}"
			popd >/dev/null
	fi
}

src_install() {
	autotools-utils_src_install

	if use perl ; then
			pushd "${S}/perl" >/dev/null
			perl-module_src_install
			popd >/dev/null
	fi

	# Curiously ChangeLog & NEWS are left uncompressed
	dohtml doc/*.html doc/*.css
}