aboutsummaryrefslogtreecommitdiff
blob: faf5a92e6fe76c8d925475a95ec3078efecf8fc1 (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-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit multilib

MY_PN="OpenFst"
MY_P="${MY_PN}-beta-${PV/_beta/}"

DESCRIPTION="Finite State Transducer tools by Google et al."
HOMEPAGE="http://www.openfst.org"
SRC_URI="http://128.122.80.210/~openfst/twiki/pub/FST/FstDownload/${MY_P}.tgz"

LICENSE="Apache-2.0"

SLOT="0"

KEYWORDS="~x86"

IUSE=""

DEPEND=""
RDEPEND="${DEPEND}"

S="${WORKDIR}/${MY_PN}/fst"

src_unpack() {
	unpack ${A}
	cd "${S}"
	sed -i -e "s/OPT=.*/OPT=${CXXFLAGS}/g" bin/Makefile
}

src_compile() {
	emake all || die "emake failed"
}

src_install() {
	# bin dir has .o and stuff
	# bins have insecure runpath’s
	for f in $(find bin/ -executable ) ; do
		dobin ${f}
	done
	dodir /usr/include/fst
	dodir /usr/include/fst/lib
	insinto /usr/include/fst/lib
	doins lib/fst.h
	dodir /usr/$(get_libdir)
	insinto /usr/$(get_libdir)
	doins lib/libfst.so
	doins bin/libfstmain.so
	cd "${WORKDIR}/${MY_PN}"
	dodoc README
}

src_test() {
	einfo "make test can take a few hours on moderately modern systems"
	make test || die "check failed"
}