GNU bug report logs - #40211
[PATCH 0/2] Enable udev support in SDL2 and bump version

Previous Next

Package: guix-patches;

Reported by: Timotej Lazar <timotej.lazar <at> araneo.si>

Date: Tue, 24 Mar 2020 14:06:01 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40211 in the body.
You can then email your comments to 40211 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#40211; Package guix-patches. (Tue, 24 Mar 2020 14:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Timotej Lazar <timotej.lazar <at> araneo.si>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 24 Mar 2020 14:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/2] Enable udev support in SDL2 and bump version
Date: Tue, 24 Mar 2020 15:05:19 +0100
Hi,

these patches update sdl2 to the latest release and enable udev support.
Without udev I experienced freezes every few seconds in certain games
(for instance hedgewars and supertux) as SDL searched through /dev/input
for joysticks.

Since libudev is dlopened, I add it to rpath in make-flags. During build
this overrides LDFLAGS from the base package’s configure-flags, which
add mesa to rpath. AFAICT this is OK as sdl2 already includes mesa by
linking libgbm.

(Perhaps we could move LDFLAGS to make-flags in the base package, and
make the override explicit in the derived package? Or have sdl2 find and
modify the LDFLAGS entry from the base configure-flags, but that seems
more trouble than it’s worth.)

I was able to rebuild all dependent packages with no (new) failures. I
ran several games and everything appears OK, but I don’t have a joystick
or gamepad to try.

There have been some issues in the past with SDL not finding (correct)
libraries¹, so it would be good to test this on a foreign Guix install.
As for the version bump, the changelog² doesn’t mention any significant
changes except for hidapi support, which is disabled by default.

Thanks!
Timotej

¹ https://lists.gnu.org/archive/html/guix-devel/2015-03/msg00585.html
² https://hg.libsdl.org/SDL/file/355a4f94a782/WhatsNew.txt

Timotej Lazar (2):
  gnu: sdl2: Use udev to discover input devices.
  gnu: sdl2: Update to 2.0.12.

 gnu/local.mk                                |  1 -
 gnu/packages/patches/sdl2-mesa-compat.patch | 21 ----------------
 gnu/packages/sdl.scm                        | 27 ++++++++++++---------
 3 files changed, 16 insertions(+), 33 deletions(-)
 delete mode 100644 gnu/packages/patches/sdl2-mesa-compat.patch

-- 
2.25.1




Information forwarded to guix-patches <at> gnu.org:
bug#40211; Package guix-patches. (Tue, 24 Mar 2020 14:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 40211 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: 40211 <at> debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar <at> araneo.si>
Subject: [PATCH 1/2] gnu: sdl2: Use udev to discover input devices.
Date: Tue, 24 Mar 2020 15:10:36 +0100
Without udev SDL falls back on custom detection code, which blocks every three
seconds while checking for new devices.

* gnu/packages/sdl.scm (sdl2)[inputs]: Add eudev.
[arguments]<#:make-flags>: Add LDFLAGS to include eudev in rpath so that
dlopen can find it.
---
 gnu/packages/sdl.scm | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index 25b0bdba2b..8b21f813c9 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -132,20 +132,26 @@ joystick, and graphics hardware.")
                    "--disable-kmsdrm-shared")
                  ,flags))
        ((#:make-flags flags ''())
-        ;; Add the Fcitx header files to GCCs "system header" search path
-        ;; in order to suppress compiler warnings induced by those:
-        ;;   .../include/fcitx-utils/utarray.h:178:9: error: ISO C90 forbids
-        ;;   mixed declarations and code [-Werror=declaration-after-statement]
-        `(append (list (string-append "C_INCLUDE_PATH="
-                                      (assoc-ref %build-inputs "fcitx")
-                                      "/include"))
-                 ,flags))))
+        `(cons*
+          ;; Add the Fcitx header files to GCCs "system header" search path
+          ;; in order to suppress compiler warnings induced by those:
+          ;;   .../include/fcitx-utils/utarray.h:178:9: error: ISO C90 forbids
+          ;;   mixed declarations and code [-Werror=declaration-after-statement]
+          (string-append "C_INCLUDE_PATH="
+                         (assoc-ref %build-inputs "fcitx") "/include")
+          ;; SDL dlopens libudev, so make sure it is in rpath. This overrides
+          ;; the LDFLAG set in sdl’s configure-flags, which isn’t necessary
+          ;; as sdl2 includes Mesa by default.
+          (string-append "LDFLAGS=-Wl,-rpath,"
+                         (assoc-ref %build-inputs "eudev") "/lib")
+          ,flags))))
     (inputs
      ;; SDL2 needs to be built with ibus support otherwise some systems
      ;; experience a bug where input events are doubled.
      ;;
      ;; For more information, see: https://dev.solus-project.com/T1721
      (append `(("dbus" ,dbus)
+               ("eudev" ,eudev) ; for discovering input devices
                ("fcitx" ,fcitx) ; helps with CJK input
                ("glib" ,glib)
                ("ibus" ,ibus)
-- 
2.25.1





Information forwarded to guix-patches <at> gnu.org:
bug#40211; Package guix-patches. (Tue, 24 Mar 2020 14:12:02 GMT) Full text and rfc822 format available.

Message #11 received at 40211 <at> debbugs.gnu.org (full text, mbox):

From: Timotej Lazar <timotej.lazar <at> araneo.si>
To: 40211 <at> debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar <at> araneo.si>
Subject: [PATCH 2/2] gnu: sdl2: Update to 2.0.12.
Date: Tue, 24 Mar 2020 15:10:37 +0100
* gnu/packages/patches/sdl2-mesa-compat.patch: Delete file.
* gnu/packages/sdl.scm (sdl2): Update to 2.0.12.
[source]: Drop patch that was included in this release.
---
 gnu/local.mk                                |  1 -
 gnu/packages/patches/sdl2-mesa-compat.patch | 21 ---------------------
 gnu/packages/sdl.scm                        |  5 ++---
 3 files changed, 2 insertions(+), 25 deletions(-)
 delete mode 100644 gnu/packages/patches/sdl2-mesa-compat.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 7cce60b7c0..ef11ac4a04 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1411,7 +1411,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/scotch-build-parallelism.patch		\
   %D%/packages/patches/scotch-integer-declarations.patch	\
   %D%/packages/patches/sdl-libx11-1.6.patch			\
-  %D%/packages/patches/sdl2-mesa-compat.patch			\
   %D%/packages/patches/seahorse-gkr-use-0-on-empty-flags.patch	\
   %D%/packages/patches/seq24-rename-mutex.patch			\
   %D%/packages/patches/sharutils-CVE-2018-1000097.patch		\
diff --git a/gnu/packages/patches/sdl2-mesa-compat.patch b/gnu/packages/patches/sdl2-mesa-compat.patch
deleted file mode 100644
index 8182e582e7..0000000000
--- a/gnu/packages/patches/sdl2-mesa-compat.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-Do not include GLES header when OpenGL headers are already included.
-
-Taken from upstream:
-https://hg.libsdl.org/SDL/rev/369b01006eb2
-
-diff -r 4cbaffd0083b -r 369b01006eb2 src/video/SDL_video.c
---- a/src/video/SDL_video.c	Fri Oct 11 06:18:24 2019 +0200
-+++ b/src/video/SDL_video.c	Sat Oct 12 18:47:56 2019 +0200
-@@ -37,9 +37,9 @@
- #include "SDL_opengl.h"
- #endif /* SDL_VIDEO_OPENGL */
- 
--#if SDL_VIDEO_OPENGL_ES
-+#if SDL_VIDEO_OPENGL_ES && !SDL_VIDEO_OPENGL
- #include "SDL_opengles.h"
--#endif /* SDL_VIDEO_OPENGL_ES */
-+#endif /* SDL_VIDEO_OPENGL_ES && !SDL_VIDEO_OPENGL */
- 
- /* GL and GLES2 headers conflict on Linux 32 bits */
- #if SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL
-
diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index 8b21f813c9..7b36d5509c 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -115,16 +115,15 @@ joystick, and graphics hardware.")
 (define-public sdl2
   (package (inherit sdl)
     (name "sdl2")
-    (version "2.0.10")
+    (version "2.0.12")
     (source (origin
              (method url-fetch)
              (uri
               (string-append "https://libsdl.org/release/SDL2-"
                              version ".tar.gz"))
-             (patches (search-patches "sdl2-mesa-compat.patch"))
              (sha256
               (base32
-               "0mqxp6w5jhbq6y1j690g9r3gpzwjxh4czaglw8x05l7hl49nqrdl"))))
+               "0qy8wbqvfkb5ps8kxgaaf2zzpkjqbsw712hlp74znbn0jpv6i4il"))))
     (arguments
      (substitute-keyword-arguments (package-arguments sdl)
        ((#:configure-flags flags)
-- 
2.25.1





Reply sent to Marius Bakke <mbakke <at> fastmail.com>:
You have taken responsibility. (Thu, 02 Apr 2020 16:28:02 GMT) Full text and rfc822 format available.

Notification sent to Timotej Lazar <timotej.lazar <at> araneo.si>:
bug acknowledged by developer. (Thu, 02 Apr 2020 16:28:02 GMT) Full text and rfc822 format available.

Message #16 received at 40211-done <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Timotej Lazar <timotej.lazar <at> araneo.si>, 40211-done <at> debbugs.gnu.org
Subject: Re: [bug#40211] [PATCH 0/2] Enable udev support in SDL2 and bump
 version
Date: Thu, 02 Apr 2020 18:27:30 +0200
[Message part 1 (text/plain, inline)]
Timotej,

Timotej Lazar <timotej.lazar <at> araneo.si> writes:

> Hi,
>
> these patches update sdl2 to the latest release and enable udev support.
> Without udev I experienced freezes every few seconds in certain games
> (for instance hedgewars and supertux) as SDL searched through /dev/input
> for joysticks.
>
> Since libudev is dlopened, I add it to rpath in make-flags. During build
> this overrides LDFLAGS from the base package’s configure-flags, which
> add mesa to rpath. AFAICT this is OK as sdl2 already includes mesa by
> linking libgbm.
>
> (Perhaps we could move LDFLAGS to make-flags in the base package, and
> make the override explicit in the derived package? Or have sdl2 find and
> modify the LDFLAGS entry from the base configure-flags, but that seems
> more trouble than it’s worth.)
>
> I was able to rebuild all dependent packages with no (new) failures. I
> ran several games and everything appears OK, but I don’t have a joystick
> or gamepad to try.
>
> There have been some issues in the past with SDL not finding (correct)
> libraries¹, so it would be good to test this on a foreign Guix install.
> As for the version bump, the changelog² doesn’t mention any significant
> changes except for hidapi support, which is disabled by default.

Thank you for the excellent research, bugfix, and patches.

I have applied both and hope that it will fix a longstanding problem
with SuperTuxKart and multiple gamepads that I will try out hopefully
this weekend.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 May 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 354 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.