# 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/"
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"
dev-libs/libpcre:=
dev-libs/libxml2:=
virtual/mysql
+ python? ( ${PYTHON_DEPS} )
)
"
RDEPEND="${COMMON_DEPEND}
sys-devel/gettext
virtual/pkgconfig
"
+REQUIRED_USE="tools? ( python? ( ${PYTHON_REQUIRED_USE} ) )"
# docs are messy, installed manually below
DOCS=""
# 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
}
${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
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