From 54deebf9dd04387b29360030a7ae872832cfc96b Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Sun, 13 Sep 2026 19:22:20 +0300 Subject: [PATCH] openscap: upgrade 1.4.3 -> 1.4.4 Upgrade to 1.4.4 and backport an unreleased change to fix building with SWIG 4.5.x. Release notes: https://github.com/OpenSCAP/openscap/releases/tag/1.4.4 Signed-off-by: Scott Murray --- ...Python-2-C-API-macros-for-SWIG-4.5.0.patch | 87 +++++++++++++++++++ .../{openscap_1.4.3.bb => openscap_1.4.4.bb} | 5 +- 2 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 recipes-compliance/openscap/files/0002-Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch rename recipes-compliance/openscap/{openscap_1.4.3.bb => openscap_1.4.4.bb} (96%) diff --git a/recipes-compliance/openscap/files/0002-Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch b/recipes-compliance/openscap/files/0002-Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch new file mode 100644 index 0000000..8711dec --- /dev/null +++ b/recipes-compliance/openscap/files/0002-Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch @@ -0,0 +1,87 @@ +From 26b6cb16a1450d10eb5e14fa4f0ff62d48ff62fd Mon Sep 17 00:00:00 2001 +From: Matthew Burket +Date: Tue, 1 Sep 2026 11:02:05 -0500 +Subject: [PATCH] Replace removed Python 2 C API macros for SWIG 4.5.0 + compatibility + +Back ported from https://src.fedoraproject.org/rpms/openscap/pull-request/35 + +Co-authored-by: Jitka Plesnikova +Upstream-Status: Backport [https://github.com/OpenSCAP/openscap/commit/26b6cb16] +Signed-off-by: Scott Murray +--- + swig/openscap.i | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/swig/openscap.i b/swig/openscap.i +index 7970481f0..1d23b0a32 100644 +--- a/swig/openscap.i ++++ b/swig/openscap.i +@@ -48,8 +48,6 @@ + { + if (PyLong_Check($input)) + $1 = (time_t) PyLong_AsLong($input); +- else if (PyInt_Check($input)) +- $1 = (time_t) PyInt_AsLong($input); + else if (PyFloat_Check($input)) + $1 = (time_t) PyFloat_AsDouble($input); + else { +@@ -80,8 +78,8 @@ + $1 = (char **) malloc((size+1)*sizeof(char *)); + for (i = 0; i < size; i++) { + PyObject *o = PyList_GetItem($input,i); +- /*if (PyString_Check(o))*/ +- $1[i] = PyString_AsString(PyList_GetItem($input,i)); ++ /*if (PyBytes_Check(o))*/ ++ $1[i] = PyBytes_AsString(PyList_GetItem($input,i)); + /*else { + PyErr_SetString(PyExc_TypeError,"list must contain strings"); + free($1); +@@ -329,7 +327,7 @@ int rule_result_output_callback_wrapper(struct xccdf_rule_result* rule_result, v + return -1; + } + Py_DECREF(arglist); +- dres = PyInt_AsLong(result); ++ dres = PyLong_AsLong(result); + Py_XDECREF(result); + PyGILState_Release(state); + return dres; +@@ -366,7 +364,7 @@ int rule_start_callback_wrapper(struct xccdf_rule* rule, void *arg) + return -1; + } + Py_DECREF(arglist); +- dres = PyInt_AsLong(result); ++ dres = PyLong_AsLong(result); + Py_XDECREF(result); + PyGILState_Release(state); + return dres; +@@ -403,7 +401,7 @@ int agent_reporter_callback_wrapper(const struct oval_result_definition* res_def + return -1; + } + Py_DECREF(arglist); +- dres = PyInt_AsLong(result); ++ dres = PyLong_AsLong(result); + Py_XDECREF(result); + PyGILState_Release(state); + return dres; +@@ -438,7 +436,7 @@ int validate_callback_wrapper(const char* file, int line, const char* msg, void + return -1; + } + Py_DECREF(arglist); +- dres = PyInt_AsLong(result); ++ dres = PyLong_AsLong(result); + Py_XDECREF(result); + PyGILState_Release(state); + return dres; +@@ -474,7 +472,7 @@ char * sub_callback_wrapper(xccdf_subst_type_t type, const char *id, void *arg) + return NULL; + } + Py_DECREF(arglist); +- dres = PyString_AsString(result); ++ dres = PyBytes_AsString(result); + if (dres == NULL) { + if (PyErr_Occurred() != NULL) + PyErr_PrintEx(0); +-- +2.47.3 + diff --git a/recipes-compliance/openscap/openscap_1.4.3.bb b/recipes-compliance/openscap/openscap_1.4.4.bb similarity index 96% rename from recipes-compliance/openscap/openscap_1.4.3.bb rename to recipes-compliance/openscap/openscap_1.4.4.bb index 1b6d9af..8f498df 100644 --- a/recipes-compliance/openscap/openscap_1.4.3.bb +++ b/recipes-compliance/openscap/openscap_1.4.4.bb @@ -11,9 +11,10 @@ DEPENDS:class-native = "pkgconfig-native swig-native curl-native libxml2-native SRC_URI = "git://github.com/OpenSCAP/openscap.git;branch=main;protocol=https \ file://0001-CMakeLists.txt-fix-installation-directory-for-system.patch \ - " + file://0002-Replace-removed-Python-2-C-API-macros-for-SWIG-4.5.0.patch \ +" -SRCREV = "24986066961363e24fcff83294995b3cfe4058ba" +SRCREV = "4ac56ce0e6dfdea7215b5ad202b3db20855d2507" COMPATIBLE_HOST:libc-musl = "null"