summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2020-03-31 23:54:14 +0100
committerMarek Szuba <marecki@gentoo.org>2020-04-01 00:03:39 +0100
commit345a4b1cd1d77d1db99515bc64a71ee546142294 (patch)
tree86732c0ea75f2f4169db03b09c6d4e3e9b444994
parentapp-editors/nano: Bump to version 4.9.1 (diff)
downloadgentoo-345a4b1c.tar.gz
gentoo-345a4b1c.tar.bz2
gentoo-345a4b1c.zip
dev-libs/libjcat: better control over build-time Python used
libjcat/meson.build calls a helper Python script which depends on modules 'sys' (core, always present), 'xml' (core, controlled by USE=xml) and 'pkg_resources' (from dev-python/setuptools) - using whatever Python version /usr/bin/python3 points to, which may well provide neither of the latter two modules. Make sure the helper script is invoked using the Python interpreter used to run meson itself, as that one is guaranteed to both provide XML support (the very same import line appears all over the package mesonbuild) and have setuptools (it's in RDEPEND of dev-util/meson). Closes: https://bugs.gentoo.org/715670 Signed-off-by: Marek Szuba <marecki@gentoo.org>
-rw-r--r--dev-libs/libjcat/files/libjcat-0.1.0-use_right_python.patch29
-rw-r--r--dev-libs/libjcat/libjcat-0.1.0.ebuild1
2 files changed, 30 insertions, 0 deletions
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
new file mode 100644
index 000000000000..9cbc63a08c01
--- /dev/null
+++ b/dev-libs/libjcat/files/libjcat-0.1.0-use_right_python.patch
@@ -0,0 +1,29 @@
+By default generate-version-script.py uses /usr/bin/python3, whatever
+version that may be - which causes problems if the default python3
+installation is one either built without XML support or not included
+in PYTHON_TARGETS of dev-python/setuptools. Make sure the script is
+invoked using the same interpreter as meson itself, as that one is
+already guaranteed to provide both 'xml' and 'pkg_resources'.
+
+--- a/libjcat/meson.build
++++ b/libjcat/meson.build
+@@ -129,6 +129,11 @@
+ install : true,
+ )
+
++ # Make sure generate-version-script.py is invoked by the same python as meson,
++ # as that one must already have both XML support and setuptools.
++ python = import('python')
++ python_interpreter = python.find_installation()
++
+ # Verify the map file is correct -- note we can't actually use the generated
+ # file for two reasons:
+ #
+@@ -141,6 +146,7 @@
+ input: jcat_gir[0],
+ output: 'jcat.map',
+ command: [
++ python_interpreter,
+ join_paths(meson.source_root(), 'contrib', 'generate-version-script.py'),
+ 'LIBJCAT',
+ '@INPUT@',
diff --git a/dev-libs/libjcat/libjcat-0.1.0.ebuild b/dev-libs/libjcat/libjcat-0.1.0.ebuild
index 32863148cd11..0956f965a22b 100644
--- a/dev-libs/libjcat/libjcat-0.1.0.ebuild
+++ b/dev-libs/libjcat/libjcat-0.1.0.ebuild
@@ -33,6 +33,7 @@ RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-0.1.0-disable_installed_tests.patch
+ "${FILESDIR}"/${PN}-0.1.0-use_right_python.patch
)
src_prepare() {