Gentoo Archives: gentoo-commits

From: Gilles Dartiguelongue <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/gtranslator/files/, app-text/gtranslator/
Date: Mon, 17 Apr 2017 10:31:16
Message-Id: 1492425035.f01aac108623402427a15be9b3f3d5947a53ebe4.eva@gentoo
1 commit: f01aac108623402427a15be9b3f3d5947a53ebe4
2 Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 16 22:29:58 2017 +0000
4 Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 17 10:30:35 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f01aac10
7
8 app-text/gtranslator: switch python requirements to python3
9
10 One of the last user of the libpeas python2 loader support. Kill gnome
11 USE flag and replace it with more meaningful ones. Switch to EAPI=6.
12
13 Package-Manager: Portage-2.3.5, Repoman-2.3.2
14
15 .../files/gtranslator-2.91.7-gi-silence.patch | 26 +++++++
16 .../gtranslator-2.91.7-gucharmap-python3.patch | 51 ++++++++++++++
17 app-text/gtranslator/gtranslator-2.91.7-r1.ebuild | 82 ++++++++++++++++++++++
18 app-text/gtranslator/metadata.xml | 4 ++
19 4 files changed, 163 insertions(+)
20
21 diff --git a/app-text/gtranslator/files/gtranslator-2.91.7-gi-silence.patch b/app-text/gtranslator/files/gtranslator-2.91.7-gi-silence.patch
22 new file mode 100644
23 index 00000000000..19a3a6d1e98
24 --- /dev/null
25 +++ b/app-text/gtranslator/files/gtranslator-2.91.7-gi-silence.patch
26 @@ -0,0 +1,26 @@
27 +From acc785dd63379f08f08b52fae9d7e5c5666495c8 Mon Sep 17 00:00:00 2001
28 +From: Gilles Dartiguelongue <eva@g.o>
29 +Date: Mon, 17 Apr 2017 00:15:58 +0200
30 +Subject: [PATCH] Silence gobject-introspection warning on version-less imports
31 +
32 +---
33 + plugins/charmap/charmap/__init__.py | 3 +++
34 + 1 file changed, 3 insertions(+)
35 +
36 +diff --git a/plugins/charmap/charmap/__init__.py b/plugins/charmap/charmap/__init__.py
37 +index b504cb61..6f8c2b61 100644
38 +--- a/plugins/charmap/charmap/__init__.py
39 ++++ b/plugins/charmap/charmap/__init__.py
40 +@@ -16,6 +16,9 @@
41 + # You should have received a copy of the GNU General Public License
42 + # along with this program. If not, see <http://www.gnu.org/licenses/>.
43 +
44 ++import gi
45 ++gi.require_version('Gucharmap', '2.90')
46 ++
47 + from gi.repository import GObject, Gio, Pango, Gtk, Gtranslator, Gucharmap
48 + from .panel import CharmapPanel
49 + import sys
50 +--
51 +2.12.2
52 +
53
54 diff --git a/app-text/gtranslator/files/gtranslator-2.91.7-gucharmap-python3.patch b/app-text/gtranslator/files/gtranslator-2.91.7-gucharmap-python3.patch
55 new file mode 100644
56 index 00000000000..1ad491cf3c0
57 --- /dev/null
58 +++ b/app-text/gtranslator/files/gtranslator-2.91.7-gucharmap-python3.patch
59 @@ -0,0 +1,51 @@
60 +From 1e4d042f7e9b28a58bd09af5c97e4282441113d2 Mon Sep 17 00:00:00 2001
61 +From: Gilles Dartiguelongue <eva@g.o>
62 +Date: Sun, 16 Apr 2017 23:48:29 +0200
63 +Subject: [PATCH 1/2] Switch gucharmap plugin to python3 loader
64 +
65 +---
66 + plugins/charmap/charmap/__init__.py | 2 +-
67 + plugins/charmap/gtr-charmap.plugin.desktop.in | 2 +-
68 + src/gtr-plugins-engine.c | 2 +-
69 + 3 files changed, 3 insertions(+), 3 deletions(-)
70 +
71 +diff --git a/plugins/charmap/charmap/__init__.py b/plugins/charmap/charmap/__init__.py
72 +index 414157b1..b504cb61 100644
73 +--- a/plugins/charmap/charmap/__init__.py
74 ++++ b/plugins/charmap/charmap/__init__.py
75 +@@ -17,7 +17,7 @@
76 + # along with this program. If not, see <http://www.gnu.org/licenses/>.
77 +
78 + from gi.repository import GObject, Gio, Pango, Gtk, Gtranslator, Gucharmap
79 +-from panel import CharmapPanel
80 ++from .panel import CharmapPanel
81 + import sys
82 + import gettext
83 +
84 +diff --git a/plugins/charmap/gtr-charmap.plugin.desktop.in b/plugins/charmap/gtr-charmap.plugin.desktop.in
85 +index 3949c5f6..a872a545 100644
86 +--- a/plugins/charmap/gtr-charmap.plugin.desktop.in
87 ++++ b/plugins/charmap/gtr-charmap.plugin.desktop.in
88 +@@ -1,5 +1,5 @@
89 + [Plugin]
90 +-Loader=python
91 ++Loader=python3
92 + Module=charmap
93 + IAge=3
94 + _Name=Character Map
95 +diff --git a/src/gtr-plugins-engine.c b/src/gtr-plugins-engine.c
96 +index 903ea735..8e41010a 100644
97 +--- a/src/gtr-plugins-engine.c
98 ++++ b/src/gtr-plugins-engine.c
99 +@@ -64,7 +64,7 @@ gtr_plugins_engine_init (GtrPluginsEngine * engine)
100 + GTR_TYPE_PLUGINS_ENGINE,
101 + GtrPluginsEnginePrivate);
102 +
103 +- peas_engine_enable_loader (PEAS_ENGINE (engine), "python");
104 ++ peas_engine_enable_loader (PEAS_ENGINE (engine), "python3");
105 +
106 + engine->priv->plugin_settings = g_settings_new ("org.gnome.gtranslator.plugins");
107 +
108 +--
109 +2.12.2
110 +
111
112 diff --git a/app-text/gtranslator/gtranslator-2.91.7-r1.ebuild b/app-text/gtranslator/gtranslator-2.91.7-r1.ebuild
113 new file mode 100644
114 index 00000000000..f063cb8104c
115 --- /dev/null
116 +++ b/app-text/gtranslator/gtranslator-2.91.7-r1.ebuild
117 @@ -0,0 +1,82 @@
118 +# Copyright 1999-2017 Gentoo Foundation
119 +# Distributed under the terms of the GNU General Public License v2
120 +
121 +EAPI=6
122 +GNOME2_LA_PUNT="yes"
123 +PYTHON_COMPAT=( python{3_4,3_5} )
124 +
125 +inherit gnome2 python-single-r1
126 +
127 +DESCRIPTION="An enhanced gettext po file editor for GNOME"
128 +HOMEPAGE="https://wiki.gnome.org/Apps/Gtranslator"
129 +
130 +LICENSE="GPL-3+ FDL-1.1+"
131 +SLOT="0"
132 +KEYWORDS="~amd64 ~ppc ~x86"
133 +IUSE="+introspection gnome-dictionary gucharmap spell"
134 +REQUIRED_USE="gucharmap? ( introspection ${PYTHON_REQUIRED_USE} )"
135 +
136 +COMMON_DEPEND="
137 + >=dev-libs/glib-2.32:2[dbus]
138 + >=x11-libs/gtk+-3.4.2:3[introspection?]
139 + >=x11-libs/gtksourceview-3.0.0:3.0[introspection?]
140 + >=dev-libs/gdl-3.6:3=
141 + >=dev-libs/libxml2-2.4.12:2
142 + >=dev-libs/json-glib-0.12.0
143 + >=dev-libs/libpeas-1.2[gtk]
144 + gnome-extra/libgda:5=
145 + >=app-text/iso-codes-0.35
146 +
147 + gnome-base/gsettings-desktop-schemas
148 +
149 + gnome-dictionary? ( app-dicts/gnome-dictionary:= )
150 + gucharmap? ( ${PYTHON_DEPS} )
151 + introspection? ( >=dev-libs/gobject-introspection-0.9.3 )
152 + spell? ( app-text/gtkspell:3= )
153 +"
154 +RDEPEND="${COMMON_DEPEND}
155 + x11-themes/gnome-icon-theme-symbolic
156 + gucharmap? (
157 + >=dev-libs/libpeas-1.2[gtk,python,${PYTHON_USEDEP}]
158 + dev-python/pygobject:3[${PYTHON_USEDEP}]
159 + gnome-extra/gucharmap:2.90[introspection]
160 + x11-libs/gtk+:3[introspection] )
161 +"
162 +DEPEND="${COMMON_DEPEND}
163 + >=dev-util/gtk-doc-am-1
164 + >=dev-util/intltool-0.50.1
165 + >=sys-devel/gettext-0.17
166 + virtual/pkgconfig
167 +"
168 +# eautoreconf requires gnome-base/gnome-common, app-text/yelp-tools
169 +
170 +PATCHES=(
171 + # Switch plugin to python3 loader
172 + "${FILESDIR}"/${P}-gucharmap-python3.patch
173 + # Silence g-i import warnings
174 + "${FILESDIR}"/${P}-gi-silence.patch
175 +)
176 +
177 +pkg_setup() {
178 + use gucharmap && python-single-r1_pkg_setup
179 +}
180 +
181 +src_prepare() {
182 + DOCS="AUTHORS ChangeLog HACKING INSTALL NEWS README THANKS"
183 +
184 + gnome2_src_prepare
185 +
186 + if ! use gucharmap ; then
187 + # don't install charmap plugin, it requires gnome-extra/gucharmap
188 + sed -e 's:\scharmap\s: :g' -i plugins/Makefile.* ||
189 + die "sed plugins/Makefile.* failed"
190 + fi
191 +}
192 +
193 +src_configure() {
194 + gnome2_src_configure \
195 + --disable-static \
196 + $(use_enable introspection) \
197 + $(use_with gnome-dictionary dictionary) \
198 + $(use_with spell gtkspell)
199 +}
200
201 diff --git a/app-text/gtranslator/metadata.xml b/app-text/gtranslator/metadata.xml
202 index a30a93b4b9d..a6e15044678 100644
203 --- a/app-text/gtranslator/metadata.xml
204 +++ b/app-text/gtranslator/metadata.xml
205 @@ -5,6 +5,10 @@
206 <email>gnome@g.o</email>
207 <name>Gentoo GNOME Desktop</name>
208 </maintainer>
209 + <use>
210 + <flag name="gnome-dictionary">Enable plugin for dictionary lookups using <pkg>app-dicts/gnome-dictionary</pkg>.</flag>
211 + <flag name="gucharmap">Enable plugin for unicode symbols selection using <pkg>gnome-extra/gucharmap</pkg>.</flag>
212 + </use>
213 <upstream>
214 <remote-id type="sourceforge">gtranslator</remote-id>
215 </upstream>