Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / sdl.scm
index feb6879..235353f 100644 (file)
@@ -4,9 +4,12 @@
 ;;; Copyright © 2015, 2017 Sou Bunnbu <iyzsong@member.fsf.org>
 ;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
+;;; Copyright © 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,7 +36,6 @@
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system haskell)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages fcitx)
@@ -41,7 +43,6 @@
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages guile)
-  #:use-module (gnu packages haskell)
   #:use-module (gnu packages ibus)
   #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
                            ;; finding the libGL from mesa at runtime.
                            "LDFLAGS=-lGL")
 
+       #:make-flags '("V=1")            ;build verbosely
+
        #:tests? #f)) ; no check target
     (propagated-inputs
      ;; SDL headers include X11 headers.
      `(("libx11" ,libx11)
-       ("libcap" ,libcap))) ; 'libSDL.la' contain `-lcap'.
+       ("libcap" ,libcap) ; 'libSDL.la' contain `-lcap'.
+       ;; TODO: Since building Mesa with Meson it is now necessary that Mesa is
+       ;; a propogated input. We still need to figure out why, possibly due to a
+       ;; change in pkg-config.
+       ("mesa" ,mesa)))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("libxrandr" ,libxrandr)
-              ("mesa" ,mesa)
               ("glu" ,glu)
               ("alsa-lib" ,alsa-lib)
               ("pulseaudio" ,pulseaudio)))
@@ -102,19 +108,30 @@ joystick, and graphics hardware.")
 (define-public sdl2
   (package (inherit sdl)
     (name "sdl2")
-    (version "2.0.9")
+    (version "2.0.10")
     (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
-               "1c94ndagzkdfqaa838yqg589p1nnqln8mv0hpwfhrkbfczf8cl95"))))
+               "0mqxp6w5jhbq6y1j690g9r3gpzwjxh4czaglw8x05l7hl49nqrdl"))))
     (arguments
      (substitute-keyword-arguments (package-arguments sdl)
        ((#:configure-flags flags)
-        `(append '("--disable-wayland-shared")
+        `(append '("--disable-wayland-shared" "--enable-video-kmsdrm"
+                   "--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))))
     (inputs
      ;; SDL2 needs to be built with ibus support otherwise some systems
@@ -348,6 +365,21 @@ directory.")
          (other other))
        (package-propagated-inputs package)))
 
+(define-public sdl2-gfx
+  (package (inherit sdl-gfx)
+    (name "sdl2-gfx")
+    (version "1.0.4")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "https://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-"
+                              version ".tar.gz"))
+              (sha256
+               (base32
+                "0qk2ax7f7grlxb13ba0ll3zlm8780s7j8fmrhlpxzjgdvldf1q33"))))
+    (propagated-inputs
+     (propagated-inputs-with-sdl2 sdl-gfx))))
+
 (define-public sdl2-image
   (package (inherit sdl-image)
     (name "sdl2-image")
@@ -366,23 +398,39 @@ directory.")
 (define-public sdl2-mixer
   (package (inherit sdl-mixer)
     (name "sdl2-mixer")
-    (version "2.0.2")
-    (source (origin
-              (method url-fetch)
-              (uri
-               (string-append "http://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-"
-                              version ".tar.gz"))
-              (modules '((guix build utils)))
-              (snippet '(begin
-                          ;; Remove bundled libraries.
-                          (delete-file-recursively "external")
-                          #t))
-              (sha256
-               (base32
-                "1fw3kkqi5346ai5if4pxrcbhs5c4vv3a4smgz6fl6kyaxwkmwqaf"))))
+    (version "2.0.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "http://www.libsdl.org/projects/SDL_mixer/release/"
+                       "SDL2_mixer-" version ".tar.gz"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Remove bundled libraries.
+                   (delete-file-recursively "external")
+                   #t))
+       (sha256
+        (base32 "0694vsz5bjkcdgfdra6x9fq8vpzrl8m6q96gh58df7065hw5mkxl"))))
     (propagated-inputs
      (propagated-inputs-with-sdl2 sdl-mixer))))
 
+(define-public sdl2-net
+  (package (inherit sdl-net)
+    (name "sdl2-net")
+    (version "2.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "http://www.libsdl.org/projects/SDL_net/release/"
+                       "SDL2_net-" version ".tar.gz"))
+       (sha256
+        (base32
+         "08cxc1bicmyk89kiks7izw1rlx5ng5n6xpy8fy0zxni3b9z8mkhm"))))
+    (propagated-inputs
+     (propagated-inputs-with-sdl2 sdl-net))))
+
 (define-public sdl2-ttf
   (package (inherit sdl-ttf)
     (name "sdl2-ttf")
@@ -486,15 +534,14 @@ sound and device input (keyboards, joysticks, mice, etc.).")
 (define-public guile-sdl2
   (package
     (name "guile-sdl2")
-    (version "0.3.1")
+    (version "0.4.0")
     (source (origin
               (method url-fetch)
-              (uri (string-append
-                    "https://files.dthompson.us/guile-sdl2/guile-sdl2-"
-                    version ".tar.gz"))
+              (uri (string-append "https://files.dthompson.us/guile-sdl2/"
+                                  "guile-sdl2-" version ".tar.gz"))
               (sha256
                (base32
-                "0bw7x2lx90k4banc5k7yfkn3as93y25gr1xdr225ll7lmij21k64"))))
+                "0zcxwgyadwpbhq6h5mv2569c3kalgra26zc186y9fqiyyzmh1v9s"))))
     (build-system gnu-build-system)
     (arguments
      '(#:make-flags '("GUILE_AUTO_COMPILE=0")
@@ -522,93 +569,3 @@ sound and device input (keyboards, joysticks, mice, etc.).")
 The bindings are written in pure Scheme using Guile's foreign function
 interface.")
     (license lgpl3+)))
-
-(define-public ghc-sdl2
-  (package
-    (name "ghc-sdl2")
-    (version "2.4.1.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://hackage.haskell.org/package/"
-                           "sdl2/sdl2-" version ".tar.gz"))
-       (sha256
-        (base32
-         "0p4b12fmxps0sbnkqdfy0qw19s355yrkw7fgw6xz53wzq706k991"))))
-    (build-system haskell-build-system)
-    (arguments '(#:tests? #f)) ; tests require graphical environment
-    (inputs
-     `(("ghc-exceptions" ,ghc-exceptions)
-       ("ghc-linear" ,ghc-linear)
-       ("ghc-statevar" ,ghc-statevar)
-       ("ghc-text" ,ghc-text)
-       ("ghc-vector" ,ghc-vector)
-       ("sdl2" ,sdl2)))
-    (native-inputs
-     `(("ghc-weigh" ,ghc-weigh)
-       ("pkg-config" ,pkg-config)))
-    (home-page "http://hackage.haskell.org/package/sdl2")
-    (synopsis "High- and low-level bindings to the SDL library")
-    (description
-     "This package contains bindings to the SDL 2 library, in both high- and
-low-level forms.  The @code{SDL} namespace contains high-level bindings, where
-enumerations are split into sum types, and we perform automatic
-error-checking.  The @code{SDL.Raw} namespace contains an almost 1-1
-translation of the C API into Haskell FFI calls.  As such, this does not
-contain sum types nor error checking.  Thus this namespace is suitable for
-building your own abstraction over SDL, but is not recommended for day-to-day
-programming.")
-    (license bsd-3)))
-
-(define-public ghc-sdl2-mixer
-  (package
-    (name "ghc-sdl2-mixer")
-    (version "1.1.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://hackage.haskell.org/package/sdl2-mixer/"
-                           "sdl2-mixer-" version ".tar.gz"))
-       (sha256
-        (base32
-         "1k8avyccq5l9z7bwxigim312yaancxl1sr3q6a96bcm7pnhiak0g"))))
-    (build-system haskell-build-system)
-    (inputs
-     `(("ghc-data-default-class" ,ghc-data-default-class)
-       ("ghc-lifted-base" ,ghc-lifted-base)
-       ("ghc-monad-control" ,ghc-monad-control)
-       ("ghc-sdl2" ,ghc-sdl2)
-       ("ghc-vector" ,ghc-vector)
-       ("sdl2-mixer" ,sdl2-mixer)))
-    (native-inputs
-     `(("pkg-config" ,pkg-config)))
-    (home-page "http://hackage.haskell.org/package/sdl2-mixer")
-    (synopsis "Bindings to SDL2 mixer")
-    (description "This package provides Haskell bindings to
-@code{SDL2_mixer}.")
-    (license bsd-3)))
-
-(define-public ghc-sdl2-image
-  (package
-    (name "ghc-sdl2-image")
-    (version "2.0.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://hackage.haskell.org/package/sdl2-image/"
-                           "sdl2-image-" version ".tar.gz"))
-       (sha256
-        (base32
-         "1pr6dkg73cy9z0w54lrkj9c5bhxj56nl92lxikjy8kz6nyr455rr"))))
-    (build-system haskell-build-system)
-    (inputs
-     `(("ghc-sdl2" ,ghc-sdl2)
-       ("ghc-text" ,ghc-text)
-       ("sdl2-image" ,sdl2-image)))
-    (native-inputs
-     `(("pkg-config" ,pkg-config)))
-    (home-page "http://hackage.haskell.org/package/sdl2-image")
-    (synopsis "Bindings to SDL2_image")
-    (description "This package provides Haskell bindings to
-@code{SDL2_image}.")
-    (license expat)))