Merge github#363: sys-process/atop: add systemd support
[gentoo.git] / app-text / stardict / stardict-3.0.6-r2.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 # NOTE: Even though the *.dict.dz are the same as dictd/freedict's files,
8 #       their indexes seem to be in a different format. So we'll keep them
9 #       seperate for now.
10
11 # NOTE: Festival plugin crashes, bug 188684. Disable for now.
12
13 GNOME2_LA_PUNT=yes
14 GCONF_DEBUG=no
15
16 inherit eutils flag-o-matic gnome2
17
18 DESCRIPTION="A international dictionary supporting fuzzy and glob style matching"
19 HOMEPAGE="http://stardict-4.sourceforge.net/"
20 SRC_URI="mirror://sourceforge/${PN}-4/${P}.tar.bz2
21         pronounce? ( https://${PN}-3.googlecode.com/files/WyabdcRealPeopleTTS.tar.bz2 )
22         qqwry? ( mirror://gentoo/QQWry.Dat.bz2 )"
23
24 LICENSE="CPL-1.0 GPL-3 LGPL-2"
25 SLOT="0"
26 KEYWORDS="amd64 ~arm ~arm64 ppc ~ppc64 sparc x86"
27 IUSE="espeak qqwry pronounce spell tools"
28
29 RESTRICT="test"
30
31 COMMON_DEPEND="
32         >=dev-libs/glib-2.16:2
33         dev-libs/libsigc++:2=
34         sys-libs/zlib:=
35         x11-libs/gdk-pixbuf:2
36         >=x11-libs/gtk+-2.20:2
37         x11-libs/libX11
38         x11-libs/pango
39         spell? ( >=app-text/enchant-1.2 )
40         tools? (
41                 dev-libs/libpcre:=
42                 dev-libs/libxml2:=
43                 virtual/mysql
44                 )
45 "
46 RDEPEND="${COMMON_DEPEND}
47         espeak? ( >=app-accessibility/espeak-1.29 )
48 "
49 DEPEND="${COMMON_DEPEND}
50         app-text/docbook-xml-dtd:4.3
51         app-text/gnome-doc-utils
52         dev-libs/libxslt
53         dev-util/intltool
54         sys-devel/gettext
55         virtual/pkgconfig
56 "
57
58 src_prepare() {
59         # From Fedora
60         # Remove unneeded sigc++ header files to make it sure
61         # that we are using system-wide libsigc++
62         # (and these does not work on gcc43)
63         find dict/src/sigc++* -name \*.h -or -name \*.cc | xargs rm -f || die
64
65         # libsigc++ started to require c++11 support
66         append-cxxflags "-std=c++11"
67
68         gnome2_src_prepare
69 }
70
71 src_configure() {
72         # Hint: EXTRA_ECONF="--enable-gnome-support" and manual install of
73         # libbonobo-2, libgnome-2, libgnomeui-2, gconf-2 and orbit-2 will
74         # give you GNOME 2.x support, that is otherwise considered deprecated
75         # because of the deep GNOME 2.x core library dependencies
76         gnome2_src_configure \
77                 $(use_enable tools) \
78                 --disable-scrollkeeper \
79                 $(use_enable spell) \
80                 --disable-gucharmap \
81                 --disable-festival \
82                 $(use_enable espeak) \
83                 $(use_enable qqwry) \
84                 --disable-updateinfo \
85                 --disable-gnome-support \
86                 --disable-gpe-support \
87                 --disable-schemas-install
88 }
89
90 src_install() {
91         gnome2_src_install
92
93         dodoc dict/doc/{Documentation,FAQ,HACKING,HowToCreateDictionary,Skins,StarDictFileFormat,Translation}
94
95         if use qqwry; then
96                 insinto /usr/share/${PN}/data
97                 doins ../QQWry.Dat
98         fi
99
100         if use pronounce; then
101                 docinto WyabdcRealPeopleTTS
102                 dodoc ../WyabdcRealPeopleTTS/{README,readme.txt}
103                 rm -f ../WyabdcRealPeopleTTS/{README,readme.txt}
104                 insinto /usr/share
105                 doins -r ../WyabdcRealPeopleTTS
106         fi
107
108         # noinst_PROGRAMS with ${PN}_ prefix from tools/src/Makefile.am wrt #292773
109         if use tools; then
110                 local app
111                 local apps="${PN}-editor pydict2dic olddic2newdic oxford2dic directory2dic
112                         dictd2dic wquick2dic ec50 directory2treedic treedict2dir jdictionary mova
113                         xmlinout soothill kanjidic2 powerword kdic 21tech 21shiji buddhist
114                         tabfile cedict edict duden ${PN}-dict-update degb2utf frgb2utf
115                         jpgb2utf gmx2utf rucn kingsoft wikipedia wikipediaImage babylon
116                         ${PN}2txt ${PN}-verify fest2dict i2e2dict downloadwiki
117                         ooo2dict myspell2dic exc2i2e dictbuilder tabfile2sql KangXi Unihan
118                         xiaoxuetang-ja wubi ydp2dict wordnet lingvosound2resdb
119                         resdatabase2dir dir2resdatabase ${PN}-index sd2foldoc ${PN}-text2bin
120                         ${PN}-bin2text ${PN}-repair"
121
122                 for app in ${apps}; do
123                         newbin tools/src/${app} ${PN}_${app}
124                 done
125         fi
126 }
127
128 pkg_postinst() {
129         elog "Note: festival text to speech (TTS) plugin is not built. To use festival"
130         elog 'TTS plugin, please, emerge festival and enable "Use TTS program." at:'
131         elog '"Preferences -> Dictionary -> Sound" and fill in "Commandline" with:'
132         elog '"echo %s | festival --tts"'
133         elog
134         elog "You will now need to install ${PN} dictionary files. If"
135         elog "you have not, execute the below to get a list of dictionaries:"
136         elog
137         elog "  emerge -s ${PN}-"
138
139         gnome2_pkg_postinst
140 }