commit 67749b10da75c0d80d2a83fe5eece772c10704db
Author: Robert-André Mauchin <zebob.m(a)gmail.com>
Date: Sat Jun 25 19:05:43 2022 +0200
Rebuilt for Python 3.11
...Added-support-for-running-with-Python-3.1.patch | 74 ++++++++++++++++++----
VirtualBox-6.1.34-build-xpcom18a4-with-c++17.patch | 12 ++++
VirtualBox.spec | 8 ++-
3 files changed, 81 insertions(+), 13 deletions(-)
---
diff --git a/0001-libs-xpcom-Added-support-for-running-with-Python-3.1.patch
b/0001-libs-xpcom-Added-support-for-running-with-Python-3.1.patch
index 2ca8df0..97d0f33 100644
--- a/0001-libs-xpcom-Added-support-for-running-with-Python-3.1.patch
+++ b/0001-libs-xpcom-Added-support-for-running-with-Python-3.1.patch
@@ -21,16 +21,16 @@ index f525dd60cf2..39782f6ff21 100755
#
-# Copyright (C) 2006-2020 Oracle Corporation
-+# Copyright (C) 2006-2021 Oracle Corporation
++# Copyright (C) 2006-2022 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from
http://www.virtualbox.org. This file is free software;
-@@ -2043,7 +2043,7 @@ extern "C" int main(void)
+@@ -2027,7 +2027,7 @@ extern "C" int main(void)
}
EOF
found=
- SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4
python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8
python3.8m python3.9 python3.9m"
-+ SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4
python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8
python3.8m python3.9 python3.9m python3.10 python3.10m"
++ SUPPYTHONLIBS="python2.7 python2.6 python3.1 python3.2 python3.3 python3.4
python3.4m python3.5 python3.5m python3.6 python3.6m python3.7 python3.7m python3.8
python3.8m python3.9 python3.9m python3.10 python3.10m python3.11 python3.11m"
for p in $PYTHONDIR; do
for d in $SUPPYTHONLIBS; do
for b in lib/x86_64-linux-gnu lib/i386-linux-gnu lib64 lib/64 lib; do
@@ -43,20 +43,20 @@ index 23272feb0d7..84cd3e863e7 100644
#
-# Copyright (C) 2009-2017 Oracle Corporation
-+# Copyright (C) 2009-2021 Oracle Corporation
++# Copyright (C) 2009-2022 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from
http://www.virtualbox.org. This file is free software;
-@@ -20,7 +20,7 @@ include $(KBUILD_PATH)/subheader.kmk
+@@ -26,7 +26,7 @@ endif
#
# List of supported Python versions, defining a number of
-#
VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|DEF]_[INC|LIB]
variables
-+#
VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|310|310M|DEF]_[INC|LIB]
variables
++#
VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|310|310M|311|311M|DEF]_[INC|LIB]
variables
# which get picked up below.
#
ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script.
-@@ -646,6 +646,52 @@ VBoxPython3_9m_x86_LIBS = $(VBOX_PYTHON39M_LIB_X86)
+@@ -579,6 +579,98 @@ VBoxPython3_9m_x86_LIBS = $(VBOX_P
endif
endif
@@ -106,10 +106,56 @@ index 23272feb0d7..84cd3e863e7 100644
+ endif
+endif
+
++ifdef VBOX_PYTHON311_INC
++#
++# Python 3.11 version
++#
++DLLS += VBoxPython3_11
++VBoxPython3_11_EXTENDS = VBoxPythonBase
++VBoxPython3_11_EXTENDS_BY = appending
++VBoxPython3_11_TEMPLATE = XPCOM
++VBoxPython3_11_INCS = $(VBOX_PYTHON311_INC)
++VBoxPython3_11_LIBS = $(VBOX_PYTHON311_LIB)
++
++ ifdef VBOX_WITH_32_ON_64_MAIN_API
++ ifdef VBOX_PYTHON311_LIB_X86
++DLLS += VBoxPython3_11_x86
++VBoxPython3_11_x86_EXTENDS = VBoxPythonBase_x86
++VBoxPython3_11_x86_EXTENDS_BY = appending
++VBoxPython3_11_x86_TEMPLATE = XPCOM
++VBoxPython3_11_x86_INCS = $(VBOX_PYTHON311_INC)
++VBoxPython3_11_x86_LIBS = $(VBOX_PYTHON311_LIB_X86)
++ endif
++ endif
++endif
++
++ifdef VBOX_PYTHON311M_INC
++#
++# Python 3.11 version with pymalloc
++#
++DLLS += VBoxPython3_11m
++VBoxPython3_11m_EXTENDS = VBoxPythonBase_m
++VBoxPython3_11m_EXTENDS_BY = appending
++VBoxPython3_11m_TEMPLATE = XPCOM
++VBoxPython3_11m_INCS = $(VBOX_PYTHON311M_INC)
++VBoxPython3_11m_LIBS = $(VBOX_PYTHON311M_LIB)
++
++ ifdef VBOX_WITH_32_ON_64_MAIN_API
++ ifdef VBOX_PYTHON311M_LIB_X86
++DLLS += VBoxPython3_11m_x86
++VBoxPython3_11m_x86_EXTENDS = VBoxPythonBase_x86_m
++VBoxPython3_11m_x86_EXTENDS_BY = appending
++VBoxPython3_11m_x86_TEMPLATE_ = XPCOM
++VBoxPython3_11m_x86_INCS = $(VBOX_PYTHON311M_INC)
++VBoxPython3_11m_x86_LIBS = $(VBOX_PYTHON311M_LIB_X86)
++ endif
++ endif
++endif
++
ifdef VBOX_PYTHONDEF_INC
#
# Python without versioning
-@@ -730,4 +776,3 @@ VBoxPython-inst-py-xpcom_SOURCES = \
+@@ -634,4 +726,3 @@ VBoxPython-inst-py-xpcom_SOURCES = \
include $(FILE_KBUILD_SUB_FOOTER)
@@ -123,7 +169,7 @@ index b116313add2..d5107975763 100755
"""
-Copyright (C) 2009-2016 Oracle Corporation
-+Copyright (C) 2009-2021 Oracle Corporation
++Copyright (C) 2009-2022 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from
http://www.virtualbox.org. This file is free software;
@@ -132,7 +178,7 @@ index b116313add2..d5107975763 100755
from distutils.version import StrictVersion
-versions = ["2.6", "2.7", "3.1", "3.2",
"3.2m", "3.3", "3.3m", "3.4", "3.4m",
"3.5", "3.5m", "3.6", "3.6m", "3.7",
"3.7m", "3.8", "3.8m", "3.9", "3.9m" ]
-+versions = ["2.6", "2.7", "3.1", "3.2",
"3.2m", "3.3", "3.3m", "3.4", "3.4m",
"3.5", "3.5m", "3.6", "3.6m", "3.7",
"3.7m", "3.8", "3.8m", "3.9", "3.9m",
"3.10", "3.10m" ]
++versions = ["2.6", "2.7", "3.1", "3.2",
"3.2m", "3.3", "3.3m", "3.4", "3.4m",
"3.5", "3.5m", "3.6", "3.6m", "3.7",
"3.7m", "3.8", "3.8m", "3.9", "3.9m",
"3.10", "3.10m", "3.11", "3.11m"]
prefixes = ["/usr", "/usr/local", "/opt",
"/opt/local"]
known = {}
@@ -140,12 +186,16 @@ diff --git a/trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
b/trunk/src/l
index 412f75b2899..d40d2b52384 100644
--- a/trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
+++ b/trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp
-@@ -84,7 +84,11 @@ extern PYXPCOM_EXPORT void PyXPCOM_InterpreterState_Ensure();
+@@ -84,7 +84,15 @@ extern PYXPCOM_EXPORT void PyXPCOM_Inter
# define MANGLE_MODULE_INIT(a_Name) RT_CONCAT(a_Name, MODULE_NAME_SUFFIX)
# endif
# ifdef VBOX_PYXPCOM_VERSIONED
-# if PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
-+# if PY_VERSION_HEX >= 0x030a0000 && PY_VERSION_HEX < 0x030b0000
++# if PY_VERSION_HEX >= 0x030b0000 && PY_VERSION_HEX < 0x030c0000
++# define MODULE_NAME MANGLE_MODULE_NAME("VBoxPython3_11")
++# define initVBoxPython MANGLE_MODULE_INIT(PyInit_VBoxPython3_11)
++
++# elif PY_VERSION_HEX >= 0x030a0000 && PY_VERSION_HEX < 0x030b0000
+# define MODULE_NAME MANGLE_MODULE_NAME("VBoxPython3_10")
+# define initVBoxPython MANGLE_MODULE_INIT(PyInit_VBoxPython3_10)
+
diff --git a/VirtualBox-6.1.34-build-xpcom18a4-with-c++17.patch
b/VirtualBox-6.1.34-build-xpcom18a4-with-c++17.patch
new file mode 100644
index 0000000..6889b22
--- /dev/null
+++ b/VirtualBox-6.1.34-build-xpcom18a4-with-c++17.patch
@@ -0,0 +1,12 @@
+diff -up VirtualBox-6.1.34/src/libs/xpcom18a4/Config.kmk.orig
VirtualBox-6.1.34/src/libs/xpcom18a4/Config.kmk
+--- VirtualBox-6.1.34/src/libs/xpcom18a4/Config.kmk.orig 2022-03-23 00:47:29.000000000
+0100
++++ VirtualBox-6.1.34/src/libs/xpcom18a4/Config.kmk 2022-06-26 14:06:50.563730173 +0200
+@@ -37,7 +37,7 @@ TEMPLATE_XPCOM_ASFLAGS = $(N
+ TEMPLATE_XPCOM_ASFLAGS.x86 = -m32
+ TEMPLATE_XPCOM_ASFLAGS.amd64 = -m64
+ TEMPLATE_XPCOM_ASDEFS = $(NO_SUCH_VARIABLE)
+-TEMPLATE_XPCOM_CXXFLAGS = -g -pipe -ansi -Wall -Wno-unused
-Wno-non-virtual-dtor \
++TEMPLATE_XPCOM_CXXFLAGS = -g -pipe -ansi -Wall -Wno-unused
-Wno-non-virtual-dtor -std=gnu++17 \
+ $(VBOX_GCC_Wno-invalid-offsetof) -Wno-sign-compare -Wno-unused -Wno-ctor-dtor-privacy
\
+ $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \
+ $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_Wno-delete-non-virtual-dtor)
diff --git a/VirtualBox.spec b/VirtualBox.spec
index a938e0c..8348f25 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -39,7 +39,7 @@
Name: VirtualBox
Version: 6.1.34
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: A general-purpose full virtualizer for PC hardware
License: GPLv2 or (GPLv2 and CDDL)
@@ -97,6 +97,8 @@ Patch80: VirtualBox-6.1.4-gcc10.patch
Patch88: VirtualBox-lzf.patch
Patch90: 0001-libs-xpcom-Added-support-for-running-with-Python-3.1.patch
Patch91: 0002-no_ifndef.patch
+# Force the build of xpcom with -std=gnu++17, mandated by Python 3.11
+Patch92: VirtualBox-6.1.34-build-xpcom18a4-with-c++17.patch
BuildRequires: gcc-c++
BuildRequires: kBuild >= 0.1.9998.r3093
@@ -348,6 +350,7 @@ rm -r src/libs/zlib-1.2.*/
%patch88 -p1 -b .lzf
%patch90 -p2 -b .python3.10
%patch91 -p1 -b .python3.10
+%patch92 -p1 -b .c++17
%build
@@ -904,6 +907,9 @@ getent passwd vboxadd >/dev/null || \
%{_datadir}/%{name}-kmod-%{version}
%changelog
+* Sat Jun 25 2022 Robert-André Mauchin <zebob.m(a)gmail.com> - 6.1.34-5
+- Rebuilt for Python 3.11
+
* Sat Jun 04 2022 Sérgio Basto <sergio(a)serjux.com> - 6.1.34-4
- use opensuse patch for kernel 5.18