From d8d2b8bb7aa822d14dbfcb1bdd84b53595db4a20 Mon Sep 17 00:00:00 2001 From: Martin Väth Date: Mon, 5 Dec 2016 22:20:52 +0100 Subject: app-text/stardict: Version bump. Make libcanberra optional. Remove old --- app-text/stardict/Manifest | 1 + .../files/stardict-3.0.3-zlib-1.2.5.2.patch | 39 ---- .../files/stardict-4.0.0_pre20160518-tabfile.patch | 38 ++++ .../stardict/files/stardict-strip-canberra.patch | 33 +++ app-text/stardict/metadata.xml | 34 +-- app-text/stardict/stardict-3.0.6-r2.ebuild | 155 ------------- .../stardict/stardict-4.0.0_pre20160518.ebuild | 243 +++++++++++++++++++++ 7 files changed, 336 insertions(+), 207 deletions(-) delete mode 100644 app-text/stardict/files/stardict-3.0.3-zlib-1.2.5.2.patch create mode 100644 app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch create mode 100644 app-text/stardict/files/stardict-strip-canberra.patch delete mode 100644 app-text/stardict/stardict-3.0.6-r2.ebuild create mode 100644 app-text/stardict/stardict-4.0.0_pre20160518.ebuild (limited to 'app-text/stardict') diff --git a/app-text/stardict/Manifest b/app-text/stardict/Manifest index c0d7ced5..0e1e5e3b 100644 --- a/app-text/stardict/Manifest +++ b/app-text/stardict/Manifest @@ -1,3 +1,4 @@ DIST QQWry.Dat.bz2 4114875 SHA256 3eda90ee8ea13ec88767336b078d2dfe2c971d6a31df60f409d526e3e29a4f83 DIST WyabdcRealPeopleTTS.tar.bz2 84329208 SHA256 96a398eaef3e84f6f23e61683e6439913a4d44055e695dd4a1936f9340d64870 DIST stardict-3.0.6.tar.bz2 9341740 SHA256 6a0a695a8977604e0509a3db1bc6a67e53599b14f29494ba942f21d2c26b82e7 +DIST stardict-4.0.0_pre20160518.tar.xz 3605324 SHA256 8257c215b7da56c1ce9b3abbdac5c6381cf0702c172cd92f2629fb446a0cb86a diff --git a/app-text/stardict/files/stardict-3.0.3-zlib-1.2.5.2.patch b/app-text/stardict/files/stardict-3.0.3-zlib-1.2.5.2.patch deleted file mode 100644 index 6a320bd4..00000000 --- a/app-text/stardict/files/stardict-3.0.3-zlib-1.2.5.2.patch +++ /dev/null @@ -1,39 +0,0 @@ -http://bugs.gentoo.org/401887 - -diff --git a/lib/src/libcommon.cpp b/lib/src/libcommon.cpp -index 16770a3..a4299e7 100644 ---- a/lib/src/libcommon.cpp -+++ b/lib/src/libcommon.cpp -@@ -614,7 +614,7 @@ int unpack_zlib(const char* arch_file_name, const char* out_file_name) - return EXIT_FAILURE; - } - while(true) { -- len = gzread(get_impl(in), buf, buffer_size); -+ len = gzread((gzFile)get_impl(in), buf, buffer_size); - if(len < 0) { - g_critical(read_file_err, arch_file_name, ""); - return EXIT_FAILURE; -@@ -871,3 +871,8 @@ int remove_recursive(const std::string& path) - return res; - } - } -+ -+int gzclose_compat(void * file) -+{ -+ return gzclose ((gzFile)file); -+} -diff --git a/lib/src/libcommon.h b/lib/src/libcommon.h -index 10f13b4..bdcbf2f 100644 ---- a/lib/src/libcommon.h -+++ b/lib/src/libcommon.h -@@ -187,8 +187,9 @@ namespace clib { - typedef ResourceWrapper File; - } - -+extern int gzclose_compat(void * file); - namespace zip { --typedef ResourceWrapper gzFile; -+typedef ResourceWrapper gzFile; - } - - /* Create a new temporary file. Return file name in file name encoding. 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 00000000..49cb2842 --- /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 +Date: Thu, 1 Sep 2016 14:11:41 +0300 +Subject: [PATCH] tabfile: incorrectly handles whitespace in file name + +Signed-off-by: Andrew Savchenko +--- + 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 + #include + #include ++#include + #include + #include + +@@ -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/files/stardict-strip-canberra.patch b/app-text/stardict/files/stardict-strip-canberra.patch new file mode 100644 index 00000000..8522bb54 --- /dev/null +++ b/app-text/stardict/files/stardict-strip-canberra.patch @@ -0,0 +1,33 @@ +--- 1/dict/src/desktop.cpp ++++ 1/dict/src/desktop.cpp +@@ -39,9 +39,11 @@ + + + #ifndef _WIN32 ++#if 0 + # include "canberra.h" + # include "canberra-gtk.h" + #endif ++#endif + + + +@@ -176,14 +178,18 @@ + return; // error + } + #else ++#if 0 + if (conf->get_bool_at("dictionary/always_use_sound_play_command")) { ++#endif + const std::string &playcmd= + conf->get_string_at("dictionary/sound_play_command"); + spawn_command(playcmd.c_str(), filename.c_str()); ++#if 0 + } else { + ca_context_play(ca_gtk_context_get(), 0, CA_PROP_MEDIA_FILENAME, filename.c_str(), NULL); + } + #endif ++#endif + } + + void play_video_file(const std::string& filename) diff --git a/app-text/stardict/metadata.xml b/app-text/stardict/metadata.xml index c3a080a3..6d58ce6c 100644 --- a/app-text/stardict/metadata.xml +++ b/app-text/stardict/metadata.xml @@ -18,27 +18,35 @@ Enable stardict advertisements plugin + Enable calendar support using cal program + Use libcanberra for sound playing Enable dict.cn network plugin (for Chinese language) Enable text to speech synthesizer plugin using app-accessibility/espeak engine - Enable plugin for unicode symbols description - using gnome-extra/gucharmap + Enable text to speech synthesizer plugin using + app-accessibility/flite engine + Enable plugin to read fortune messages using + games-misc/fortune-mod. You may consider installing + games-misc/fortune-mod-all to get all fortune messages. + Enable plugin for unicode symbols description using + gnome-extra/gucharmap Enable plugin to parse dictionaries with html content + Enable plugin to read info pages Enable plugin to read manual pages - Install WyabdcRealPeopleTTS package (it is just - many .wav files) to make StarDict pronounce English words - Enable QQWry plugin, which provides information (in - Chinese language) about geographical positions, owner, etc. for IP - addresses Enable plugin to parse powerword dictionaries - Build and install dictionary management tools and - converters from various dictionary formats + Install WyabdcRealPeopleTTS package (it is just many .wav files) + to make StarDict pronounce English words + Enable QQWry plugin, which provides information (in Chinese language) + about geographical positions, owner, etc. for IP addresses + Build and install dictionary management tools and converters from + various dictionary formats Enable plugin to check for stardict updates Enable plugin to parse dictionaries in wikimedia format - Enable wordnet plugin to find similar English words - using lexical database - Enable plugin to parse dictionaries - in xdxf (XML Dictionary eXchange Format) + Enable wordnet plugin to find similar English words using + lexical database + Enable plugin to parse dictionaries in xdxf (XML Dictionary + eXchange Format) + Enable youdao.com network plugin (for Chinese language) stardict-4 diff --git a/app-text/stardict/stardict-3.0.6-r2.ebuild b/app-text/stardict/stardict-3.0.6-r2.ebuild deleted file mode 100644 index a6907ab4..00000000 --- a/app-text/stardict/stardict-3.0.6-r2.ebuild +++ /dev/null @@ -1,155 +0,0 @@ -# Copyright 2016 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. - -# NOTE: Festival plugin crashes, bug 188684. Disable for now. - -GNOME2_LA_PUNT=yes - -inherit autotools flag-o-matic gnome2 - -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="espeak gnome qqwry pronounce spell tools" - -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 - spell? ( >=app-text/enchant-1.2 ) - tools? ( - dev-libs/libpcre:= - dev-libs/libxml2:= - virtual/mysql - ) -" -RDEPEND="${COMMON_DEPEND} - espeak? ( >=app-accessibility/espeak-1.29 ) -" -DEPEND="${COMMON_DEPEND} - gnome? ( - app-text/docbook-xml-dtd:4.3 - app-text/gnome-doc-utils - dev-libs/libxslt - ) - dev-util/intltool - sys-devel/gettext - virtual/pkgconfig -" - -src_prepare() { - eapply_user - if ! use gnome - then sed -i \ - -e 's/GNOME_DOC_INIT/GNOME_DOC_INIT([0.32],[:],[:])/' \ - -e '/AM_GCONF_SOURCE/d' \ - -e '/help\/Makefile/d' \ - dict/configure.ac - sed -i \ - -e 's/ help / /' \ - dict/Makefile.am - sed -i \ - -e 's/\(libstardict_la_LIBADD = \)/\1 -lgmodule-2.0 /' \ - dict/src/lib/Makefile.am - eautoreconf - fi - # 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" - - 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 - gnome2_src_configure \ - $(use_enable tools) \ - --disable-scrollkeeper \ - $(use_enable spell) \ - --disable-gucharmap \ - --disable-festival \ - $(use_enable espeak) \ - $(use_enable qqwry) \ - --disable-updateinfo \ - --disable-gnome-support \ - --disable-gpe-support \ - --disable-schemas-install -} - -src_install() { - gnome2_src_install - - dodoc dict/doc/{Documentation,FAQ,HACKING,HowToCreateDictionary,Skins,StarDictFileFormat,Translation} - - 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 - 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" - - for app in ${apps}; do - newbin tools/src/${app} ${PN}_${app} - done - fi -} - -pkg_postinst() { - 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 - elog " emerge -s ${PN}-" - - gnome2_pkg_postinst -} diff --git a/app-text/stardict/stardict-4.0.0_pre20160518.ebuild b/app-text/stardict/stardict-4.0.0_pre20160518.ebuild new file mode 100644 index 00000000..a06eb08f --- /dev/null +++ b/app-text/stardict/stardict-4.0.0_pre20160518.ebuild @@ -0,0 +1,243 @@ +# Copyright 2016 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 canberra 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= + canberra? ( 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 ) + 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} + gnome? ( + 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 + + eapply_user + if ! use gnome + then sed -i \ + -e '/GNOME_DOC_INIT/d' \ + -e '/AM_GCONF_SOURCE/d' \ + -e '/help\/Makefile/d' \ + dict/configure.ac || die + sed -i \ + -e 's/ help / /' \ + dict/Makefile.am || die + sed -i \ + -e 's/\(libstardict_la_LIBADD = \)/\1 -lgmodule-2.0 /' \ + dict/src/lib/Makefile.am || die + fi + if ! use canberra + then sed -i \ + -e 's/ libcanberra libcanberra-gtk3//' \ + dict/configure.ac || die + eapply "${FILESDIR}/${PN}-strip-canberra.patch" + fi + 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-gnome-support \ + --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 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 +} -- cgit v1.2.3-65-gdbad