From 14aca129c7f6757aab9ff974ec110f7eaff06146f7e5bf770956adad0657d70e Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Fri, 12 May 2023 22:20:52 +0000 Subject: [PATCH 1/3] Accepting request 1086821 from home:dirkmueller:Factory - update python311.patch to also detect vboxpython module with python 3.11 OBS-URL: https://build.opensuse.org/request/show/1086821 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=694 --- python311.patch | 55 +++++++++++++++++++++++++++++++++++++--------- virtualbox.changes | 5 +++++ 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/python311.patch b/python311.patch index 187b7cc..5578b52 100644 --- a/python311.patch +++ b/python311.patch @@ -1,8 +1,8 @@ -diff --git a/configure b/configure -index 0872ec4c..037680e0 100755 ---- a/configure -+++ b/configure -@@ -2132,7 +2132,7 @@ extern "C" int main(void) +Index: VirtualBox-7.0.8/configure +=================================================================== +--- VirtualBox-7.0.8.orig/configure ++++ VirtualBox-7.0.8/configure +@@ -2137,7 +2137,7 @@ extern "C" int main(void) } EOF found= @@ -11,11 +11,11 @@ index 0872ec4c..037680e0 100755 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 -diff --git a/src/VBox/Installer/linux/routines.sh b/src/VBox/Installer/linux/routines.sh -index 08e06358..44eba726 100644 ---- a/src/VBox/Installer/linux/routines.sh -+++ b/src/VBox/Installer/linux/routines.sh -@@ -446,7 +446,7 @@ maybe_run_python_bindings_installer() { +Index: VirtualBox-7.0.8/src/VBox/Installer/linux/routines.sh +=================================================================== +--- VirtualBox-7.0.8.orig/src/VBox/Installer/linux/routines.sh ++++ VirtualBox-7.0.8/src/VBox/Installer/linux/routines.sh +@@ -444,7 +444,7 @@ maybe_run_python_bindings_installer() { # the VirtualBox API bindings. Needs to prevent double installs which waste # quite a bit of time. PYTHONS="" @@ -24,3 +24,38 @@ index 08e06358..44eba726 100644 if [ "`$p -c 'import sys if sys.version_info >= (2, 6) and (sys.version_info < (3, 0) or sys.version_info >= (3, 3)): print(\"test\")' 2> /dev/null`" != "test" ]; then +Index: VirtualBox-7.0.8/src/libs/xpcom18a4/python/gen_python_deps.py +=================================================================== +--- VirtualBox-7.0.8.orig/src/libs/xpcom18a4/python/gen_python_deps.py ++++ VirtualBox-7.0.8/src/libs/xpcom18a4/python/gen_python_deps.py +@@ -24,7 +24,7 @@ SPDX-License-Identifier: GPL-3.0-only + + from __future__ import print_function + import os,sys +-from distutils.version import StrictVersion ++from packaging import version + + 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"] +@@ -120,7 +120,7 @@ def main(argv): + realversion = v[:-1] + else: + realversion = v +- if StrictVersion(realversion) < StrictVersion('2.6'): ++ if version.parse(realversion) < version.parse('2.6'): + continue + for p in prefixes: + c = checkPair(p, v, dllpre, dllsuff, bitness_magic) +Index: VirtualBox-7.0.8/src/libs/xpcom18a4/python/Makefile.kmk +=================================================================== +--- VirtualBox-7.0.8.orig/src/libs/xpcom18a4/python/Makefile.kmk ++++ VirtualBox-7.0.8/src/libs/xpcom18a4/python/Makefile.kmk +@@ -753,7 +753,7 @@ ifdef VBOX_PYTHONDEF_INC + # TODO: ASSUMING that we don't need a different headers for pymalloc + # ('m' builds < 3.8) and CRT malloc. + # +- VBOX_PYTHON_LIMITED_API_VER := $(firstword $(foreach ver, 35 36 38 39 310 34 33 \ ++ VBOX_PYTHON_LIMITED_API_VER := $(firstword $(foreach ver, 35 36 38 39 310 311 34 33 \ + ,$(if-expr defined(VBOX_PYTHON$(ver)_INC),$(ver),)$(if-expr defined(VBOX_PYTHON$(ver)M_INC),$(ver)M,))) + ifneq ($(VBOX_PYTHON_LIMITED_API_VER),) + DLLS += VBoxPython3 diff --git a/virtualbox.changes b/virtualbox.changes index dd66767..a4a18f8 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri May 12 20:35:44 UTC 2023 - Dirk Müller + +- update python311.patch to also detect vboxpython module with python 3.11 + ------------------------------------------------------------------- Mon May 8 18:26:38 UTC 2023 - Larry Finger From 75e9780549124aaad57947917005124917d3301b84ceddcb09beb60b38a0ebae Mon Sep 17 00:00:00 2001 From: Larry Rainey Date: Sat, 13 May 2023 22:10:52 +0000 Subject: [PATCH 2/3] Accepting request 1087024 from home:lwfinger:branches:Virtualization - Patch python311.patch fails on Leap 15.4 and Leap 15.5. Change spec file so that it is only applied for Tumbleweed. OBS-URL: https://build.opensuse.org/request/show/1087024 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=695 --- virtualbox.changes | 6 ++++++ virtualbox.spec | 2 ++ 2 files changed, 8 insertions(+) diff --git a/virtualbox.changes b/virtualbox.changes index a4a18f8..62bdf47 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat May 13 20:07:37 UTC 2023 - Larry Finger + +- Patch python311.patch fails on Leap 15.4 and Leap 15.5. Change spec file so thqt it is only + applied for Tumbleweed. + ------------------------------------------------------------------- Fri May 12 20:35:44 UTC 2023 - Dirk Müller diff --git a/virtualbox.spec b/virtualbox.spec index 271f9cc..ec4c19b 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -475,7 +475,9 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %patch36 -p1 %endif %patch37 -p1 +%if 0%{?sle_version} > 150600 %patch38 -p1 +%endif ### Documents for virtualbox main package ### %if %{main_package} From a25f8dafa7b2418f74e57dad2bf548bfa02251bc284604ed4d504824528ef3f4 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 14 May 2023 16:52:15 +0000 Subject: [PATCH 3/3] - update python311.patch: remove changes that only work on Tumbleweed OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=696 --- python311.patch | 24 ------------------------ virtualbox.changes | 6 ++++++ virtualbox.spec | 2 -- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/python311.patch b/python311.patch index 5578b52..64fa32d 100644 --- a/python311.patch +++ b/python311.patch @@ -24,30 +24,6 @@ Index: VirtualBox-7.0.8/src/VBox/Installer/linux/routines.sh if [ "`$p -c 'import sys if sys.version_info >= (2, 6) and (sys.version_info < (3, 0) or sys.version_info >= (3, 3)): print(\"test\")' 2> /dev/null`" != "test" ]; then -Index: VirtualBox-7.0.8/src/libs/xpcom18a4/python/gen_python_deps.py -=================================================================== ---- VirtualBox-7.0.8.orig/src/libs/xpcom18a4/python/gen_python_deps.py -+++ VirtualBox-7.0.8/src/libs/xpcom18a4/python/gen_python_deps.py -@@ -24,7 +24,7 @@ SPDX-License-Identifier: GPL-3.0-only - - from __future__ import print_function - import os,sys --from distutils.version import StrictVersion -+from packaging import version - - 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"] -@@ -120,7 +120,7 @@ def main(argv): - realversion = v[:-1] - else: - realversion = v -- if StrictVersion(realversion) < StrictVersion('2.6'): -+ if version.parse(realversion) < version.parse('2.6'): - continue - for p in prefixes: - c = checkPair(p, v, dllpre, dllsuff, bitness_magic) -Index: VirtualBox-7.0.8/src/libs/xpcom18a4/python/Makefile.kmk -=================================================================== --- VirtualBox-7.0.8.orig/src/libs/xpcom18a4/python/Makefile.kmk +++ VirtualBox-7.0.8/src/libs/xpcom18a4/python/Makefile.kmk @@ -753,7 +753,7 @@ ifdef VBOX_PYTHONDEF_INC diff --git a/virtualbox.changes b/virtualbox.changes index 62bdf47..b51ae0b 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun May 14 16:51:46 UTC 2023 - Dirk Müller + +- update python311.patch: remove changes that only work on + Tumbleweed + ------------------------------------------------------------------- Sat May 13 20:07:37 UTC 2023 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index ec4c19b..271f9cc 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -475,9 +475,7 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %patch36 -p1 %endif %patch37 -p1 -%if 0%{?sle_version} > 150600 %patch38 -p1 -%endif ### Documents for virtualbox main package ### %if %{main_package}