Subject: [PATCH] gnu: sdl2: Update to 2.0.7 and enable Wayland backend.

From: Rutger Helling <[email-masked]>
Date: Sun, 05 Nov 2017 12:28:21 +0100

Hey Guix, 

this patch updates SDL2 to 2.0.7 and enables the Wayland backend.

From 8121e1100d56cbafa23a255fa6bd4f8c5b4fc7d3 Mon Sep 17 00:00:00 2001
From: Rutger Helling <[email-masked]>
Date: Sun, 5 Nov 2017 12:01:04 +0100
Subject: [PATCH] gnu: sdl2: Update to 2.0.7 and enable Wayland backend.

* gnu/packages/sdl.scm (sdl2): Update to 2.0.7.
* gnu/packages/sdl.scm (sdl2)[inputs]: Add wayland, wayland-protocols, libxkbcommon.
---
 gnu/packages/sdl.scm | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/sdl.scm b/gnu/packages/sdl.scm
index d3edac14f..eeb5bf5d6 100644
--- a/gnu/packages/sdl.scm
+++ b/gnu/packages/sdl.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2015, 2017 Sou Bunnbu <[email-masked]>
 ;;; Copyright © 2015 Alex Kost <[email-masked]>
 ;;; Copyright © 2016, 2017 Efraim Flashner <[email-masked]>
+;;; Copyright © 2017 Rutger Helling <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu packages audio)
   #:use-module (gnu packages fcitx)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages ibus)
@@ -42,6 +44,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages gl)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:export (sdl-union))
@@ -94,7 +97,7 @@ joystick, and graphics hardware.")
 (define-public sdl2
   (package (inherit sdl)
     (name "sdl2")
-    (version "2.0.5")
+    (version "2.0.7")
     (source (origin
              (method url-fetch)
              (uri
@@ -102,7 +105,21 @@ joystick, and graphics hardware.")
                              version ".tar.gz"))
              (sha256
               (base32
-               "11c75qj1qxmx67iwkvf9z4x69phk301pdn86zzr6jncnap7kh824"))))
+               "0pjdpxla5kh1w1b0shxrx97a116vyy31njxi0jhyvqhk8d6cfdgf"))))
+    (arguments
+     '(;; Explicitly link against shared libraries instead of dlopening them.
+       ;; For X11, ALSA, PulseAudio and Wayland.
+       ;; OpenGL library is still dlopened at runtime.
+       #:configure-flags '("--disable-alsa-shared"
+                           "--disable-pulseaudio-shared"
+                           "--disable-x11-shared"
+                           "--disable-wayland-shared"
+                           ;; Explicitly link with mesa.
+                           ;; This add mesa to libsdl's RUNPATH, to make dlopen
+                           ;; finding the libGL from mesa at runtime.
+                           "LDFLAGS=-lGL")
+
+       #:tests? #f)) ; no check target
     (inputs
      ;; SDL2 needs to be built with ibus support otherwise some systems
      ;; experience a bug where input events are doubled.
@@ -111,7 +128,10 @@ joystick, and graphics hardware.")
      (append `(("dbus" ,dbus)
                ("fcitx" ,fcitx) ; helps with CJK input
                ("glib" ,glib)
-               ("ibus" ,ibus))
+               ("ibus" ,ibus)
+               ("wayland", wayland)
+               ("wayland-protocols", wayland-protocols)
+               ("libxkbcommon", libxkbcommon))
              (package-inputs sdl)))
     (license bsd-3)))
 
-- 
2.15.0