summaryrefslogtreecommitdiff
blob: 3b288028c1f738047fc39424a2b98affd9d1f587 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI="4"

inherit eutils

DESCRIPTION="A collection of italian voices for Festival TTS"
HOMEPAGE="http://www2.pd.istc.cnr.it/FESTIVAL/home"
SRC_URI="mirror://sourceforge/it-festival/Italian-FESTIVAL.zip"

RDEPEND=">=app-accessibility/festival-2.1
		mbrola? ( >=app-accessibility/mbrola-3.0.1h-r4[l10n_it] )"
DEPEND="app-arch/unzip"
IUSE="mbrola"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~x86"

S=${WORKDIR}

src_prepare() {

	unzip -qo italian_scm.zip
	unzip -qo lex_ifd.zip
	unzip -qo lp_diphone.zip
	unzip -qo pc_diphone.zip

	if use mbrola; then
	  unzip -qo lp_mbrola_unix.zip
	  unzip -qo pc_mbrola_unix.zip
	fi

	# Deletes some useless files
	rm -f *.zip

	rm -f `find festival/ -name install_unix.txt`
	rm -f `find festival/ -name italian_mbrola_win.scm`

	if ! use mbrola; then
	  rm -f `find festival/ -name italian_mbrola_unix.scm`
	fi

	# Aggregates some README files
	mkdir docs
	mv `find festival/ -name \*README` docs/

	# All remaining files are moved "here"
	mv festival/lib/* .
	rm -rf festival/
}

src_install () {
	# Install the docs
	dodoc "${WORKDIR}"/docs/*

	# Install the voice scheme
	insinto /usr/share/festival/
	doins -r "${WORKDIR}"/italian_scm/

	# Install the dicts
	insinto /usr/share/festival/dicts
	doins -r "${WORKDIR}"/dicts/*

	# Installs the voices
	insinto /usr/share/festival/voices
	doins -r "${WORKDIR}"/voices/*

	# Enables the mbrola-based voices
	if use mbrola; then
	  dosym /opt/mbrola/it3 /usr/share/festival/voices/italian/pc_mbrola/it3
	  dosym /opt/mbrola/it4 /usr/share/festival/voices/italian/lp_mbrola/it4
	fi
}

pkg_postinst () {
	einfo "Italian voices installed:"
	for VOICE in `ls "${ROOT}/usr/share/festival/voices/italian/"`; do
	  einfo "   (voice_${VOICE})"
	done
}