From f7611c90c7d19bc9a891bacaeacaa859b2fdf804d40f8718f3bc67611163f2b3 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 14 Jun 2023 17:38:43 +0000 Subject: [PATCH] Accepting request 1093156 from home:lwfinger:branches:Virtualization - Turn build of VBoxSDL back on Files "fix_sdl_build.patch" and "fixes_for_leap15.4.patch" are added. This update addresses boo#1211941. OBS-URL: https://build.opensuse.org/request/show/1093156 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=698 --- fix_sdl_build.patch | 92 +++++++++++++++++++++++++++++++++++++ fixes_for_leap15.4.patch | 13 ++++++ fixes_for_leap15.5.patch | 13 ++++++ python311.patch | 2 + vbox-python-selection.patch | 38 +++++++-------- vbox-smc-napa.diff | 6 +-- virtualbox.changes | 7 +++ virtualbox.spec | 30 ++++++++---- 8 files changed, 169 insertions(+), 32 deletions(-) create mode 100644 fix_sdl_build.patch create mode 100644 fixes_for_leap15.4.patch diff --git a/fix_sdl_build.patch b/fix_sdl_build.patch new file mode 100644 index 0000000..38e66d8 --- /dev/null +++ b/fix_sdl_build.patch @@ -0,0 +1,92 @@ +Index: VirtualBox-7.0.8/configure +=================================================================== +--- VirtualBox-7.0.8.orig/configure ++++ VirtualBox-7.0.8/configure +@@ -1189,21 +1189,19 @@ check_sdl() + fail + fi + else +- if which_wrapper sdl-config > /dev/null; then +- FLGSDL=`sdl-config --cflags` ++ FLGSDL="-I/usr/include/SDL2 -D_GNU_SOURCE=1 -D_REENTRANT" + INCSDL=`strip_I "$FLGSDL"` +- LIBSDL=`sdl-config --libs` ++ LIBSDL="-L/usr/lib64 -LSDL2" + LIBSDLMAIN="-lSDLmain" + FLDSDL= + foundsdl=1 +- fi + fi + [ "$OS" = "linux" -o "$OS" = "darwin" -o "$OS" = "solaris" ] && LIBSDLMAIN="" + if [ -n "$foundsdl" ]; then + cat > $ODIR.tmp_src.cc << EOF + #include + #include +-#include ++//#include + #undef main + extern "C" int main(int argc, char** argv) + { +@@ -1219,7 +1217,7 @@ extern "C" int main(int argc, char** arg + } + EOF + [ -n "$INCSDL" ] && I_INCSDL=`prefix_I "$INCSDL"` +- if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL SDL; then ++ if test_compile "$LIBSDL $LIBSDLMAIN $I_INCSDL $FLDSDL" SDL2 SDL2; then + if test_execute; then + cnf_append "LIB_SDK_LIBSDL_SDL" "`strip_l "$LIBSDL"`" + cnf_append "SDK_LIBSDL_LIBPATH" "`strip_L "$LIBSDL"`" +@@ -2961,11 +2959,8 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then + [ $WITH_LIBTPMS -eq 1 ] && check_libtpms + [ "$OS" != "darwin" ] && check_png + [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam +- if [ $WITH_SDL -eq 1 ]; then +- check_sdl +- else +- cnf_append "VBOX_WITH_VBOXSDL" "" +- fi ++ check_sdl ++ cnf_append "VBOX_WITH_VBOXSDL" "1" + [ $WITH_SDL_TTF -eq 1 -a $OSE -eq 0 ] && check_sdl_ttf + [ $WITH_X11 -eq 1 ] && check_x + # TODO check for xcomposite-dev (X11/extensions/Xcomposite.h, additions only) +Index: VirtualBox-7.0.8/src/VBox/Frontends/VBoxSDL/Makefile.kmk +=================================================================== +--- VirtualBox-7.0.8.orig/src/VBox/Frontends/VBoxSDL/Makefile.kmk ++++ VirtualBox-7.0.8/src/VBox/Frontends/VBoxSDL/Makefile.kmk +@@ -51,7 +51,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K + PROGRAMS += VBoxSDL + endif + VBoxSDL_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBoxMainClientDll,VBoxMainClientExe) +- VBoxSDL_SDKS = LIBSDL2 ++ VBoxSDL_SDKS = LIBSDL + VBoxSDL_SOURCES = \ + VBoxSDL.cpp \ + Framebuffer.cpp \ +@@ -81,7 +81,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K + endif + ifn1of ($(KBUILD_TARGET), solaris) # Probably wrong with SDL2 + VBoxSDL_LIBS = \ +- $(LIB_SDK_LIBSDL2_SDLMAIN) ++ $(LIB_SDK_LIBSDL_SDLMAIN) + endif + if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # X11 + VBoxSDL_LIBS += \ +@@ -121,7 +121,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K + if 0 + PROGRAMS += tstSDL + tstSDL_TEMPLATE = VBoxR3TstExe +- tstSDL_SDKS = LIBSDL2 ++ tstSDL_SDKS = LIBSDL + tstSDL_INST = $(INST_TESTCASE) + tstSDL_SOURCES = \ + VBoxSDLTest.cpp +@@ -138,7 +138,7 @@ if !defined(VBOX_WITH_HARDENING) || "$(K + $(LIB_RUNTIME) + ifn1of ($(KBUILD_TARGET), solaris) + tstSDL_LIBS += \ +- $(LIB_SDK_LIBSDL2_SDLMAIN) ++ $(LIB_SDK_LIBSDL_SDLMAIN) + endif + + ifdef VBOX_OPENGL diff --git a/fixes_for_leap15.4.patch b/fixes_for_leap15.4.patch new file mode 100644 index 0000000..58dda2d --- /dev/null +++ b/fixes_for_leap15.4.patch @@ -0,0 +1,13 @@ +Index: VirtualBox-7.0.8/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp +=================================================================== +--- VirtualBox-7.0.8.orig/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp ++++ VirtualBox-7.0.8/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp +@@ -710,7 +710,7 @@ static const char *keyModToStr(unsigned + RT_CASE_RET_STR(KMOD_NUM); + RT_CASE_RET_STR(KMOD_CAPS); + RT_CASE_RET_STR(KMOD_MODE); +- RT_CASE_RET_STR(KMOD_SCROLL); ++ RT_CASE_RET_STR(KMOD_RESERVED); + default: + break; + } diff --git a/fixes_for_leap15.5.patch b/fixes_for_leap15.5.patch index 189006a..829d1f8 100644 --- a/fixes_for_leap15.5.patch +++ b/fixes_for_leap15.5.patch @@ -155,3 +155,16 @@ Index: VirtualBox-7.0.8/src/VBox/Additions/linux/drm/vbox_mode.c #include "VBoxVideo.h" +Index: VirtualBox-7.0.8/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp +=================================================================== +--- VirtualBox-7.0.8.orig/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp ++++ VirtualBox-7.0.8/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp +@@ -710,7 +710,7 @@ static const char *keyModToStr(unsigned + RT_CASE_RET_STR(KMOD_NUM); + RT_CASE_RET_STR(KMOD_CAPS); + RT_CASE_RET_STR(KMOD_MODE); +- RT_CASE_RET_STR(KMOD_SCROLL); ++ RT_CASE_RET_STR(KMOD_RESERVED); + default: + break; + } diff --git a/python311.patch b/python311.patch index 64fa32d..4c187a7 100644 --- a/python311.patch +++ b/python311.patch @@ -24,6 +24,8 @@ 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/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/vbox-python-selection.patch b/vbox-python-selection.patch index 7a68262..1155222 100644 --- a/vbox-python-selection.patch +++ b/vbox-python-selection.patch @@ -1,8 +1,8 @@ -Index: VirtualBox-7.0.6/src/bldprogs/scm.cpp +Index: VirtualBox-7.0.8/src/bldprogs/scm.cpp =================================================================== ---- VirtualBox-7.0.6.orig/src/bldprogs/scm.cpp -+++ VirtualBox-7.0.6/src/bldprogs/scm.cpp -@@ -2335,7 +2335,7 @@ static int scmProcessFileInner(PSCMRWSTA +--- VirtualBox-7.0.8.orig/src/bldprogs/scm.cpp ++++ VirtualBox-7.0.8/src/bldprogs/scm.cpp +@@ -2367,7 +2367,7 @@ static int scmProcessFileInner(PSCMRWSTA pszTreatAs = "shell"; else if ( (cchFirst >= 15 && strncmp(pchFirst, "/usr/bin/python", 15) == 0) || (cchFirst >= 19 && strncmp(pchFirst, "/usr/bin/env python", 19) == 0) ) @@ -11,10 +11,10 @@ Index: VirtualBox-7.0.6/src/bldprogs/scm.cpp else if ( (cchFirst >= 13 && strncmp(pchFirst, "/usr/bin/perl", 13) == 0) || (cchFirst >= 17 && strncmp(pchFirst, "/usr/bin/env perl", 17) == 0) ) pszTreatAs = "perl"; -Index: VirtualBox-7.0.6/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec +Index: VirtualBox-7.0.8/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec =================================================================== ---- VirtualBox-7.0.6.orig/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec -+++ VirtualBox-7.0.6/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec +--- VirtualBox-7.0.8.orig/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec ++++ VirtualBox-7.0.8/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec @@ -32,6 +32,9 @@ %define VBOXDOCDIR %{_defaultdocdir}/%NAME% %global __requires_exclude_from ^/usr/lib/virtualbox/VBoxPython.*$|^/usr/lib/python.*$|^.*\\.py$ @@ -25,10 +25,10 @@ Index: VirtualBox-7.0.6/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec Summary: Oracle VM VirtualBox Name: %NAME% -Index: VirtualBox-7.0.6/src/libs/libxml2-2.9.14/libxml.spec.in +Index: VirtualBox-7.0.8/src/libs/libxml2-2.9.14/libxml.spec.in =================================================================== ---- VirtualBox-7.0.6.orig/src/libs/libxml2-2.9.14/libxml.spec.in -+++ VirtualBox-7.0.6/src/libs/libxml2-2.9.14/libxml.spec.in +--- VirtualBox-7.0.8.orig/src/libs/libxml2-2.9.14/libxml.spec.in ++++ VirtualBox-7.0.8/src/libs/libxml2-2.9.14/libxml.spec.in @@ -1,3 +1,4 @@ +%global with_python2 0 %global with_python3 1 @@ -93,10 +93,10 @@ Index: VirtualBox-7.0.6/src/libs/libxml2-2.9.14/libxml.spec.in %if 0%{?with_python3} %files -n python3-%{name} -Index: VirtualBox-7.0.6/src/libs/xpcom18a4/python/src/ErrorUtils.cpp +Index: VirtualBox-7.0.8/src/libs/xpcom18a4/python/src/ErrorUtils.cpp =================================================================== ---- VirtualBox-7.0.6.orig/src/libs/xpcom18a4/python/src/ErrorUtils.cpp -+++ VirtualBox-7.0.6/src/libs/xpcom18a4/python/src/ErrorUtils.cpp +--- VirtualBox-7.0.8.orig/src/libs/xpcom18a4/python/src/ErrorUtils.cpp ++++ VirtualBox-7.0.8/src/libs/xpcom18a4/python/src/ErrorUtils.cpp @@ -438,7 +438,9 @@ char *PyTraceback_AsString(PyObject *exc { // a temp scope so I can use temp locals. @@ -108,10 +108,10 @@ Index: VirtualBox-7.0.6/src/libs/xpcom18a4/python/src/ErrorUtils.cpp #else /* PyUnicode_AsUTF8() is const char * as of Python 3.7, char * earlier. */ const char *tempResult = (const char *)PyUnicode_AsUTF8(obResult); -Index: VirtualBox-7.0.6/src/libs/xpcom18a4/python/src/PyGBase.cpp +Index: VirtualBox-7.0.8/src/libs/xpcom18a4/python/src/PyGBase.cpp =================================================================== ---- VirtualBox-7.0.6.orig/src/libs/xpcom18a4/python/src/PyGBase.cpp -+++ VirtualBox-7.0.6/src/libs/xpcom18a4/python/src/PyGBase.cpp +--- VirtualBox-7.0.8.orig/src/libs/xpcom18a4/python/src/PyGBase.cpp ++++ VirtualBox-7.0.8/src/libs/xpcom18a4/python/src/PyGBase.cpp @@ -183,7 +183,11 @@ PyG_Base::~PyG_Base() // Get the correct interface pointer for this object given the IID. void *PyG_Base::ThisAsIID( const nsIID &iid ) @@ -125,10 +125,10 @@ Index: VirtualBox-7.0.6/src/libs/xpcom18a4/python/src/PyGBase.cpp if (iid.Equals(NS_GET_IID(nsISupports))) return (nsISupports *)(nsIInternalPython *)this; if (iid.Equals(NS_GET_IID(nsISupportsWeakReference))) -Index: VirtualBox-7.0.6/src/libs/xpcom18a4/python/gen_python_deps.py +Index: VirtualBox-7.0.8/src/libs/xpcom18a4/python/gen_python_deps.py =================================================================== ---- VirtualBox-7.0.6.orig/src/libs/xpcom18a4/python/gen_python_deps.py -+++ VirtualBox-7.0.6/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 @@ -96,7 +96,7 @@ def main(argv): else: multi = 1 diff --git a/vbox-smc-napa.diff b/vbox-smc-napa.diff index 24eaf83..53cc4e8 100644 --- a/vbox-smc-napa.diff +++ b/vbox-smc-napa.diff @@ -1,7 +1,7 @@ -Index: VirtualBox-7.0.6/src/VBox/Devices/PC/vbox.dsl +Index: VirtualBox-7.0.8/src/VBox/Devices/PC/vbox.dsl =================================================================== ---- VirtualBox-7.0.6.orig/src/VBox/Devices/PC/vbox.dsl -+++ VirtualBox-7.0.6/src/VBox/Devices/PC/vbox.dsl +--- VirtualBox-7.0.8.orig/src/VBox/Devices/PC/vbox.dsl ++++ VirtualBox-7.0.8/src/VBox/Devices/PC/vbox.dsl @@ -1225,7 +1225,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, Device (SMC) { diff --git a/virtualbox.changes b/virtualbox.changes index b51ae0b..8f10e8f 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jun 14 02:18:18 UTC 2023 - Larry Finger + +- Turn build of VBoxSDL back on + Files "fix_sdl_build.patch" and "fixes_for_leap15.4.patch" are added. + This update addresses boo#1211941. + ------------------------------------------------------------------- Sun May 14 16:51:46 UTC 2023 - Dirk Müller diff --git a/virtualbox.spec b/virtualbox.spec index 271f9cc..7933e23 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -154,6 +154,8 @@ Patch31: fix-missing-includes-with-qt-5.15.patch Patch32: handle_gsoap_208103.patch # Fix for struct file_operations backport in 15.3 Patch33: fixes_for_leap15.3.patch +# Fix for build for 15.4 +Patch34: fixes_for_leap15.4.patch # Fix for backports to 15.5 Patch35: fixes_for_leap15.5.patch # Fix for GCC13 @@ -162,6 +164,7 @@ Patch36: fixes_for_gcc13.patch Patch37: fix_7.0.6_locking_problems.patch # Support python 3.11 Patch38: python311.patch +Patch39: fix_sdl_build.patch # # Common BuildRequires for both virtualbox and virtualbox-kmp BuildRequires: %{kernel_module_package_buildreqs} @@ -186,6 +189,7 @@ Source2: VirtualBox.appdata.xml ### Requirements for virtualbox main package ### %if %{main_package} BuildRequires: LibVNCServer-devel +BuildRequires: SDL2-devel BuildRequires: alsa-devel BuildRequires: device-mapper-devel BuildRequires: dmidecode @@ -195,7 +199,7 @@ BuildRequires: glibc-devel-static BuildRequires: glslang-devel BuildRequires: gsoap-devel >= 2.8.50 BuildRequires: java-devel >= 1.6.0 -BuildRequires: libSDL-devel +#BuildRequires: libSDL2-2_0-0 BuildRequires: libelf-devel BuildRequires: libidl-devel BuildRequires: libopenssl-devel @@ -227,7 +231,7 @@ BuildRequires: pkgconfig(randrproto) BuildRequires: pkgconfig(renderproto) BuildRequires: pkgconfig(resourceproto) BuildRequires: pkgconfig(scrnsaverproto) -#BuildRequires: pkgconfig(sdl) +BuildRequires: pkgconfig(sdl) BuildRequires: pkgconfig(udev) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xau) @@ -468,7 +472,12 @@ This package contains the kernel-modules that VirtualBox uses to create or run v # Patch for Leap 15.3 %patch33 -p1 %endif +%if 0%{?sle_version} == 150400 && 0%{?is_opensuse} +# Patch for Leap 15.4 +%patch34 -p1 +%endif %if 0%{?sle_version} == 150500 && 0%{?is_opensuse} +# Patch for Leap 15.5 %patch35 -p1 %endif %if 0%{gcc_version} >= 13 @@ -476,6 +485,7 @@ This package contains the kernel-modules that VirtualBox uses to create or run v %endif %patch37 -p1 %patch38 -p1 +%patch39 -p1 ### Documents for virtualbox main package ### %if %{main_package} @@ -598,7 +608,7 @@ echo "entering virtualbox(-qt) install section" pushd out/linux.*/release/bin install -m 755 VBoxManage %{buildroot}%{_vbox_instdir} install -m 755 VBoxHeadless %{buildroot}%{_vbox_instdir} -#install -m 755 VBoxSDL %{buildroot}%{_vbox_instdir} +install -m 755 VBoxSDL %{buildroot}%{_vbox_instdir} install -m 755 VBoxNetNAT %{buildroot}%{_vbox_instdir} install -m 755 VBoxAutostart %{buildroot}%{_vbox_instdir} install -m 755 VBoxVolInfo %{buildroot}%{_vbox_instdir} @@ -614,7 +624,7 @@ install -m 755 vboximg-mount %{buildroot}%{_vbox_instdir} # create links to vbox tools in PATH - they could be usefull for controlling vbox from command line ln -s %{_vbox_instdir}/VBoxManage %{buildroot}%{_bindir}/VBoxManage ln -s %{_vbox_instdir}/VBoxHeadless %{buildroot}%{_bindir}/VBoxHeadless -#ln -s %{_vbox_instdir}/VBoxSDL %{buildroot}%{_bindir}/VBoxSDL +ln -s %{_vbox_instdir}/VBoxSDL %{buildroot}%{_bindir}/VBoxSDL ln -s %{_vbox_instdir}/vboximg-mount %{buildroot}%{_bindir}/vboximg-mount install -m 755 VBoxSVC %{buildroot}%{_vbox_instdir} install -m 755 VBoxXPCOMIPCD %{buildroot}%{_vbox_instdir} @@ -805,7 +815,7 @@ done %post qt %set_permissions %{_vbox_instdir}/VirtualBoxVM -#%set_permissions %{_vbox_instdir}/VBoxSDL +%set_permissions %{_vbox_instdir}/VBoxSDL %verifyscript %verify_permissions -e %{_vbox_instdir}/VBoxNetNAT @@ -815,7 +825,7 @@ done %verifyscript qt %verify_permissions -e %{_vbox_instdir}/VirtualBoxVM -#%verify_permissions -e %{_vbox_instdir}/VBoxSDL +%verify_permissions -e %{_vbox_instdir}/VBoxSDL %post guest-tools %service_add_post vboxadd-service.service @@ -889,7 +899,7 @@ export DISABLE_RESTART_ON_UPDATE=yes %doc README.autostart UserManual.pdf README.build %{_bindir}/VBoxManage %{_bindir}/VBoxHeadless -#%{_bindir}/VBoxSDL +%{_bindir}/VBoxSDL %{_bindir}/vboximg-mount %dir %{_vbox_instdir} %{_vbox_instdir}/VBoxAutostart @@ -967,7 +977,7 @@ export DISABLE_RESTART_ON_UPDATE=yes %attr(0755,root,vboxusers) %{_vbox_instdir}/VBoxUSB_DevRules %attr(0755,root,vboxusers) %{_vbox_instdir}/VirtualBox6 %verify(not mode) %attr(0750,root,vboxusers) %{_vbox_instdir}/VirtualBoxVM -#%verify(not mode) %attr(0755,root,vboxusers) %{_vbox_instdir}/VBoxSDL +%verify(not mode) %attr(0755,root,vboxusers) %{_vbox_instdir}/VBoxSDL %{_vbox_instdir}/VirtualBox #wrapper script is in bindir %attr(0755,root,root) %{_bindir}/VirtualBox @@ -979,8 +989,8 @@ export DISABLE_RESTART_ON_UPDATE=yes %{_vbox_instdir}/VBoxSVGA3D.so %{_vbox_instdir}/VirtualBoxVM.so %{_vbox_instdir}/VBoxDbg.so -#%{_bindir}/VBoxSDL -#%{_vbox_instdir}/VBoxSDL.so +%{_bindir}/VBoxSDL +%{_vbox_instdir}/VBoxSDL.so %{_vbox_instdir}/VBoxKeyboard.so %{_vbox_instdir}/VBoxSharedClipboard.so %{_datadir}/pixmaps/virtualbox.png