From f90b15aef37da5207e4e9ecfa60b940290c9f2d95f7ea8194f0f7e2e8afaf34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Thu, 7 Sep 2017 08:20:20 +0000 Subject: [PATCH] Accepting request 521908 from home:cbosdonnat:branches:Virtualization - Tweak configuration before building for python3 or PyString_* symbols will still be missing OBS-URL: https://build.opensuse.org/request/show/521908 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=403 --- libguestfs.changes | 6 ++++++ libguestfs.spec | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libguestfs.changes b/libguestfs.changes index f178929..6def7f9 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 4 19:15:25 UTC 2017 - cbosdonnat@suse.com + +- Tweak configuration before building for python3 or PyString_* + symbols will still be missing + ------------------------------------------------------------------- Thu Aug 31 15:25:06 UTC 2017 - cbosdonnat@suse.com diff --git a/libguestfs.spec b/libguestfs.spec index 755f159..9ead920 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -653,8 +653,16 @@ pushd python sed -i -e "s:libraries=:library_dirs=['$RPM_BUILD_ROOT/%{_libdir}'], libraries=:" setup.py make stamp-extra-files # Build needs libguestfs library to be installed -%python_build -%python_install + +# HACKY! Change config.h for python2 +echo '#define HAVE_PYSTRING_ASSTRING 1' >> config.h +%python2_build +%python2_install + +# HACKY! Change config.h for python3 +sed 's/\(#define HAVE_PYSTRING_ASSTRING 1\)/\/* \1 *\//' -i config.h +%python3_build +%python3_install popd %endif