summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Savchenko <bircoph@gentoo.org>2016-12-03 19:47:06 +0300
committerAndrew Savchenko <bircoph@gentoo.org>2016-12-03 19:47:35 +0300
commitd615f8f9d771a4e52ea5d4a27ec2e0bdd37e0dcb (patch)
tree338f9d34eb6ba5ec5fbcc0adcbdcb0033a2353f6 /app-text/stardict
parentapp-text/stardict: fix tools installation (diff)
downloadgentoo-d615f8f9d771a4e52ea5d4a27ec2e0bdd37e0dcb.tar.gz
gentoo-d615f8f9d771a4e52ea5d4a27ec2e0bdd37e0dcb.tar.bz2
gentoo-d615f8f9d771a4e52ea5d4a27ec2e0bdd37e0dcb.zip
app-text/stardict: provide python tools as well
Package-Manager: portage-2.3.2 Signed-off-by: Andrew Savchenko <bircoph@gentoo.org>
Diffstat (limited to 'app-text/stardict')
-rw-r--r--app-text/stardict/stardict-3.0.6-r3.ebuild24
1 files changed, 20 insertions, 4 deletions
diff --git a/app-text/stardict/stardict-3.0.6-r3.ebuild b/app-text/stardict/stardict-3.0.6-r3.ebuild
index e793103ecf21..aaf45c108d8a 100644
--- a/app-text/stardict/stardict-3.0.6-r3.ebuild
+++ b/app-text/stardict/stardict-3.0.6-r3.ebuild
@@ -9,8 +9,9 @@ EAPI=6
# seperate for now.
GNOME2_LA_PUNT=yes
+PYTHON_COMPAT=( python2_7 )
-inherit flag-o-matic gnome2
+inherit flag-o-matic gnome2 python-single-r1
DESCRIPTION="A international dictionary supporting fuzzy and glob style matching"
HOMEPAGE="http://stardict-4.sourceforge.net/"
@@ -22,8 +23,8 @@ 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 qqwry spell tools
-updateinfo +wikiparse +wordnet +xdxfparse"
++htmlparse man perl +powerwordparse pronounce python qqwry spell
+tools updateinfo +wikiparse +wordnet +xdxfparse"
RESTRICT="test"
@@ -41,6 +42,7 @@ COMMON_DEPEND="
dev-libs/libpcre:=
dev-libs/libxml2:=
virtual/mysql
+ python? ( ${PYTHON_DEPS} )
)
"
RDEPEND="${COMMON_DEPEND}
@@ -54,6 +56,7 @@ DEPEND="${COMMON_DEPEND}
sys-devel/gettext
virtual/pkgconfig
"
+REQUIRED_USE="tools? ( python? ( ${PYTHON_REQUIRED_USE} ) )"
# docs are messy, installed manually below
DOCS=""
@@ -68,6 +71,17 @@ src_prepare() {
# 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
}
@@ -147,6 +161,8 @@ src_install() {
${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
@@ -155,12 +171,12 @@ src_install() {
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 tools
insinto /usr/share/doc/${PF}/tools
doins tools/src/{dictbuilder.{example,readme},example.ifo,example_treedict.tar.bz2}
fi