Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/stardict/
Date: Mon, 02 Jan 2017 11:09:56
Message-Id: 1483355389.e2555594063cea186ec5842a8795a4e98c019789.bircoph@gentoo
1 commit: e2555594063cea186ec5842a8795a4e98c019789
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 2 11:07:58 2017 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 2 11:09:49 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2555594
7
8 app-text/stardict: add gnome support
9
10 Add conditional gnome-2 support, when it is disabled, remove
11 AM_GCONF_SOURCE_2 as recommended by upstream (doc/Building) to fix
12 bug 604318.
13
14 Package-Manager: Portage-2.3.3, Repoman-2.3.1
15 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
16
17 .../stardict/stardict-4.0.0_pre20160518-r1.ebuild | 234 +++++++++++++++++++++
18 1 file changed, 234 insertions(+)
19
20 diff --git a/app-text/stardict/stardict-4.0.0_pre20160518-r1.ebuild b/app-text/stardict/stardict-4.0.0_pre20160518-r1.ebuild
21 new file mode 100644
22 index 00000000..0935b86
23 --- /dev/null
24 +++ b/app-text/stardict/stardict-4.0.0_pre20160518-r1.ebuild
25 @@ -0,0 +1,234 @@
26 +# Copyright 1999-2017 Gentoo Foundation
27 +# Distributed under the terms of the GNU General Public License v2
28 +# $Id$
29 +
30 +EAPI=6
31 +
32 +# NOTE: Even though the *.dict.dz are the same as dictd/freedict's files,
33 +# their indexes seem to be in a different format. So we'll keep them
34 +# seperate for now.
35 +
36 +GNOME2_LA_PUNT=yes
37 +PYTHON_COMPAT=( python2_7 )
38 +
39 +inherit autotools flag-o-matic gnome2 python-single-r1
40 +
41 +DESCRIPTION="A international dictionary supporting fuzzy and glob style matching"
42 +HOMEPAGE="http://stardict-4.sourceforge.net/
43 + https://github.com/huzheng001/stardict-3"
44 +SRC_URI="https://dev.gentoo.org/~bircoph/distfiles/${P}.tar.xz
45 + pronounce? ( https://${PN}-3.googlecode.com/files/WyabdcRealPeopleTTS.tar.bz2 )
46 + qqwry? ( mirror://gentoo/QQWry.Dat.bz2 )"
47 +
48 +LICENSE="CPL-1.0 GPL-3 LGPL-2"
49 +SLOT="0"
50 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
51 +IUSE="advertisement cal debug dictdotcn espeak examples flite
52 +fortune gnome gucharmap +htmlparse info man perl +powerwordparse
53 +pronounce python qqwry spell tools updateinfo +wikiparse +wordnet
54 ++xdxfparse youdaodict"
55 +
56 +RESTRICT="test"
57 +
58 +COMMON_DEPEND="
59 + >=dev-libs/glib-2.32:2
60 + dev-libs/libsigc++:2=
61 + media-libs/libcanberra[gtk3]
62 + sys-libs/zlib:=
63 + x11-libs/gdk-pixbuf:2
64 + x11-libs/gtk+:3
65 + x11-libs/libX11
66 + x11-libs/pango
67 + espeak? ( >=app-accessibility/espeak-1.29 )
68 + flite? ( app-accessibility/flite )
69 + gnome? (
70 + gnome-base/gconf:2
71 + gnome-base/libbonobo
72 + gnome-base/libgnome
73 + gnome-base/orbit:2
74 + )
75 + gucharmap? ( gnome-extra/gucharmap:0= )
76 + spell? ( >=app-text/enchant-1.2 )
77 + tools? (
78 + dev-libs/expat
79 + dev-libs/libpcre:=
80 + dev-libs/libxml2:=
81 + virtual/mysql
82 + python? ( ${PYTHON_DEPS} )
83 + )
84 +"
85 +RDEPEND="${COMMON_DEPEND}
86 + info? ( sys-apps/texinfo )
87 + fortune? ( games-misc/fortune-mod )
88 + perl? ( dev-lang/perl )
89 +"
90 +DEPEND="${COMMON_DEPEND}
91 + app-text/docbook-xml-dtd:4.3
92 + app-text/gnome-doc-utils
93 + dev-libs/libxslt
94 + dev-util/intltool
95 + sys-devel/gettext
96 + virtual/pkgconfig
97 +"
98 +REQUIRED_USE="tools? ( python? ( ${PYTHON_REQUIRED_USE} ) )"
99 +
100 +# docs are messy, installed manually below
101 +DOCS=""
102 +
103 +PATCHES=( "${FILESDIR}/${P}-tabfile.patch" )
104 +
105 +src_prepare() {
106 + # From Fedora
107 + # Remove unneeded sigc++ header files to make it sure
108 + # that we are using system-wide libsigc++
109 + # (and these does not work on gcc43)
110 + find dict/src/sigc++* -name \*.h -or -name \*.cc | xargs rm -f || die
111 +
112 + # libsigc++ started to require c++11 support
113 + append-cxxflags "-std=c++11"
114 +
115 + if use python; then
116 + local f
117 + # force python shebangs handlable by python_doscript
118 + for f in tools/src/*.py; do
119 + [[ $(head -n1 "${f}") =~ ^#! ]] || continue
120 + sed -i '1 s|.*|#!/usr/bin/python|' tools/src/*.py || die
121 + done
122 + # script contains UTF-8 symbols, but has no ecoding set
123 + sed -i '1 a # -*- coding: utf-8 -*-' tools/src/uyghur2dict.py || die
124 + fi
125 +
126 + # bug 604318
127 + if ! use gnome; then
128 + sed -i '/AM_GCONF_SOURCE_2/d' dict/configure.ac || die
129 + fi
130 +
131 + eapply_user
132 + eautoreconf
133 + gnome2_src_prepare
134 +}
135 +
136 +src_configure() {
137 + # Hint: EXTRA_ECONF="--enable-gnome-support" and manual install of
138 + # libbonobo-2, libgnome-2, libgnomeui-2, gconf-2 and orbit-2 will
139 + # give you GNOME 2.x support, that is otherwise considered deprecated
140 + # because of the deep GNOME 2.x core library dependencies
141 +
142 + # Festival plugin crashes, bug 188684. Disable for now.
143 + gnome2_src_configure \
144 + --disable-darwin-support \
145 + --disable-festival \
146 + --disable-gpe-support \
147 + --disable-maemo-support \
148 + --disable-schemas-install \
149 + --disable-scrollkeeper \
150 + $(use_enable advertisement) \
151 + $(use_enable cal) \
152 + $(use_enable debug) \
153 + $(use_enable dictdotcn) \
154 + $(use_enable espeak) \
155 + $(use_enable flite) \
156 + $(use_enable fortune) \
157 + $(use_enable gnome gnome-support) \
158 + $(use_enable gucharmap) \
159 + $(use_enable htmlparse) \
160 + $(use_enable info) \
161 + $(use_enable man) \
162 + $(use_enable powerwordparse) \
163 + $(use_enable qqwry) \
164 + $(use_enable spell) \
165 + $(use_enable tools) \
166 + $(use_enable updateinfo) \
167 + $(use_enable wikiparse) \
168 + $(use_enable wordnet) \
169 + $(use_enable xdxfparse) \
170 + $(use_enable youdaodict)
171 +}
172 +
173 +src_install() {
174 + gnome2_src_install
175 +
176 + dodoc AUTHORS ChangeLog README
177 +
178 + docinto dict
179 + dodoc dict/{AUTHORS,ChangeLog,README,TODO}
180 + dodoc dict/doc/{Documentation,FAQ,HowToCreateDictionary,Skins,StarDictFileFormat,TextualDictionaryFileFormat,Translation}
181 + dodoc -r dict/doc/wiki
182 +
183 + docinto lib
184 + dodoc lib/{AUTHORS,ChangeLog,README}
185 +
186 + if use examples; then
187 + insinto /usr/share/doc/${PF}/dict
188 + doins dict/doc/stardict-textual-dict*
189 + fi
190 +
191 + if use qqwry; then
192 + insinto /usr/share/${PN}/data
193 + doins ../QQWry.Dat
194 + fi
195 +
196 + if use pronounce; then
197 + docinto WyabdcRealPeopleTTS
198 + dodoc ../WyabdcRealPeopleTTS/{README,readme.txt}
199 + rm -f ../WyabdcRealPeopleTTS/{README,readme.txt}
200 + insinto /usr/share
201 + doins -r ../WyabdcRealPeopleTTS
202 + fi
203 +
204 + # noinst_PROGRAMS with ${PN}_ prefix from tools/src/Makefile.am wrt #292773
205 + # and additional scripts from tools dir
206 + if use tools; then
207 + local app
208 + local apps="${PN}-editor pydict2dic olddic2newdic oxford2dic directory2dic dictd2dic
209 + wquick2dic ec50 directory2treedic treedict2dir jdictionary mova xmlinout
210 + soothill kanjidic2 powerword kdic 21tech 21shiji buddhist tabfile
211 + cedict edict duden ${PN}-dict-update degb2utf frgb2utf jpgb2utf gmx2utf
212 + rucn kingsoft kingsoft2 wikipedia wikipediaImage babylon ${PN}2txt ${PN}-verify
213 + fest2dict i2e2dict downloadwiki ooo2dict myspell2dic exc2i2e
214 + dictbuilder tabfile2sql KangXi Unihan xiaoxuetang-ja wubi ydp2dict
215 + wordnet lingvosound2resdb resdatabase2dir dir2resdatabase ${PN}-index
216 + sd2foldoc
217 + ${PN}-text2bin ${PN}-bin2text ${PN}-repair"
218 +
219 + use perl && apps+=" dicts-dump.pl ncce2stardict.pl parse-oxford.perl"
220 + use python && apps+=" hanzim2dict.py jm2stardict.py lingea-trd-decoder.py
221 + makevietdict.py uyghur2dict.py"
222 +
223 + for app in ${apps}; do
224 + if [[ "${app}" =~ ^${PN} ]]; then
225 + dobin "tools/src/${app}"
226 + else
227 + newbin "tools/src/${app}" "${PN}_${app}"
228 + fi
229 + done
230 + use python && python_doscript "${ED}"usr/bin/*.py
231 +
232 + docinto tools
233 + dodoc tools/{AUTHORS,ChangeLog,README}
234 +
235 + if use examples; then
236 + insinto /usr/share/doc/${PF}/tools
237 + doins tools/src/{dictbuilder.{example,readme},example.ifo,example_treedict.tar.bz2}
238 + fi
239 + fi
240 +}
241 +
242 +pkg_postinst() {
243 + elog
244 + elog "Note: festival text to speech (TTS) plugin is not built. To use festival"
245 + elog 'TTS plugin, please, emerge festival and enable "Use TTS program." at:'
246 + elog '"Preferences -> Dictionary -> Sound" and fill in "Commandline" with:'
247 + elog '"echo %s | festival --tts"'
248 + elog
249 + elog "You will now need to install ${PN} dictionary files. If"
250 + elog "you have not, execute the below to get a list of dictionaries:"
251 + elog " emerge -s ${PN}-"
252 + elog
253 + elog "Additionally you may install any stardict dictionary from the net"
254 + elog "by unpacking it to:"
255 + elog " /usr/share/stardict/dic"
256 + elog
257 +
258 + gnome2_pkg_postinst
259 +}