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

inherit eutils 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://cims.nyu.edu/~openfst/twiki/pub/FST/FstDownload/${MY_P}.tgz"

LICENSE="Apache-2.0"

SLOT="0"

KEYWORDS="~amd64"

IUSE=""

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

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

src_unpack() {
	unpack ${A}
	epatch "${FILESDIR}/${P}-gcc-4.3.patch" || die "Patching failed"
	cd "${S}"
	sed -i -e "s/OPT=\(.*\)/OPT=-fPIC ${CXXFLAGS} \1/g" bin/Makefile
		lib/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,arc,compat,properties,register,symbol-table,util}.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"
}