unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Timotej Lazar <timotej.lazar@araneo.si>
To: 40211@debbugs.gnu.org
Cc: Timotej Lazar <timotej.lazar@araneo.si>
Subject: [bug#40211] [PATCH 1/2] gnu: sdl2: Use udev to discover input devices.
Date: Tue, 24 Mar 2020 15:10:36 +0100	[thread overview]
Message-ID: <20200324141037.28250-1-timotej.lazar@araneo.si> (raw)
In-Reply-To: <87tv2dc0gw.fsf@araneo.si>

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

  reply	other threads:[~2020-03-24 14:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 14:05 [bug#40211] [PATCH 0/2] Enable udev support in SDL2 and bump version Timotej Lazar
2020-03-24 14:10 ` Timotej Lazar [this message]
2020-03-24 14:10   ` [bug#40211] [PATCH 2/2] gnu: sdl2: Update to 2.0.12 Timotej Lazar
2020-04-02 16:27 ` bug#40211: [PATCH 0/2] Enable udev support in SDL2 and bump version Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200324141037.28250-1-timotej.lazar@araneo.si \
    --to=timotej.lazar@araneo.si \
    --cc=40211@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).