Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libjcat/, dev-libs/libjcat/files/
Date: Tue, 31 Mar 2020 23:04:53
Message-Id: 1585695819.345a4b1cd1d77d1db99515bc64a71ee546142294.marecki@gentoo
1 commit: 345a4b1cd1d77d1db99515bc64a71ee546142294
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 31 22:54:14 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 31 23:03:39 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=345a4b1c
7
8 dev-libs/libjcat: better control over build-time Python used
9
10 libjcat/meson.build calls a helper Python script which depends on
11 modules 'sys' (core, always present), 'xml' (core, controlled by USE=xml)
12 and 'pkg_resources' (from dev-python/setuptools) - using whatever Python
13 version /usr/bin/python3 points to, which may well provide neither of
14 the latter two modules. Make sure the helper script is invoked using the
15 Python interpreter used to run meson itself, as that one is guaranteed
16 to both provide XML support (the very same import line appears all over
17 the package mesonbuild) and have setuptools (it's in RDEPEND of
18 dev-util/meson).
19
20 Closes: https://bugs.gentoo.org/715670
21 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
22
23 .../files/libjcat-0.1.0-use_right_python.patch | 29 ++++++++++++++++++++++
24 dev-libs/libjcat/libjcat-0.1.0.ebuild | 1 +
25 2 files changed, 30 insertions(+)
26
27 diff --git a/dev-libs/libjcat/files/libjcat-0.1.0-use_right_python.patch b/dev-libs/libjcat/files/libjcat-0.1.0-use_right_python.patch
28 new file mode 100644
29 index 00000000000..9cbc63a08c0
30 --- /dev/null
31 +++ b/dev-libs/libjcat/files/libjcat-0.1.0-use_right_python.patch
32 @@ -0,0 +1,29 @@
33 +By default generate-version-script.py uses /usr/bin/python3, whatever
34 +version that may be - which causes problems if the default python3
35 +installation is one either built without XML support or not included
36 +in PYTHON_TARGETS of dev-python/setuptools. Make sure the script is
37 +invoked using the same interpreter as meson itself, as that one is
38 +already guaranteed to provide both 'xml' and 'pkg_resources'.
39 +
40 +--- a/libjcat/meson.build
41 ++++ b/libjcat/meson.build
42 +@@ -129,6 +129,11 @@
43 + install : true,
44 + )
45 +
46 ++ # Make sure generate-version-script.py is invoked by the same python as meson,
47 ++ # as that one must already have both XML support and setuptools.
48 ++ python = import('python')
49 ++ python_interpreter = python.find_installation()
50 ++
51 + # Verify the map file is correct -- note we can't actually use the generated
52 + # file for two reasons:
53 + #
54 +@@ -141,6 +146,7 @@
55 + input: jcat_gir[0],
56 + output: 'jcat.map',
57 + command: [
58 ++ python_interpreter,
59 + join_paths(meson.source_root(), 'contrib', 'generate-version-script.py'),
60 + 'LIBJCAT',
61 + '@INPUT@',
62
63 diff --git a/dev-libs/libjcat/libjcat-0.1.0.ebuild b/dev-libs/libjcat/libjcat-0.1.0.ebuild
64 index 32863148cd1..0956f965a22 100644
65 --- a/dev-libs/libjcat/libjcat-0.1.0.ebuild
66 +++ b/dev-libs/libjcat/libjcat-0.1.0.ebuild
67 @@ -33,6 +33,7 @@ RESTRICT="!test? ( test )"
68
69 PATCHES=(
70 "${FILESDIR}"/${PN}-0.1.0-disable_installed_tests.patch
71 + "${FILESDIR}"/${PN}-0.1.0-use_right_python.patch
72 )
73
74 src_prepare() {