summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@eng.windriver.com>2024-02-06 14:46:15 +0800
committerArmin Kuster <akuster808@gmail.com>2024-02-20 07:40:39 -0500
commit6f7f2b6b470aaf8d66e3d63c45973885e5d6f336 (patch)
tree16644c70da9d5704f615d9c07ed0413f302bfb98
parent06979d554847d413cc59a219a60d3c4f6073aeed (diff)
downloadmeta-security-6f7f2b6b470aaf8d66e3d63c45973885e5d6f336.tar.gz
openscap: fix build with python 3.12
Backport a patch to fix build with python 3.12: $ bitbake openscap-native Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'distutils' CMake Error at swig/python3/CMakeLists.txt:35 (install): install TARGETS given no LIBRARY DESTINATION for module target "_openscap_py". Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--recipes-compliance/openscap/files/0001-Replace-distutils.sysconfig-with-sysconfig.patch57
-rw-r--r--recipes-compliance/openscap/openscap_1.3.9.bb4
2 files changed, 60 insertions, 1 deletions
diff --git a/recipes-compliance/openscap/files/0001-Replace-distutils.sysconfig-with-sysconfig.patch b/recipes-compliance/openscap/files/0001-Replace-distutils.sysconfig-with-sysconfig.patch
new file mode 100644
index 0000000..f3f8cf7
--- /dev/null
+++ b/recipes-compliance/openscap/files/0001-Replace-distutils.sysconfig-with-sysconfig.patch
@@ -0,0 +1,57 @@
1From 9a8e01f8421f92f40b4cbff6cf055538e9a0b0ae Mon Sep 17 00:00:00 2001
2From: Evgeny Kolesnikov <ekolesni@redhat.com>
3Date: Thu, 25 Jan 2024 21:37:05 +0100
4Subject: [PATCH] Replace distutils.sysconfig with sysconfig
5
6Upstream-Status: Backport
7[https://github.com/OpenSCAP/openscap/commit/9a8e01f8421f92f40b4cbff6cf055538e9a0b0ae]
8
9Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
10---
11 docs/developer/developer.adoc | 2 +-
12 swig/python3/CMakeLists.txt | 2 +-
13 utils/CMakeLists.txt | 2 +-
14 3 files changed, 3 insertions(+), 3 deletions(-)
15
16diff --git a/docs/developer/developer.adoc b/docs/developer/developer.adoc
17index 77c6d5161..e923069cc 100644
18--- a/docs/developer/developer.adoc
19+++ b/docs/developer/developer.adoc
20@@ -113,7 +113,7 @@ On Ubuntu 18.04 and potentially other distro, the python3 dist-packages path is
21 If the following command:
22
23 ----
24-$ python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
25+$ python3 -c "import sysconfig; print(sysconfig.get_path('platlib'))"
26 ----
27
28 returns "/usr/local/lib/python3/dist-packages" instead of a path like
29diff --git a/swig/python3/CMakeLists.txt b/swig/python3/CMakeLists.txt
30index 2594cf000..5f301326c 100644
31--- a/swig/python3/CMakeLists.txt
32+++ b/swig/python3/CMakeLists.txt
33@@ -26,7 +26,7 @@ add_custom_target(python3_compile ALL DEPENDS ${PYTHON_COMPILED_FILES})
34
35 if(NOT PYTHON_SITE_PACKAGES_INSTALL_DIR)
36 execute_process(COMMAND
37- ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))"
38+ ${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_path('platlib'))"
39 OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_INSTALL_DIR
40 OUTPUT_STRIP_TRAILING_WHITESPACE
41 )
42diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
43index 93ce1f2a9..9347c2976 100644
44--- a/utils/CMakeLists.txt
45+++ b/utils/CMakeLists.txt
46@@ -91,7 +91,7 @@ if(ENABLE_OSCAP_UTIL_DOCKER)
47
48 if(NOT PYTHON_SITE_PACKAGES_INSTALL_DIR)
49 execute_process(COMMAND
50- ${OSCAP_DOCKER_PYTHON} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False, False, prefix='${CMAKE_INSTALL_PREFIX}'))"
51+ ${OSCAP_DOCKER_PYTHON} -c "import sysconfig; print(sysconfig.get_path('purelib'))"
52 OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_INSTALL_DIR
53 OUTPUT_STRIP_TRAILING_WHITESPACE
54 )
55--
562.25.1
57
diff --git a/recipes-compliance/openscap/openscap_1.3.9.bb b/recipes-compliance/openscap/openscap_1.3.9.bb
index 97261df..d956ff1 100644
--- a/recipes-compliance/openscap/openscap_1.3.9.bb
+++ b/recipes-compliance/openscap/openscap_1.3.9.bb
@@ -11,7 +11,9 @@ DEPENDS:class-native = "pkgconfig-native swig-native curl-native libxml2-native
11 11
12#Jun 22th, 2023 12#Jun 22th, 2023
13SRCREV = "9b3e7563575f7e5b419f8a09999b40f30e3e7c29" 13SRCREV = "9b3e7563575f7e5b419f8a09999b40f30e3e7c29"
14SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https" 14SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=maint-1.3;protocol=https \
15 file://0001-Replace-distutils.sysconfig-with-sysconfig.patch \
16 "
15 17
16S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
17 19