Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/gexiv2/, media-libs/gexiv2/files/
Date: Sun, 27 Mar 2022 18:58:35
Message-Id: 1648405696.21bf129424d68a2315450390c633a6f9ff938bb8.mattst88@gentoo
1 commit: 21bf129424d68a2315450390c633a6f9ff938bb8
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 27 18:22:30 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 27 18:28:16 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21bf1294
7
8 media-libs/gexiv2: Version bump to 0.14.0
9
10 Closes: https://bugs.gentoo.org/811810
11 Closes: https://bugs.gentoo.org/835781
12 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
13
14 media-libs/gexiv2/Manifest | 1 +
15 .../files/0.14.0-clean-up-python-support.patch | 175 +++++++++++++++++++++
16 media-libs/gexiv2/gexiv2-0.14.0.ebuild | 82 ++++++++++
17 3 files changed, 258 insertions(+)
18
19 diff --git a/media-libs/gexiv2/Manifest b/media-libs/gexiv2/Manifest
20 index 96ab6312326a..2e89005c9c5a 100644
21 --- a/media-libs/gexiv2/Manifest
22 +++ b/media-libs/gexiv2/Manifest
23 @@ -1,2 +1,3 @@
24 DIST gexiv2-0.12.2.tar.xz 378428 BLAKE2B bb3fd6310cdb76f3e88bb31e018d78013bb626559b9e95bf59688601388cff10739c20c431fa9539c1d24c9045d2b3590a0f783a994d3b8966c4df12e9127f4e SHA512 850bf41f6180b0fdd050ab08da6e3bbd8d25ffc25a1f48e17a1d7a65771893cc79fba9cbd6718bf1754251ac4a4754983f0ab8f006a05f8c4a15085846d001a5
25 DIST gexiv2-0.13.0.tar.xz 387188 BLAKE2B 25550fd0b711e1363da1f6144af482709b52b0334e326a211919fcc97ccaef1832978a31d8d7ec111caf3f3b9b4db3537d818d35199da2e0b6250098c6d99d01 SHA512 dcd94a8e8ab7e3764bf652514222c3cce4537bf2658905405a25d1dd18878e67343060f5b1cf9fd8b11acf4dd2b727a9d49a0d8f379838c60c92de69f0bed2c5
26 +DIST gexiv2-0.14.0.tar.xz 387288 BLAKE2B bdbb4547486a248cd9c6559276ebac20d3af5211474b86eb6ebfb3a8c76670ff7c2d162435e0cbcb270f96c64f5bc1eedc2d63c021b65f57e1ad9ec8cf9a4bf8 SHA512 d745ae2d8ddcf0c8a2a7980eaa489f9b520af54242c5e4ddded9c3ae4a579c824c8cb659bd7e985ffa09f9fe37bdf73d6d9181d456711e0953b73023eb0f9f50
27
28 diff --git a/media-libs/gexiv2/files/0.14.0-clean-up-python-support.patch b/media-libs/gexiv2/files/0.14.0-clean-up-python-support.patch
29 new file mode 100644
30 index 000000000000..0e2fbaa33fe8
31 --- /dev/null
32 +++ b/media-libs/gexiv2/files/0.14.0-clean-up-python-support.patch
33 @@ -0,0 +1,175 @@
34 +https://gitlab.gnome.org/GNOME/gexiv2/-/merge_requests/64
35 +
36 +From 7e36a7dfeadfff134beabf502ca4d551f505fd8e Mon Sep 17 00:00:00 2001
37 +From: "Alex Xu (Hello71)" <alex_y_xu@×××××.ca>
38 +Date: Fri, 24 Sep 2021 11:48:34 -0400
39 +Subject: [PATCH] clean up python support
40 +
41 +- fix always failing gexiv2 test due to missing import gi
42 +- actually use override during testing
43 +- fix totally ignoring gexiv2 test status
44 +- fix broken build with -Dpython3=false
45 +- remove unnecessary configure_file
46 +- remove misleading explanation of -Dpython3=false (it also disables
47 + installing GExiv2.py)
48 +- remove unnecessary python3_girdir
49 +---
50 + meson.build | 21 +++++--------------
51 + meson_options.txt | 1 -
52 + test/meson.build | 13 +++---------
53 + test/python/{gexiv2.py.in => gexiv2.py} | 3 ++-
54 + test/python/meson.build | 10 ---------
55 + .../{test_metadata.py.in => test_metadata.py} | 4 ++--
56 + test/python3-test.in | 4 ----
57 + 7 files changed, 12 insertions(+), 44 deletions(-)
58 + rename test/python/{gexiv2.py.in => gexiv2.py} (94%)
59 + rename test/python/{test_metadata.py.in => test_metadata.py} (99%)
60 + delete mode 100755 test/python3-test.in
61 +
62 +diff --git a/meson.build b/meson.build
63 +index 42f70cb..3f9426f 100644
64 +--- a/meson.build
65 ++++ b/meson.build
66 +@@ -23,7 +23,6 @@ gio = dependency('gio-2.0', version : '>= 2.46.0')
67 + cc = meson.get_compiler('c')
68 + cpp = meson.get_compiler('cpp')
69 + math = cc.find_library('m', required : false)
70 +-python3 = import('python').find_installation('python3', modules: 'gi', required: get_option('python3'))
71 +
72 + bmff_test = '''#include <exiv2/exiv2.hpp>
73 + #ifndef EXV_ENABLE_BMFF
74 +@@ -48,24 +47,14 @@ if get_option('gtk_doc')
75 + subdir('docs')
76 + endif
77 +
78 +-if get_option('python3') == false
79 +- warning('\'python3\' is disabled, any Python tests will not be run.')
80 +-else
81 ++if get_option('python3')
82 + if get_option('introspection') == false
83 + error('Build option \'python3\' requires \'introspection\' to be enabled.')
84 + endif
85 +-
86 +- girdir = get_option('python3_girdir')
87 +- if girdir == 'auto'
88 +- python3_output = run_command(python3, ['-c', 'import gi; print(gi._overridesdir)'])
89 +- if python3_output.returncode() != 0
90 +- error('Finding the Python 3 gi/override path: ' + python3_output.stderr())
91 +- endif
92 +- girdir = python3_output.stdout().strip()
93 +- endif
94 +-
95 +- message('Installing \'GExiv2.py\' into \'' + girdir + '\'')
96 +- python3.install_sources('GExiv2.py', subdir : girdir)
97 ++ python3 = import('python').find_installation('python3', modules: 'gi')
98 ++ python3.install_sources('GExiv2.py', subdir: 'gi/overrides')
99 ++else
100 ++ python3 = disabler()
101 + endif
102 +
103 + subdir('test')
104 +diff --git a/meson_options.txt b/meson_options.txt
105 +index 5e76789..edb3cfd 100644
106 +--- a/meson_options.txt
107 ++++ b/meson_options.txt
108 +@@ -2,5 +2,4 @@ option('gtk_doc', type: 'boolean', value: false, description: 'Enable or disable
109 + option('introspection', type: 'boolean', value : true, description: 'Enable or disable GObject Introspection')
110 + option('vapi', type: 'boolean', value: true, description: 'Enable or disable generation of vala vapi file')
111 + option('tools', type: 'boolean', value: true, description: 'Enable or disable building the commandline tools')
112 +-option('python3_girdir', type: 'string', value : 'auto', description : 'Installation dir for PyGObject3 overrides (default = auto)')
113 + option('python3', type: 'boolean', value : true, description : 'Enable or disable using Python 3 (and PyGObject module)')
114 +diff --git a/test/meson.build b/test/meson.build
115 +index c4f287d..0ae50ed 100644
116 +--- a/test/meson.build
117 ++++ b/test/meson.build
118 +@@ -1,12 +1,11 @@
119 + test_sample_path = join_paths(meson.current_source_dir(), 'data')
120 +-python_module_path = join_paths(meson.current_build_dir(), 'python')
121 +
122 + test_env = environment()
123 + test_env.set('G_SLICE', 'always-malloc')
124 + test_env.set('TEST_DATA_DIR', test_sample_path)
125 + test_env.prepend('GI_TYPELIB_PATH', typelib_path)
126 + test_env.prepend('LD_LIBRARY_PATH', typelib_path)
127 +-test_env.prepend('PYTHONPATH', python_module_path)
128 ++test_env.prepend('PYTHONPATH', join_paths(meson.current_source_dir(), 'python'))
129 +
130 + regression_test = executable('gexiv2-regression', 'gexiv2-regression.c',
131 + dependencies : [gobject, gio, math],
132 +@@ -19,11 +18,5 @@ regression_test = executable('gexiv2-regression', 'gexiv2-regression.c',
133 +
134 + test('regression', regression_test, env : test_env)
135 +
136 +-subdir('python')
137 +-
138 +-python3_test_conf = configuration_data()
139 +-python3_test_conf.set('PYTHON3_PATH', python3.path())
140 +-python3_test = configure_file(input: 'python3-test.in',
141 +- output : 'python3-test',
142 +- configuration: python3_test_conf)
143 +-test('python3', find_program(python3_test), env : test_env)
144 ++test('python3-gexiv2', python3, args: ['-m', 'unittest', 'gexiv2'], env: test_env)
145 ++test('python3-metadata', python3, args: ['-m', 'unittest', 'test_metadata'], env: test_env)
146 +diff --git a/test/python/gexiv2.py.in b/test/python/gexiv2.py
147 +similarity index 94%
148 +rename from test/python/gexiv2.py.in
149 +rename to test/python/gexiv2.py
150 +index 4e01ff5..503815c 100644
151 +--- a/test/python/gexiv2.py.in
152 ++++ b/test/python/gexiv2.py
153 +@@ -22,7 +22,8 @@
154 + import unittest
155 + import os
156 +
157 +-gi.require_version('GExiv2', '@PROJECT_API_VERSION@')
158 ++import gi.overrides
159 ++gi.overrides.__path__.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
160 + from gi.repository import GExiv2
161 +
162 +
163 +diff --git a/test/python/meson.build b/test/python/meson.build
164 +index 783ba0b..e69de29 100644
165 +--- a/test/python/meson.build
166 ++++ b/test/python/meson.build
167 +@@ -1,10 +0,0 @@
168 +-python_conf = configuration_data()
169 +-python_conf.set('PROJECT_API_VERSION', project_api_version)
170 +-
171 +-gexiv2_py_file = configure_file(input: 'gexiv2.py.in',
172 +- output : 'gexiv2.py',
173 +- configuration: python_conf)
174 +-
175 +-test_metadata_py_file = configure_file(input: 'test_metadata.py.in',
176 +- output : 'test_metadata.py',
177 +- configuration: python_conf)
178 +diff --git a/test/python/test_metadata.py.in b/test/python/test_metadata.py
179 +similarity index 99%
180 +rename from test/python/test_metadata.py.in
181 +rename to test/python/test_metadata.py
182 +index 45d9d45..8d4296c 100644
183 +--- a/test/python/test_metadata.py.in
184 ++++ b/test/python/test_metadata.py
185 +@@ -30,8 +30,8 @@ import tempfile
186 +
187 + PY3K = sys.version_info[0] == 3
188 +
189 +-import gi
190 +-gi.require_version('GExiv2', '@PROJECT_API_VERSION@')
191 ++import gi.overrides
192 ++gi.overrides.__path__.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
193 + from gi.repository import GExiv2, GLib
194 + from fractions import Fraction
195 +
196 +diff --git a/test/python3-test.in b/test/python3-test.in
197 +deleted file mode 100755
198 +index 6fb3bf8..0000000
199 +--- a/test/python3-test.in
200 ++++ /dev/null
201 +@@ -1,4 +0,0 @@
202 +-#!/bin/sh
203 +-
204 +-'@PYTHON3_PATH@' -m unittest gexiv2
205 +-'@PYTHON3_PATH@' -m unittest test_metadata
206 +--
207 +2.34.1
208 +
209
210 diff --git a/media-libs/gexiv2/gexiv2-0.14.0.ebuild b/media-libs/gexiv2/gexiv2-0.14.0.ebuild
211 new file mode 100644
212 index 000000000000..2de5eadc27cc
213 --- /dev/null
214 +++ b/media-libs/gexiv2/gexiv2-0.14.0.ebuild
215 @@ -0,0 +1,82 @@
216 +# Copyright 1999-2022 Gentoo Authors
217 +# Distributed under the terms of the GNU General Public License v2
218 +
219 +EAPI=8
220 +
221 +PYTHON_COMPAT=( python3_{8..10} )
222 +
223 +inherit meson python-r1 vala
224 +
225 +DESCRIPTION="GObject-based wrapper around the Exiv2 library"
226 +HOMEPAGE="https://wiki.gnome.org/Projects/gexiv2"
227 +
228 +if [[ ${PV} == 9999 ]]; then
229 + EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/gexiv2.git"
230 + inherit git-r3
231 +else
232 + SRC_URI="mirror://gnome/sources/${PN}/$(ver_cut 1-2)/${P}.tar.xz"
233 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
234 +fi
235 +
236 +LICENSE="LGPL-2.1+ GPL-2"
237 +SLOT="0"
238 +IUSE="gtk-doc +introspection python static-libs test +vala"
239 +REQUIRED_USE="
240 + python? ( introspection ${PYTHON_REQUIRED_USE} )
241 + test? ( python introspection )
242 + vala? ( introspection )
243 +"
244 +RESTRICT="!test? ( test )"
245 +
246 +RDEPEND="
247 + >=media-gfx/exiv2-0.26:=
248 + >=dev-libs/glib-2.46.0:2
249 + introspection? ( >=dev-libs/gobject-introspection-1.54:= )
250 + python? (
251 + ${PYTHON_DEPS}
252 + dev-python/pygobject:3[${PYTHON_USEDEP}]
253 + )
254 +"
255 +DEPEND="${RDEPEND}"
256 +BDEPEND="
257 + dev-util/glib-utils
258 + gtk-doc? (
259 + dev-util/gtk-doc
260 + app-text/docbook-xml-dtd:4.3
261 + )
262 + test? ( media-gfx/exiv2[xmp] )
263 + virtual/pkgconfig
264 + vala? ( $(vala_depend) )
265 +"
266 +
267 +PATCHES=(
268 + "${FILESDIR}"/${PV}-clean-up-python-support.patch
269 +)
270 +
271 +src_prepare() {
272 + default
273 + use vala && vala_setup
274 +}
275 +
276 +src_configure() {
277 + local emesonargs=(
278 + $(meson_use gtk-doc gtk_doc)
279 + $(meson_use introspection)
280 + $(meson_use vala vapi)
281 + -Dtools=false # requires vala, freshly promoted tool that some other distros don't ship yet either
282 + # Prevents installation of python modules (uses install_data from meson
283 + # which does not optimize the modules)
284 + -Dpython3=false
285 + )
286 + meson_src_configure
287 +}
288 +
289 +src_install() {
290 + meson_src_install
291 +
292 + if use python ; then
293 + python_moduleinto gi/overrides/
294 + python_foreach_impl python_domodule GExiv2.py
295 + python_foreach_impl python_optimize
296 + fi
297 +}