app-i18n/tomoe: Switch to PYTHON_MULTI_USEDEP API
[gentoo.git] / app-i18n / tomoe / tomoe-0.6.0-r5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5 PYTHON_COMPAT=( python2_7 )
6 USE_RUBY="ruby24"
7
8 inherit autotools python-single-r1 ruby-single
9
10 DESCRIPTION="Japanese handwriting recognition engine"
11 HOMEPAGE="http://tomoe.osdn.jp/"
12 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
13
14 LICENSE="LGPL-2.1"
15 SLOT="0"
16 KEYWORDS="amd64 x86"
17 IUSE="hyperestraier mysql python ruby ${USE_RUBY//ruby/ruby_targets_ruby} static-libs subversion"
18 RESTRICT="test"
19 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
20         ruby? ( || ( ${USE_RUBY//ruby/ruby_targets_ruby} ) )"
21
22 _ruby_set_globals() {
23         local ruby
24         for ruby in ${USE_RUBY}; do
25                 RUBY_USEDEP="${RUBY_USEDEP}ruby_targets_${ruby}?,"
26         done
27         RUBY_USEDEP="${RUBY_USEDEP%,}"
28 }
29 _ruby_set_globals
30 unset -f _ruby_set_globals
31
32 RDEPEND="dev-libs/glib:2
33         hyperestraier? ( app-text/hyperestraier )
34         mysql? ( dev-db/mysql-connector-c:= )
35         python? (
36                 ${PYTHON_DEPS}
37                 $(python_gen_cond_dep '
38                         dev-python/pygobject:2[${PYTHON_MULTI_USEDEP}]
39                         dev-python/pygtk:2[${PYTHON_MULTI_USEDEP}]
40                 ')
41         )
42         ruby? (
43                 ${RUBY_DEPS}
44                 dev-ruby/ruby-glib2[${RUBY_USEDEP}]
45         )
46         subversion? ( dev-vcs/subversion )"
47 DEPEND="${RDEPEND}
48         dev-util/glib-utils
49         dev-util/gtk-doc-am
50         dev-util/intltool
51         virtual/pkgconfig"
52
53 PATCHES=(
54         "${FILESDIR}"/${PN}-gentoo.patch
55         "${FILESDIR}"/${PN}-export-symbols.patch
56         "${FILESDIR}"/${PN}-glib-2.32.patch
57         "${FILESDIR}"/${PN}-ruby19.patch
58 )
59
60 pkg_setup() {
61         use python && python-single-r1_pkg_setup
62 }
63
64 src_prepare() {
65         sed -i \
66                 -e "s/use_est=yes/use_est=$(usex hyperestraier)/" \
67                 -e "s/use_mysql=yes/use_mysql=$(usex mysql)/" \
68                 configure.ac
69
70         sed -i "s/use_svn=yes/use_svn=$(usex subversion)/" macros/svn.m4
71
72         default
73         eautoreconf
74 }
75
76 src_configure() {
77         local ruby
78         for ruby in ${RUBY_TARGETS_PREFERENCE}; do
79                 if use ruby_targets_${ruby}; then
80                         break
81                 fi
82         done
83
84         econf \
85                 $(use_enable ruby dict-ruby) \
86                 $(use_enable static-libs static) \
87                 $(use_with python python "") \
88                 $(use_with ruby ruby "$(type -p ${ruby})") \
89                 --with-svn-include="${EPREFIX}"/usr/include \
90                 --with-svn-lib="${EPREFIX}"/usr/$(get_libdir)
91 }
92
93 src_install() {
94         default
95         find "${ED}" -name '*.la' -delete || die
96 }