From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:55601) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGkHk-0004hR-2w for guix-patches@gnu.org; Tue, 24 Mar 2020 10:12:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGkHi-0003C7-Q0 for guix-patches@gnu.org; Tue, 24 Mar 2020 10:12:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49431) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jGkHi-0003Bi-Ll for guix-patches@gnu.org; Tue, 24 Mar 2020 10:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jGkHi-00053f-Gl for guix-patches@gnu.org; Tue, 24 Mar 2020 10:12:02 -0400 Subject: [bug#40211] [PATCH 1/2] gnu: sdl2: Use udev to discover input devices. Resent-Message-ID: From: Timotej Lazar Date: Tue, 24 Mar 2020 15:10:36 +0100 Message-Id: <20200324141037.28250-1-timotej.lazar@araneo.si> In-Reply-To: <87tv2dc0gw.fsf@araneo.si> References: <87tv2dc0gw.fsf@araneo.si> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 40211@debbugs.gnu.org Cc: Timotej Lazar 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