aboutsummaryrefslogtreecommitdiff
blob: 78a5ab84e05a8cf197fd1d9f74e1388dfc987d10 (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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="5"

inherit eutils flag-o-matic subversion

DESCRIPTION="A toolkit for speech recognition"
HOMEPAGE="http://kaldi.sourceforge.net/"
ESVN_REPO_URI="https://svn.code.sf.net/p/kaldi/code/trunk/src@4735"

LICENSE="Apache-2.0"
SLOT="0"
IUSE="doc test threads"
KEYWORDS=""

RDEPEND="
	media-libs/speex
	sci-libs/atlas[lapack,threads=]
	~sci-misc/openfst-1.3.4"
DEPEND="${RDEPEND}
	doc? ( app-doc/doxygen )"

src_prepare() {
	epatch \
		"${FILESDIR}"/configure.patch \
		"${FILESDIR}"/Makefile.patch \
		"${FILESDIR}"/default_rules.mk.patch
}

src_configure() {
	./configure \
		--shared \
		--fst-root="${EPREFIX}/usr" \
		$(use threads && echo --threaded-atlas=yes) \
		--atlas-root="${EPREFIX}/usr/include/atlas" || die "failed to run configure"

	use test || append-cxxflags -DNDEBUG

	sed -i \
		-e 's/OPENFST_VER =/OPENFST_VER = 1.3.4#/' \
		-e "s:-g :-DHAVE_SPEEX ${CXXFLAGS} :" \
		-e "s:-lm -lpthread -ldl:-lm -lpthread -ldl -lspeex ${LDFLAGS}:" \
		kaldi.mk || die "sed unix/kaldi.mk failed"
}

src_compile() {
	emake
	use doc && doxygen
}

src_install() {
	dolib.so $(make print-libfiles)
	dobin $(make print-binfiles)
	use doc && dohtml -r html/*
}