Control: retitle -1 virtualbox: unnecessary Build-Depends on SDL 1.2
Control: tags -1 + patch

On Sun, 18 Jun 2023 at 18:12:37 +0100, Simon McVittie wrote:
This package has a Build-Depends on SDL version 1.2, which
is unmaintained upstream. I don't see any sign of a runtime dependency
on SDL 1.2, though, only SDL 2 - is the build-dependency left over from
before the upstream package was converted to SDL 2?

It looks as though ./configure also checks for SDL 1.2, but then the result of that check isn't really used for anything (except possibly enabling SDL2 support), and the actual build system uses SDL2.

Please consider the attached patch. I tried building with and without this patch in current unstable and compared the results using diffoscope, and the only differences seem to be in build-IDs. Not tested beyond that, I don't use Virtualbox myself.

    smcv
>From 958325d56bde2f1f323ed186803ea681bf3eebeb Mon Sep 17 00:00:00 2001
From: Simon McVittie <[email protected]>
Date: Sun, 15 Nov 2026 12:44:27 +0000
Subject: [PATCH] d/control, d/patches: Don't require obsolete SDL 1.2

The build system still checks for it, but the built binaries used SDL2
instead.

Closes: #1038591
---
 debian/control                                |  1 -
 ...for-SDL2-instead-of-obsolete-SDL-1.2.patch | 52 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/configure-Check-for-SDL2-instead-of-obsolete-SDL-1.2.patch

diff --git a/debian/control b/debian/control
index 146f4984..484b9253 100644
--- a/debian/control
+++ b/debian/control
@@ -41,7 +41,6 @@ Build-Depends: bzip2,
                libqt6opengl6-dev,
                qt6-scxml-dev,
                qt6-tools-dev,
-               libsdl1.2-dev,
                libsdl2-dev,
                libssl-dev,
 #               libslirp-dev,
diff --git a/debian/patches/configure-Check-for-SDL2-instead-of-obsolete-SDL-1.2.patch b/debian/patches/configure-Check-for-SDL2-instead-of-obsolete-SDL-1.2.patch
new file mode 100644
index 00000000..a940ec3c
--- /dev/null
+++ b/debian/patches/configure-Check-for-SDL2-instead-of-obsolete-SDL-1.2.patch
@@ -0,0 +1,52 @@
+From: Simon McVittie <[email protected]>
+Date: Sun, 15 Nov 2026 12:43:19 +0000
+Subject: configure: Check for SDL2 instead of obsolete SDL 1.2
+
+Bug-Debian: https://bugs.debian.org/1038591
+---
+ configure | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/configure b/configure
+index 61eefae..e97d4a7 100755
+--- a/configure
++++ b/configure
+@@ -1149,7 +1149,7 @@ EOF
+ 
+ #
+ # Check for the SDL library, needed by VBoxSDL and VirtualBox
+-# We depend at least on version 1.2.7
++# We depend at least on version 2.0.0
+ #
+ check_sdl()
+ {
+@@ -1169,11 +1169,11 @@ check_sdl()
+       fail
+     fi
+   else
+-    if which_wrapper sdl-config > /dev/null; then
+-      FLGSDL=`sdl-config --cflags`
++    if which_wrapper pkg-config > /dev/null; then
++      FLGSDL=`pkg-config sdl2 --cflags`
+       INCSDL=`strip_I "$FLGSDL"`
+-      LIBSDL=`sdl-config --libs`
+-      LIBSDLMAIN="-lSDLmain"
++      LIBSDL=`pkg-config sdl2 --libs`
++      LIBSDLMAIN="-lSDL2main"
+       FLDSDL=
+       foundsdl=1
+     fi
+@@ -1189,11 +1189,11 @@ extern "C" int main(int argc, char** argv)
+ {
+   printf("found version %d.%d.%d",
+          SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
+-#if SDL_VERSION_ATLEAST(1,2,15)
++#if SDL_VERSION_ATLEAST(2,0,0)
+   printf(", OK.\n");
+   return 0;
+ #else
+-  printf(", expected version 1.2.15 or higher\n");
++  printf(", expected version 2.0.0 or higher\n");
+   return 1;
+ #endif
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 35c46059..72c8b24c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,3 +15,4 @@
 37-do-not-run-if-not-in-vm.patch
 #system-libslirp.patch
 024-soapC.patch
+configure-Check-for-SDL2-instead-of-obsolete-SDL-1.2.patch
-- 
2.55.0

Reply via email to