From 7e52af8fb2961fe9f6a74af359254b3cf17bace0 Mon Sep 17 00:00:00 2001 From: Viorel Munteanu Date: Wed, 17 Apr 2024 20:26:52 +0300 Subject: Update patches for virtualbox 7.0.16 Update Python patch 020 Update libxml2 patch 021 Signed-off-by: Viorel Munteanu --- patches/020_virtualbox-7.0.10-python.patch | 18 --------- patches/020_virtualbox-7.0.16-python.patch | 20 ++++++++++ patches/021_virtualbox-7.0.14-libxml2-2.12.patch | 43 ---------------------- patches/021_virtualbox-7.0.16-libxml2-2.12.5.patch | 33 +++++++++++++++++ 4 files changed, 53 insertions(+), 61 deletions(-) delete mode 100644 patches/020_virtualbox-7.0.10-python.patch create mode 100644 patches/020_virtualbox-7.0.16-python.patch delete mode 100644 patches/021_virtualbox-7.0.14-libxml2-2.12.patch create mode 100644 patches/021_virtualbox-7.0.16-libxml2-2.12.5.patch diff --git a/patches/020_virtualbox-7.0.10-python.patch b/patches/020_virtualbox-7.0.10-python.patch deleted file mode 100644 index f972580..0000000 --- a/patches/020_virtualbox-7.0.10-python.patch +++ /dev/null @@ -1,18 +0,0 @@ -Virtualbox 7.x will only build a lib named VBoxPython3.so, regardless of the -actual python version used when compiling. Remove VBoxPython3m.so, we don't -use it. - ---- a/src/libs/xpcom18a4/python/Makefile.kmk -+++ b/src/libs/xpcom18a4/python/Makefile.kmk -@@ -693,11 +693,6 @@ - VBoxPython3_EXTENDS = VBoxPythonBase - VBoxPython3_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS)) Py_LIMITED_API=0x03030000 - VBoxPython3_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC) -- -- DLLS += VBoxPython3m -- VBoxPython3m_EXTENDS = VBoxPythonBase_m -- VBoxPython3m_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_m_DEFS)) Py_LIMITED_API=0x03030000 -- VBoxPython3m_INCS = $(VBoxPythonBase_m_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC) - endif - endif # VBOX_WITH_PYTHON_LIMITED_API - diff --git a/patches/020_virtualbox-7.0.16-python.patch b/patches/020_virtualbox-7.0.16-python.patch new file mode 100644 index 0000000..d96788e --- /dev/null +++ b/patches/020_virtualbox-7.0.16-python.patch @@ -0,0 +1,20 @@ +Virtualbox 7.x will only build a lib named VBoxPython3.so, regardless of the +actual python version used when compiling. Remove VBoxPython3m.so, we don't +use it. + +--- a/src/libs/xpcom18a4/python/Makefile.kmk ++++ b/src/libs/xpcom18a4/python/Makefile.kmk +@@ -711,13 +711,6 @@ + VBoxPython3_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS)) Py_LIMITED_API=0x03030000 + VBoxPython3_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC) + VBoxPython3_LDFLAGS.darwin = -undefined dynamic_lookup +- +- ifneq ($(KBUILD_TARGET),darwin) +- DLLS += VBoxPython3m +- VBoxPython3m_EXTENDS = VBoxPythonBase_m +- VBoxPython3m_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_m_DEFS)) Py_LIMITED_API=0x03030000 +- VBoxPython3m_INCS = $(VBoxPythonBase_m_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC) +- endif + endif + endif # VBOX_WITH_PYTHON_LIMITED_API + diff --git a/patches/021_virtualbox-7.0.14-libxml2-2.12.patch b/patches/021_virtualbox-7.0.14-libxml2-2.12.patch deleted file mode 100644 index a523bad..0000000 --- a/patches/021_virtualbox-7.0.14-libxml2-2.12.patch +++ /dev/null @@ -1,43 +0,0 @@ -Bug: https://bugs.gentoo.org/922445 - -The change in libxml2 is not backwards compatibe. -A patch like the one in arch does not work with 2.11, so just cast the argument to maintain compatibility with both. - -The upstream change is in include/libxml/xmlerror.h: - - typedef xmlError *xmlErrorPtr; - --typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); -+typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error); - -See also: https://gitlab.archlinux.org/archlinux/packaging/packages/virtualbox/-/blob/main/019-libxml-2-12.patch?ref_type=heads - ---- a/src/VBox/Runtime/r3/xml.cpp -+++ b/src/VBox/Runtime/r3/xml.cpp -@@ -1870,7 +1870,7 @@ - throw std::bad_alloc(); - /* per-thread so it must be here */ - xmlSetGenericErrorFunc(NULL, xmlParserBaseGenericError); -- xmlSetStructuredErrorFunc(NULL, xmlParserBaseStructuredError); -+ xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc)xmlParserBaseStructuredError); - } - - XmlParserBase::~XmlParserBase() -@@ -1931,7 +1931,7 @@ - pcszFilename, - NULL, // encoding = auto - options))) -- throw XmlError(xmlCtxtGetLastError(m_ctxt)); -+ throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt)); - - doc.refreshInternals(); - } -@@ -2191,7 +2191,7 @@ - pcszFilename, - NULL, // encoding = auto - options))) -- throw XmlError(xmlCtxtGetLastError(m_ctxt)); -+ throw XmlError((xmlErrorPtr)xmlCtxtGetLastError(m_ctxt)); - - doc.refreshInternals(); - } diff --git a/patches/021_virtualbox-7.0.16-libxml2-2.12.5.patch b/patches/021_virtualbox-7.0.16-libxml2-2.12.5.patch new file mode 100644 index 0000000..2ef7557 --- /dev/null +++ b/patches/021_virtualbox-7.0.16-libxml2-2.12.5.patch @@ -0,0 +1,33 @@ +Bug: https://bugs.gentoo.org/922445 + +The change in libxml2 is not backwards compatibe. + +The upstream change is in include/libxml/xmlerror.h: + + typedef xmlError *xmlErrorPtr; + +-typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error); ++typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error); + +Upstream fixed it for dev-libs/libxml2-2.12.6, but we need the fix for 2.12.5 as well. + +--- a/src/VBox/Runtime/r3/xml.cpp ++++ b/src/VBox/Runtime/r3/xml.cpp +@@ -1856,7 +1856,7 @@ + va_end(args); + } + +-#if LIBXML_VERSION >= 21206 ++#if LIBXML_VERSION >= 21205 + static void xmlStructuredErrorFunc(void *userData, const xmlError *error) RT_NOTHROW_DEF + { + NOREF(userData); +@@ -1878,7 +1878,7 @@ + throw std::bad_alloc(); + /* per-thread so it must be here */ + xmlSetGenericErrorFunc(NULL, xmlParserBaseGenericError); +-#if LIBXML_VERSION >= 21206 ++#if LIBXML_VERSION >= 21205 + xmlSetStructuredErrorFunc(NULL, xmlStructuredErrorFunc); + #else + xmlSetStructuredErrorFunc(NULL, xmlParserBaseStructuredError); -- cgit v1.2.3-65-gdbad