summaryrefslogtreecommitdiff
path: root/app-text/stardict
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-text/stardict
reinit the tree, so we can have metadata
Diffstat (limited to 'app-text/stardict')
-rw-r--r--app-text/stardict/Manifest10
-rw-r--r--app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch38
-rw-r--r--app-text/stardict/metadata.xml49
-rw-r--r--app-text/stardict/stardict-3.0.6-r3.ebuild204
-rw-r--r--app-text/stardict/stardict-4.0.0_pre20160518-r1.ebuild233
5 files changed, 534 insertions, 0 deletions
diff --git a/app-text/stardict/Manifest b/app-text/stardict/Manifest
new file mode 100644
index 000000000000..75b47b007388
--- /dev/null
+++ b/app-text/stardict/Manifest
@@ -0,0 +1,10 @@
+AUX stardict-4.0.0_pre20160518-tabfile.patch 1144 SHA256 e53b212ba2537d34da940a80422947fb2304aa4ddea538797c7d0ab6bcbcb4e4 SHA512 532f70556fcf64cfd9e7e00fc226533754089f3091402c402943fbda296755aae9e0466d4972f6e94d34e9644d34ee94b253a1b460d4d3915a6e2afae59c67ae WHIRLPOOL 4e97b9de2452111b01ae62d843785d97ab02fd6901875f679fe82f55eae7536746bff42d00a0707e0b46a429c51df3b20341c73789d7f7a1ae6d966e410b8495
+DIST QQWry.Dat.bz2 4114875 SHA256 3eda90ee8ea13ec88767336b078d2dfe2c971d6a31df60f409d526e3e29a4f83 SHA512 46fd677359a2144429eb9d16131ca6b19db1c086fa93e275aa3d702d3024a65d54064df931d1ed2ba5b0c1f7d9595a284f2a8995d9cd5aac96a45216422dc9ae WHIRLPOOL 456bab65658a8af76160f162fc66868c8a74653a88a1a115e2a20dd90ba9ae8a93b1aa1ee9856cc811d1b1229ca910868ea5db764a119ae9b31cbabf962cab5f
+DIST WyabdcRealPeopleTTS.tar.bz2 84329208 SHA256 96a398eaef3e84f6f23e61683e6439913a4d44055e695dd4a1936f9340d64870 SHA512 1553e62c139ecb005bb04163147d94aa58e4ba7f9ee3172b760c6e4776587c12bf816c42e0131c82195b7c738ec9ee5082f39b974790f5cacd522367919beaa0 WHIRLPOOL 210c121c25c7726cee62c2f2beb3186f0799d68c5537442eda967694f176cbbbc6d09a8c3759de093226e283ae651348ed7173a9f93bbf776325fb656e19720c
+DIST stardict-3.0.6.tar.bz2 9341740 SHA256 6a0a695a8977604e0509a3db1bc6a67e53599b14f29494ba942f21d2c26b82e7 SHA512 81d93324b6e8954af7c20ea6d2a3054bb564d786a21b1cb541c728da7a18a6e7ddb23e595055ccc77e6866bbb8c89fb4f17023e33664761dbe1ee8cd55768658 WHIRLPOOL 9502af310d5eba5ed23457fff9e9f00e2d8453873cece3c20e2c5daf861bd665fc7b9c8e292be5b1d886f9a9fd0d5ad9bd1d8fbd043d221e6637c1c8185f444f
+DIST stardict-4.0.0_pre20160518.tar.xz 3605324 SHA256 8257c215b7da56c1ce9b3abbdac5c6381cf0702c172cd92f2629fb446a0cb86a SHA512 5fb04d7870019f17038e0750a2250a0dca44c427f427cd987542eea2bdfab91223e2c01bae844c43f7d8991d51c0420bd4d77ad6d3f7d86cf6f9c50dae7ca50e WHIRLPOOL 618261ed89db9acaad6f5fa4f44e49abae1d7c272987dce37c49ee81736d77bde977d57743182c77d95d930b7ca0c12e4ff59a85b31f93a1990674ba6e33e2ea
+EBUILD stardict-3.0.6-r3.ebuild 6048 SHA256 ba8874ae6b6cae1dc3061ca3b0fa5e70dc0d059f013344a6b1e6df48d68cf8c9 SHA512 6ceb6977ddd47a167d2d037c987171cdcb9b4fe21fc89f11b2b0df421c1f9960f442b108723976f1417f3d02f8d08c09079a05bc709e79afa055298c287accb8 WHIRLPOOL 57596e25c98a209724952bc4d8dce0decc0ca58fbda16d65a7e8c732d2d82e4cddb7b8fe8f0cb0cdf001d8d906d063864fd69d24d2d7e81a6655e114470cab5b
+EBUILD stardict-4.0.0_pre20160518-r1.ebuild 6779 SHA256 b4d67bbdcbb14fc2a0eccc5c0c9a485cefebeefb238d8c8e5d1f2ec145f1e4be SHA512 b7b0b93bffb2200aa97076ea8de54395a6db668c79d5b489d91759399b645c0941372480607819fe3c80162940f244a279c8db6b5ffc6a89a8cd75e41fad8021 WHIRLPOOL 9122b136ffd2c8f24d84da6018600306ad27b075d0b32efb5370690213a970877a12feed1597812e12bc7f01d0b967ae01927a446dddcde6fa46e24878cbf6fe
+MISC ChangeLog 9061 SHA256 04ff58509698e45d7f67b07d4c0c72666bf5539dc82770ca5a13e4d6de186593 SHA512 7a88162354bd51fb07303a921e12058df3684e2cf2824442f861f0802a5a244a432f284ee3121a120be4b8b02d50a573371aee8d7ad50049d239a2f7f7861dc2 WHIRLPOOL 7cf69b5ddfa476733c8fdbbfc7536c794d9cbb2d485b13166d449520d3eeff3fc4c94a5d9231cd4996678f15ba7cedd7442566128716eab8537535d840225b66
+MISC ChangeLog-2015 17637 SHA256 374e22a64abb6cac0bf0ec763609d75814b960bf632978db34ec65a00b85e66a SHA512 97fd8eac89a0db7d14112a3458f9425e0a830fe079fbdb35e54707b92762ae802337e06e5756f1e4c6e28b04a6a6d40cdb122a53805bc2cb138960ef602b09ce WHIRLPOOL 371f6cb0abbc519cad9b4b6e7bee4c22ccf04dc6ebf6b7e86b03e7e23acda8e362149888ec9730f5f4379b146ac81433ff1b775e089b03bc8ff639396e840170
+MISC metadata.xml 2699 SHA256 6ce20c93d90fb9720c54edcb03ebaf253f16974bc41fec8140f0e9ab383aa84f SHA512 05fcfca88349789f48fa8b1f0741e0fc6f5c0b217b214285ea6b93d17c7307b6dcfe75945d71b77efb913fa74592542238957aefd41b2bc17314fce5e52eaf18 WHIRLPOOL dff464b1819c3be4fdb7bd737dd56ace72b5c13aa73ae8319f6a698d7345406bd0af790747915cdc0512933b8c22772be2282e3779fa62efb2f90cd229f353b9
diff --git a/app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch b/app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch
new file mode 100644
index 000000000000..49cb284253af
--- /dev/null
+++ b/app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch
@@ -0,0 +1,38 @@
+From adb01aafd94b6bd5b5cc49889f4f09d483ee5ac4 Mon Sep 17 00:00:00 2001
+From: Nikolay Korotkiy <sikmir@gmail.com>
+Date: Thu, 1 Sep 2016 14:11:41 +0300
+Subject: [PATCH] tabfile: incorrectly handles whitespace in file name
+
+Signed-off-by: Andrew Savchenko <bircoph@gmail.com>
+---
+ tools/src/libtabfile.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tools/src/libtabfile.cpp b/tools/src/libtabfile.cpp
+index dda256a..2ee9dfd 100644
+--- a/tools/src/libtabfile.cpp
++++ b/tools/src/libtabfile.cpp
+@@ -22,6 +22,7 @@
+ #include <cstring>
+ #include <cstdlib>
+ #include <string>
++#include <sstream>
+ #include <glib/gstdio.h>
+ #include <glib.h>
+
+@@ -228,9 +229,10 @@ static bool write_dictionary(const char *filename, GArray *array)
+ g_message("%s wordcount: %d.", get_impl(basefilename), array->len);
+
+ #ifndef _WIN32
+- std::string command(std::string("dictzip ") + dicfilename);
++ std::stringstream command;
++ command << "dictzip \"" << dicfilename << "\"";
+ int result;
+- result = system(command.c_str());
++ result = system(command.str().c_str());
+ if (result == -1) {
+ g_print("system() error!\n");
+ }
+--
+2.10.2
+
diff --git a/app-text/stardict/metadata.xml b/app-text/stardict/metadata.xml
new file mode 100644
index 000000000000..e9fe64135919
--- /dev/null
+++ b/app-text/stardict/metadata.xml
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>bircoph@gentoo.org</email>
+ <name>Andrew Savchenko</name>
+ </maintainer>
+ <longdescription>
+ StarDict is an international dictionary Software. It has powerful features
+ such as "Glob-style pattern matching", "Scan selection word," "Fuzzy
+ query," etc. Stardict Version3.0 has developed a lot of new functions, such
+ as Full-text translation, Net Dict.
+ </longdescription>
+ <use>
+ <flag name="advertisement">Enable stardict advertisements plugin</flag>
+ <flag name="cal">Enable calendar support using cal program</flag>
+ <flag name="dictdotcn">Enable dict.cn network plugin (for Chinese language)</flag>
+ <flag name="espeak">Enable text to speech synthesizer plugin using
+ <pkg>app-accessibility/espeak</pkg> engine</flag>
+ <flag name="flite">Enable text to speech synthesizer plugin using
+ <pkg>app-accessibility/flite</pkg> engine</flag>
+ <flag name="fortune">Enable plugin to read fortune messages using
+ <pkg>games-misc/fortune-mod</pkg>. You may consider installing
+ <pkg>games-misc/fortune-mod-all</pkg> to get all fortune messages.</flag>
+ <flag name="gucharmap">Enable plugin for unicode symbols description using
+ <pkg>gnome-extra/gucharmap</pkg></flag>
+ <flag name="htmlparse">Enable plugin to parse dictionaries with html content</flag>
+ <flag name="info">Enable plugin to read info pages</flag>
+ <flag name="man">Enable plugin to read manual pages</flag>
+ <flag name="powerwordparse">Enable plugin to parse powerword dictionaries</flag>
+ <flag name="pronounce">Install WyabdcRealPeopleTTS package (it is just many .wav files)
+ to make StarDict pronounce English words</flag>
+ <flag name="qqwry">Enable QQWry plugin, which provides information (in Chinese language)
+ about geographical positions, owner, etc. for IP addresses</flag>
+ <flag name="tools">Build and install dictionary management tools and converters from
+ various dictionary formats</flag>
+ <flag name="updateinfo">Enable plugin to check for stardict updates</flag>
+ <flag name="wikiparse">Enable plugin to parse dictionaries in wikimedia format</flag>
+ <flag name="wordnet">Enable wordnet plugin to find similar English words using
+ lexical database</flag>
+ <flag name="xdxfparse">Enable plugin to parse dictionaries in xdxf (XML Dictionary
+ eXchange Format)</flag>
+ <flag name="youdaodict">Enable youdao.com network plugin (for Chinese language)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">stardict-4</remote-id>
+ <remote-id type="github">huzheng001/stardict-3</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-text/stardict/stardict-3.0.6-r3.ebuild b/app-text/stardict/stardict-3.0.6-r3.ebuild
new file mode 100644
index 000000000000..677af8811503
--- /dev/null
+++ b/app-text/stardict/stardict-3.0.6-r3.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# NOTE: Even though the *.dict.dz are the same as dictd/freedict's files,
+# their indexes seem to be in a different format. So we'll keep them
+# seperate for now.
+
+GNOME2_LA_PUNT=yes
+PYTHON_COMPAT=( python2_7 )
+
+inherit flag-o-matic gnome2 python-single-r1
+
+DESCRIPTION="A international dictionary supporting fuzzy and glob style matching"
+HOMEPAGE="http://stardict-4.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}-4/${P}.tar.bz2
+ pronounce? ( https://${PN}-3.googlecode.com/files/WyabdcRealPeopleTTS.tar.bz2 )
+ qqwry? ( mirror://gentoo/QQWry.Dat.bz2 )"
+
+LICENSE="CPL-1.0 GPL-3 LGPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ppc ppc64 sparc x86"
+IUSE="advertisement debug dictdotcn espeak examples +gucharmap
++htmlparse man perl +powerwordparse pronounce python qqwry spell
+tools updateinfo +wikiparse +wordnet +xdxfparse"
+
+RESTRICT="test"
+
+COMMON_DEPEND="
+ >=dev-libs/glib-2.16:2
+ dev-libs/libsigc++:2=
+ sys-libs/zlib:=
+ x11-libs/gdk-pixbuf:2
+ >=x11-libs/gtk+-2.20:2
+ x11-libs/libX11
+ x11-libs/pango
+ gucharmap? ( gnome-extra/gucharmap:0= )
+ spell? ( >=app-text/enchant-1.2 )
+ tools? (
+ dev-libs/libpcre:=
+ dev-libs/libxml2:=
+ virtual/mysql
+ python? ( ${PYTHON_DEPS} )
+ )
+"
+RDEPEND="${COMMON_DEPEND}
+ espeak? ( >=app-accessibility/espeak-1.29 )
+ perl? ( dev-lang/perl )
+"
+DEPEND="${COMMON_DEPEND}
+ app-text/docbook-xml-dtd:4.3
+ app-text/gnome-doc-utils
+ dev-libs/libxslt
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+REQUIRED_USE="tools? ( python? ( ${PYTHON_REQUIRED_USE} ) )"
+
+# docs are messy, installed manually below
+DOCS=""
+
+src_prepare() {
+ # From Fedora
+ # Remove unneeded sigc++ header files to make it sure
+ # that we are using system-wide libsigc++
+ # (and these does not work on gcc43)
+ find dict/src/sigc++* -name \*.h -or -name \*.cc | xargs rm -f || die
+
+ # libsigc++ started to require c++11 support
+ append-cxxflags "-std=c++11"
+
+ if use python; then
+ local f
+ # force python shebangs handlable by python_doscript
+ for f in tools/src/*.py; do
+ [[ $(head -n1 "${f}") =~ ^#! ]] || continue
+ sed -i '1 s|.*|#!/usr/bin/python|' tools/src/*.py || die
+ done
+ # script contains UTF-8 symbols, but has no ecoding set
+ sed -i '1 a # -*- coding: utf-8 -*-' tools/src/uyghur2dict.py || die
+ fi
+
+ eapply_user
+ gnome2_src_prepare
+}
+
+src_configure() {
+ # Hint: EXTRA_ECONF="--enable-gnome-support" and manual install of
+ # libbonobo-2, libgnome-2, libgnomeui-2, gconf-2 and orbit-2 will
+ # give you GNOME 2.x support, that is otherwise considered deprecated
+ # because of the deep GNOME 2.x core library dependencies
+
+ # Festival plugin crashes, bug 188684. Disable for now.
+ gnome2_src_configure \
+ --disable-festival \
+ --disable-gnome-support \
+ --disable-gpe-support \
+ --disable-schemas-install \
+ --disable-scrollkeeper \
+ $(use_enable advertisement) \
+ $(use_enable debug) \
+ $(use_enable dictdotcn) \
+ $(use_enable espeak) \
+ $(use_enable gucharmap) \
+ $(use_enable htmlparse) \
+ $(use_enable man) \
+ $(use_enable powerwordparse) \
+ $(use_enable qqwry) \
+ $(use_enable spell) \
+ $(use_enable tools) \
+ $(use_enable updateinfo) \
+ $(use_enable wikiparse) \
+ $(use_enable wordnet) \
+ $(use_enable xdxfparse)
+}
+
+src_install() {
+ gnome2_src_install
+
+ dodoc AUTHORS ChangeLog README
+
+ docinto dict
+ dodoc dict/{AUTHORS,ChangeLog,README,TODO}
+ dodoc dict/doc/{Documentation,FAQ,HowToCreateDictionary,Skins,StarDictFileFormat,TextualDictionaryFileFormat,Translation}
+
+ docinto lib
+ dodoc lib/{AUTHORS,ChangeLog,README}
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/dict
+ doins dict/doc/stardict-textual-dict*
+ fi
+
+ if use qqwry; then
+ insinto /usr/share/${PN}/data
+ doins ../QQWry.Dat
+ fi
+
+ if use pronounce; then
+ docinto WyabdcRealPeopleTTS
+ dodoc ../WyabdcRealPeopleTTS/{README,readme.txt}
+ rm -f ../WyabdcRealPeopleTTS/{README,readme.txt}
+ insinto /usr/share
+ doins -r ../WyabdcRealPeopleTTS
+ fi
+
+ # noinst_PROGRAMS with ${PN}_ prefix from tools/src/Makefile.am wrt #292773
+ # and additional scripts from tools dir
+ if use tools; then
+ local app
+ local apps="${PN}-editor pydict2dic olddic2newdic oxford2dic directory2dic
+ dictd2dic wquick2dic ec50 directory2treedic treedict2dir jdictionary mova
+ xmlinout soothill kanjidic2 powerword kdic 21tech 21shiji buddhist
+ tabfile cedict edict duden ${PN}-dict-update degb2utf frgb2utf
+ jpgb2utf gmx2utf rucn kingsoft wikipedia wikipediaImage babylon
+ ${PN}2txt ${PN}-verify fest2dict i2e2dict downloadwiki
+ ooo2dict myspell2dic exc2i2e dictbuilder tabfile2sql KangXi Unihan
+ xiaoxuetang-ja wubi ydp2dict wordnet lingvosound2resdb
+ resdatabase2dir dir2resdatabase ${PN}-index sd2foldoc ${PN}-text2bin
+ ${PN}-bin2text ${PN}-repair"
+
+ use perl && apps+=" dicts-dump.pl ncce2stardict.pl parse-oxford.perl"
+ use python && apps+=" hanzim2dict.py jm2stardict.py lingea-trd-decoder.py
+ makevietdict.py uyghur2dict.py"
+
+ for app in ${apps}; do
+ if [[ "${app}" =~ ^${PN} ]]; then
+ dobin "tools/src/${app}"
+ else
+ newbin "tools/src/${app}" "${PN}_${app}"
+ fi
+ done
+ use python && python_doscript "${ED}"usr/bin/*.py
+
+ docinto tools
+ dodoc tools/{AUTHORS,ChangeLog,README}
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/tools
+ doins tools/src/{dictbuilder.{example,readme},example.ifo,example_treedict.tar.bz2}
+ fi
+ fi
+}
+
+pkg_postinst() {
+ elog
+ elog "Note: festival text to speech (TTS) plugin is not built. To use festival"
+ elog 'TTS plugin, please, emerge festival and enable "Use TTS program." at:'
+ elog '"Preferences -> Dictionary -> Sound" and fill in "Commandline" with:'
+ elog '"echo %s | festival --tts"'
+ elog
+ elog "You will now need to install ${PN} dictionary files. If"
+ elog "you have not, execute the below to get a list of dictionaries:"
+ elog " emerge -s ${PN}-"
+ elog
+ elog "Additionally you may install any stardict dictionary from the net"
+ elog "by unpacking it to:"
+ elog " /usr/share/stardict/dic"
+ elog
+
+ gnome2_pkg_postinst
+}
diff --git a/app-text/stardict/stardict-4.0.0_pre20160518-r1.ebuild b/app-text/stardict/stardict-4.0.0_pre20160518-r1.ebuild
new file mode 100644
index 000000000000..554d2eb7bce3
--- /dev/null
+++ b/app-text/stardict/stardict-4.0.0_pre20160518-r1.ebuild
@@ -0,0 +1,233 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# NOTE: Even though the *.dict.dz are the same as dictd/freedict's files,
+# their indexes seem to be in a different format. So we'll keep them
+# seperate for now.
+
+GNOME2_LA_PUNT=yes
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools flag-o-matic gnome2 python-single-r1
+
+DESCRIPTION="A international dictionary supporting fuzzy and glob style matching"
+HOMEPAGE="http://stardict-4.sourceforge.net/
+ https://github.com/huzheng001/stardict-3"
+SRC_URI="https://dev.gentoo.org/~bircoph/distfiles/${P}.tar.xz
+ pronounce? ( https://${PN}-3.googlecode.com/files/WyabdcRealPeopleTTS.tar.bz2 )
+ qqwry? ( mirror://gentoo/QQWry.Dat.bz2 )"
+
+LICENSE="CPL-1.0 GPL-3 LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="advertisement cal debug dictdotcn espeak examples flite
+fortune gnome gucharmap +htmlparse info man perl +powerwordparse
+pronounce python qqwry spell tools updateinfo +wikiparse +wordnet
++xdxfparse youdaodict"
+
+RESTRICT="test"
+
+COMMON_DEPEND="
+ >=dev-libs/glib-2.32:2
+ dev-libs/libsigc++:2=
+ media-libs/libcanberra[gtk3]
+ sys-libs/zlib:=
+ x11-libs/gdk-pixbuf:2
+ x11-libs/gtk+:3
+ x11-libs/libX11
+ x11-libs/pango
+ espeak? ( >=app-accessibility/espeak-1.29 )
+ flite? ( app-accessibility/flite )
+ gnome? (
+ gnome-base/gconf:2
+ gnome-base/libbonobo
+ gnome-base/libgnome
+ gnome-base/orbit:2
+ )
+ gucharmap? ( gnome-extra/gucharmap:0= )
+ spell? ( >=app-text/enchant-1.2 )
+ tools? (
+ dev-libs/expat
+ dev-libs/libpcre:=
+ dev-libs/libxml2:=
+ virtual/mysql
+ python? ( ${PYTHON_DEPS} )
+ )
+"
+RDEPEND="${COMMON_DEPEND}
+ info? ( sys-apps/texinfo )
+ fortune? ( games-misc/fortune-mod )
+ perl? ( dev-lang/perl )
+"
+DEPEND="${COMMON_DEPEND}
+ app-text/docbook-xml-dtd:4.3
+ app-text/gnome-doc-utils
+ dev-libs/libxslt
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+REQUIRED_USE="tools? ( python? ( ${PYTHON_REQUIRED_USE} ) )"
+
+# docs are messy, installed manually below
+DOCS=""
+
+PATCHES=( "${FILESDIR}/${P}-tabfile.patch" )
+
+src_prepare() {
+ # From Fedora
+ # Remove unneeded sigc++ header files to make it sure
+ # that we are using system-wide libsigc++
+ # (and these does not work on gcc43)
+ find dict/src/sigc++* -name \*.h -or -name \*.cc | xargs rm -f || die
+
+ # libsigc++ started to require c++11 support
+ append-cxxflags "-std=c++11"
+
+ if use python; then
+ local f
+ # force python shebangs handlable by python_doscript
+ for f in tools/src/*.py; do
+ [[ $(head -n1 "${f}") =~ ^#! ]] || continue
+ sed -i '1 s|.*|#!/usr/bin/python|' tools/src/*.py || die
+ done
+ # script contains UTF-8 symbols, but has no ecoding set
+ sed -i '1 a # -*- coding: utf-8 -*-' tools/src/uyghur2dict.py || die
+ fi
+
+ # bug 604318
+ if ! use gnome; then
+ sed -i '/AM_GCONF_SOURCE_2/d' dict/configure.ac || die
+ fi
+
+ eapply_user
+ eautoreconf
+ gnome2_src_prepare
+}
+
+src_configure() {
+ # Hint: EXTRA_ECONF="--enable-gnome-support" and manual install of
+ # libbonobo-2, libgnome-2, libgnomeui-2, gconf-2 and orbit-2 will
+ # give you GNOME 2.x support, that is otherwise considered deprecated
+ # because of the deep GNOME 2.x core library dependencies
+
+ # Festival plugin crashes, bug 188684. Disable for now.
+ gnome2_src_configure \
+ --disable-darwin-support \
+ --disable-festival \
+ --disable-gpe-support \
+ --disable-maemo-support \
+ --disable-schemas-install \
+ --disable-scrollkeeper \
+ $(use_enable advertisement) \
+ $(use_enable cal) \
+ $(use_enable debug) \
+ $(use_enable dictdotcn) \
+ $(use_enable espeak) \
+ $(use_enable flite) \
+ $(use_enable fortune) \
+ $(use_enable gnome gnome-support) \
+ $(use_enable gucharmap) \
+ $(use_enable htmlparse) \
+ $(use_enable info) \
+ $(use_enable man) \
+ $(use_enable powerwordparse) \
+ $(use_enable qqwry) \
+ $(use_enable spell) \
+ $(use_enable tools) \
+ $(use_enable updateinfo) \
+ $(use_enable wikiparse) \
+ $(use_enable wordnet) \
+ $(use_enable xdxfparse) \
+ $(use_enable youdaodict)
+}
+
+src_install() {
+ gnome2_src_install
+
+ dodoc AUTHORS ChangeLog README
+
+ docinto dict
+ dodoc dict/{AUTHORS,ChangeLog,README,TODO}
+ dodoc dict/doc/{Documentation,FAQ,HowToCreateDictionary,Skins,StarDictFileFormat,TextualDictionaryFileFormat,Translation}
+ dodoc -r dict/doc/wiki
+
+ docinto lib
+ dodoc lib/{AUTHORS,ChangeLog,README}
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/dict
+ doins dict/doc/stardict-textual-dict*
+ fi
+
+ if use qqwry; then
+ insinto /usr/share/${PN}/data
+ doins ../QQWry.Dat
+ fi
+
+ if use pronounce; then
+ docinto WyabdcRealPeopleTTS
+ dodoc ../WyabdcRealPeopleTTS/{README,readme.txt}
+ rm -f ../WyabdcRealPeopleTTS/{README,readme.txt}
+ insinto /usr/share
+ doins -r ../WyabdcRealPeopleTTS
+ fi
+
+ # noinst_PROGRAMS with ${PN}_ prefix from tools/src/Makefile.am wrt #292773
+ # and additional scripts from tools dir
+ if use tools; then
+ local app
+ local apps="${PN}-editor pydict2dic olddic2newdic oxford2dic directory2dic dictd2dic
+ wquick2dic ec50 directory2treedic treedict2dir jdictionary mova xmlinout
+ soothill kanjidic2 powerword kdic 21tech 21shiji buddhist tabfile
+ cedict edict duden ${PN}-dict-update degb2utf frgb2utf jpgb2utf gmx2utf
+ rucn kingsoft kingsoft2 wikipedia wikipediaImage babylon ${PN}2txt ${PN}-verify
+ fest2dict i2e2dict downloadwiki ooo2dict myspell2dic exc2i2e
+ dictbuilder tabfile2sql KangXi Unihan xiaoxuetang-ja wubi ydp2dict
+ wordnet lingvosound2resdb resdatabase2dir dir2resdatabase ${PN}-index
+ sd2foldoc
+ ${PN}-text2bin ${PN}-bin2text ${PN}-repair"
+
+ use perl && apps+=" dicts-dump.pl ncce2stardict.pl parse-oxford.perl"
+ use python && apps+=" hanzim2dict.py jm2stardict.py lingea-trd-decoder.py
+ makevietdict.py uyghur2dict.py"
+
+ for app in ${apps}; do
+ if [[ "${app}" =~ ^${PN} ]]; then
+ dobin "tools/src/${app}"
+ else
+ newbin "tools/src/${app}" "${PN}_${app}"
+ fi
+ done
+ use python && python_doscript "${ED}"usr/bin/*.py
+
+ docinto tools
+ dodoc tools/{AUTHORS,ChangeLog,README}
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/tools
+ doins tools/src/{dictbuilder.{example,readme},example.ifo,example_treedict.tar.bz2}
+ fi
+ fi
+}
+
+pkg_postinst() {
+ elog
+ elog "Note: festival text to speech (TTS) plugin is not built. To use festival"
+ elog 'TTS plugin, please, emerge festival and enable "Use TTS program." at:'
+ elog '"Preferences -> Dictionary -> Sound" and fill in "Commandline" with:'
+ elog '"echo %s | festival --tts"'
+ elog
+ elog "You will now need to install ${PN} dictionary files. If"
+ elog "you have not, execute the below to get a list of dictionaries:"
+ elog " emerge -s ${PN}-"
+ elog
+ elog "Additionally you may install any stardict dictionary from the net"
+ elog "by unpacking it to:"
+ elog " /usr/share/stardict/dic"
+ elog
+
+ gnome2_pkg_postinst
+}