Gentoo Archives: gentoo-commits

From: Akinori Hattori <hattya@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-i18n/tomoe/, app-i18n/tomoe/files/
Date: Sat, 05 Aug 2017 14:48:01
Message-Id: 1501944453.07b233477e357598c0910816ace3855422a37a83.hattya@gentoo
1 commit: 07b233477e357598c0910816ace3855422a37a83
2 Author: Akinori Hattori <hattya <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 5 14:46:24 2017 +0000
4 Commit: Akinori Hattori <hattya <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 5 14:47:33 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07b23347
7
8 app-i18n/tomoe: fix build with >=dev-lang/ruby-1.9
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.1
11
12 app-i18n/tomoe/files/tomoe-ruby19.patch | 84 +++++++++++++++++++++++++++++
13 app-i18n/tomoe/tomoe-0.6.0-r3.ebuild | 93 +++++++++++++++++++++++++++++++++
14 2 files changed, 177 insertions(+)
15
16 diff --git a/app-i18n/tomoe/files/tomoe-ruby19.patch b/app-i18n/tomoe/files/tomoe-ruby19.patch
17 new file mode 100644
18 index 00000000000..bca6aa807f0
19 --- /dev/null
20 +++ b/app-i18n/tomoe/files/tomoe-ruby19.patch
21 @@ -0,0 +1,84 @@
22 +--- a/bindings/ruby/tomoe-rb-char.c
23 ++++ b/bindings/ruby/tomoe-rb-char.c
24 +@@ -2,6 +2,10 @@
25 +
26 + #define _SELF(obj) RVAL2TCHR(obj)
27 +
28 ++#ifndef RSTRING_LEN
29 ++# define RSTRING_LEN(s) (RSTRING(s)->len)
30 ++#endif
31 ++
32 + static VALUE
33 + tc_initialize(int argc, VALUE *argv, VALUE self)
34 + {
35 +@@ -13,7 +17,7 @@
36 + if (NIL_P(xml)) {
37 + chr = tomoe_char_new();
38 + } else {
39 +- chr = tomoe_char_new_from_xml_data(RVAL2CSTR(xml), RSTRING(xml)->len);
40 ++ chr = tomoe_char_new_from_xml_data(RVAL2CSTR(xml), RSTRING_LEN(xml));
41 + }
42 +
43 + G_INITIALIZE(self, chr);
44 +--- a/macros/ruby.m4
45 ++++ b/macros/ruby.m4
46 +@@ -28,13 +28,18 @@
47 +
48 + changequote(<<, >>)
49 + for var_name in archdir sitearchdir CFLAGS LIBRUBYARG libdir \
50 +- sitelibdir sitearchdir; do
51 +- rbconfig_tmp=`$rbconfig "print Config::CONFIG['$var_name']"`
52 ++ sitelibdir rubyhdrdir rubyarchhdrdir; do
53 ++ rbconfig_tmp=`$rbconfig "print RbConfig::CONFIG['$var_name']"`
54 + eval "rbconfig_$var_name=\"$rbconfig_tmp\""
55 + done
56 + changequote([, ])
57 +
58 +- RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_archdir "
59 ++ if test "x$rbconfig_rubyhdrdir" = "x"; then
60 ++ RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_archdir "
61 ++ else
62 ++ RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_rubyhdrdir "
63 ++ RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_rubyarchhdrdir "
64 ++ fi
65 + RUBY_CFLAGS="$RUBY_CFLAGS -I$rbconfig_sitearchdir "
66 + RUBY_CFLAGS="$RUBY_CFLAGS $rbconfig_CFLAGS "
67 + RUBY_LIBS="$rbconfig_LIBRUBYARG"
68 +--- a/module/dict/tomoe-dict-ruby.c
69 ++++ b/module/dict/tomoe-dict-ruby.c
70 +@@ -52,6 +52,13 @@
71 + #define TOMOE_IS_DICT_RUBY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOMOE_TYPE_DICT_RUBY))
72 + #define TOMOE_DICT_RUBY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), TOMOE_TYPE_DICT_RUBY, TomoeDictRubyClass))
73 +
74 ++#ifndef RARRAY_LEN
75 ++# define RARRAY_LEN(a) (RARRAY(a)->len)
76 ++#endif
77 ++#ifndef RARRAY_PTR
78 ++# define RARRAY_PTR(a) (RARRAY(a)->ptr)
79 ++#endif
80 ++
81 + enum {
82 + PROP_0,
83 + PROP_FILENAME,
84 +@@ -209,7 +216,7 @@
85 + ruby_script (PACKAGE);
86 + ruby_set_argv (1, argv);
87 +
88 +- if (RARRAY(rb_load_path)->len == 0) {
89 ++ if (RARRAY_LEN(rb_load_path) == 0) {
90 + ruby_init_loadpath ();
91 + }
92 + }
93 +@@ -405,10 +412,10 @@
94 +
95 + rb_results = rb_funcall (dict->rb_dict, rb_intern ("search"),
96 + 1, GOBJ2RVAL (query));
97 +- len = RARRAY (rb_results)->len;
98 ++ len = RARRAY_LEN(rb_results);
99 + for (i = len; i; i--) {
100 + results = g_list_prepend (results,
101 +- RVAL2TCND (RARRAY (rb_results)->ptr[i]));
102 ++ RVAL2TCND (RARRAY_PTR(rb_results)[i]));
103 + }
104 + return results;
105 + }
106
107 diff --git a/app-i18n/tomoe/tomoe-0.6.0-r3.ebuild b/app-i18n/tomoe/tomoe-0.6.0-r3.ebuild
108 new file mode 100644
109 index 00000000000..be597455715
110 --- /dev/null
111 +++ b/app-i18n/tomoe/tomoe-0.6.0-r3.ebuild
112 @@ -0,0 +1,93 @@
113 +# Copyright 1999-2017 Gentoo Foundation
114 +# Distributed under the terms of the GNU General Public License v2
115 +
116 +EAPI="6"
117 +PYTHON_COMPAT=( python2_7 )
118 +USE_RUBY="ruby22 ruby23"
119 +
120 +inherit autotools ltprune python-single-r1 ruby-single
121 +
122 +DESCRIPTION="Japanese handwriting recognition engine"
123 +HOMEPAGE="http://tomoe.osdn.jp/"
124 +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
125 +
126 +LICENSE="LGPL-2.1"
127 +SLOT="0"
128 +KEYWORDS="~amd64 ~x86"
129 +IUSE="hyperestraier mysql python ruby ${USE_RUBY//ruby/ruby_targets_ruby} static-libs subversion"
130 +RESTRICT="test"
131 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
132 + ruby? ( || ( ${USE_RUBY//ruby/ruby_targets_ruby} ) )"
133 +
134 +_ruby_set_globals() {
135 + local ruby
136 + for ruby in ${USE_RUBY}; do
137 + RUBY_USEDEP="${RUBY_USEDEP}ruby_targets_${ruby}?,"
138 + done
139 + RUBY_USEDEP="${RUBY_USEDEP%,}"
140 +}
141 +_ruby_set_globals
142 +unset -f _ruby_set_globals
143 +
144 +RDEPEND="dev-libs/glib:2
145 + hyperestraier? ( app-text/hyperestraier )
146 + mysql? ( virtual/libmysqlclient )
147 + python? (
148 + ${PYTHON_DEPS}
149 + dev-python/pygobject:2[${PYTHON_USEDEP}]
150 + dev-python/pygtk:2[${PYTHON_USEDEP}]
151 + )
152 + ruby? (
153 + ${RUBY_DEPS}
154 + dev-ruby/ruby-glib2[${RUBY_USEDEP}]
155 + )
156 + subversion? ( dev-vcs/subversion )"
157 +DEPEND="${RDEPEND}
158 + dev-util/gtk-doc-am
159 + dev-util/intltool
160 + virtual/pkgconfig"
161 +
162 +PATCHES=(
163 + "${FILESDIR}"/${PN}-gentoo.patch
164 + "${FILESDIR}"/${PN}-export-symbols.patch
165 + "${FILESDIR}"/${PN}-glib-2.32.patch
166 + "${FILESDIR}"/${PN}-ruby19.patch
167 +)
168 +
169 +pkg_setup() {
170 + use python && python-single-r1_pkg_setup
171 +}
172 +
173 +src_prepare() {
174 + sed -i \
175 + -e "s/use_est=yes/use_est=$(usex hyperestraier)/" \
176 + -e "s/use_mysql=yes/use_mysql=$(usex mysql)/" \
177 + configure.ac
178 +
179 + sed -i "s/use_svn=yes/use_svn=$(usex subversion)/" macros/svn.m4
180 +
181 + default
182 + eautoreconf
183 +}
184 +
185 +src_configure() {
186 + local ruby
187 + for ruby in ${RUBY_TARGETS_PREFERENCE}; do
188 + if use ruby_targets_${ruby}; then
189 + break
190 + fi
191 + done
192 +
193 + econf \
194 + $(use_enable ruby dict-ruby) \
195 + $(use_enable static-libs static) \
196 + $(use_with python python "") \
197 + $(use_with ruby ruby "$(type -p ${ruby})") \
198 + --with-svn-include="${EPREFIX}"/usr/include \
199 + --with-svn-lib="${EPREFIX}"/usr/$(get_libdir)
200 +}
201 +
202 +src_install() {
203 + default
204 + prune_libtool_files --modules
205 +}