From: Marek Szuba Date: Tue, 31 Mar 2020 22:54:14 +0000 (+0100) Subject: dev-libs/libjcat: better control over build-time Python used X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=345a4b1cd1d77d1db99515bc64a71ee546142294;p=gentoo.git 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 --- 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() {