1 |
commit: d615f8f9d771a4e52ea5d4a27ec2e0bdd37e0dcb |
2 |
Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 3 16:47:06 2016 +0000 |
4 |
Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 3 16:47:35 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d615f8f9 |
7 |
|
8 |
app-text/stardict: provide python tools as well |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org> |
12 |
|
13 |
app-text/stardict/stardict-3.0.6-r3.ebuild | 24 ++++++++++++++++++++---- |
14 |
1 file changed, 20 insertions(+), 4 deletions(-) |
15 |
|
16 |
diff --git a/app-text/stardict/stardict-3.0.6-r3.ebuild b/app-text/stardict/stardict-3.0.6-r3.ebuild |
17 |
index e793103..aaf45c1 100644 |
18 |
--- a/app-text/stardict/stardict-3.0.6-r3.ebuild |
19 |
+++ b/app-text/stardict/stardict-3.0.6-r3.ebuild |
20 |
@@ -9,8 +9,9 @@ EAPI=6 |
21 |
# seperate for now. |
22 |
|
23 |
GNOME2_LA_PUNT=yes |
24 |
+PYTHON_COMPAT=( python2_7 ) |
25 |
|
26 |
-inherit flag-o-matic gnome2 |
27 |
+inherit flag-o-matic gnome2 python-single-r1 |
28 |
|
29 |
DESCRIPTION="A international dictionary supporting fuzzy and glob style matching" |
30 |
HOMEPAGE="http://stardict-4.sourceforge.net/" |
31 |
@@ -22,8 +23,8 @@ LICENSE="CPL-1.0 GPL-3 LGPL-2" |
32 |
SLOT="0" |
33 |
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86" |
34 |
IUSE="advertisement debug dictdotcn espeak examples +gucharmap |
35 |
-+htmlparse man perl +powerwordparse pronounce qqwry spell tools |
36 |
-updateinfo +wikiparse +wordnet +xdxfparse" |
37 |
++htmlparse man perl +powerwordparse pronounce python qqwry spell |
38 |
+tools updateinfo +wikiparse +wordnet +xdxfparse" |
39 |
|
40 |
RESTRICT="test" |
41 |
|
42 |
@@ -41,6 +42,7 @@ COMMON_DEPEND=" |
43 |
dev-libs/libpcre:= |
44 |
dev-libs/libxml2:= |
45 |
virtual/mysql |
46 |
+ python? ( ${PYTHON_DEPS} ) |
47 |
) |
48 |
" |
49 |
RDEPEND="${COMMON_DEPEND} |
50 |
@@ -54,6 +56,7 @@ DEPEND="${COMMON_DEPEND} |
51 |
sys-devel/gettext |
52 |
virtual/pkgconfig |
53 |
" |
54 |
+REQUIRED_USE="tools? ( python? ( ${PYTHON_REQUIRED_USE} ) )" |
55 |
|
56 |
# docs are messy, installed manually below |
57 |
DOCS="" |
58 |
@@ -68,6 +71,17 @@ src_prepare() { |
59 |
# libsigc++ started to require c++11 support |
60 |
append-cxxflags "-std=c++11" |
61 |
|
62 |
+ if use python; then |
63 |
+ local f |
64 |
+ # force python shebangs handlable by python_doscript |
65 |
+ for f in tools/src/*.py; do |
66 |
+ [[ $(head -n1 "${f}") =~ ^#! ]] || continue |
67 |
+ sed -i '1 s|.*|#!/usr/bin/python|' tools/src/*.py || die |
68 |
+ done |
69 |
+ # script contains UTF-8 symbols, but has no ecoding set |
70 |
+ sed -i '1 a # -*- coding: utf-8 -*-' tools/src/uyghur2dict.py || die |
71 |
+ fi |
72 |
+ |
73 |
eapply_user |
74 |
gnome2_src_prepare |
75 |
} |
76 |
@@ -147,6 +161,8 @@ src_install() { |
77 |
${PN}-bin2text ${PN}-repair" |
78 |
|
79 |
use perl && apps+=" dicts-dump.pl ncce2stardict.pl parse-oxford.perl" |
80 |
+ use python && apps+=" hanzim2dict.py jm2stardict.py lingea-trd-decoder.py |
81 |
+ makevietdict.py uyghur2dict.py" |
82 |
|
83 |
for app in ${apps}; do |
84 |
if [[ "${app}" =~ ^${PN} ]]; then |
85 |
@@ -155,12 +171,12 @@ src_install() { |
86 |
newbin "tools/src/${app}" "${PN}_${app}" |
87 |
fi |
88 |
done |
89 |
+ use python && python_doscript "${ED}"usr/bin/*.py |
90 |
|
91 |
docinto tools |
92 |
dodoc tools/{AUTHORS,ChangeLog,README} |
93 |
|
94 |
if use examples; then |
95 |
- insinto tools |
96 |
insinto /usr/share/doc/${PF}/tools |
97 |
doins tools/src/{dictbuilder.{example,readme},example.ifo,example_treedict.tar.bz2} |
98 |
fi |