summary refs log tree commit diff
path: root/gnu/packages/games.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/games.scm')
-rw-r--r--gnu/packages/games.scm69
1 files changed, 58 insertions, 11 deletions
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e2f855aa56..8d987f76eb 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -30,7 +30,7 @@
 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
+;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2017 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;;
@@ -136,6 +136,7 @@
   #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages vulkan)
   #:use-module (gnu packages web)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
@@ -1633,9 +1634,13 @@ either by Infocom or created using the Inform compiler.")
        #:phases
        (modify-phases %standard-phases
          (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (etc (string-append out "/etc")))
+                    (etc (string-append out "/etc"))
+                    (vulkan (assoc-ref inputs "vulkan-icd-loader")))
+               ;; Hard-code the path to libvulkan.so.
+               (substitute* "gfx/common/vulkan_common.c"
+                 (("libvulkan.so") (string-append vulkan "/lib/libvulkan.so")))
                (substitute* "qb/qb.libs.sh"
                  (("/bin/true") (which "true")))
                ;; The configure script does not yet accept the extra arguments
@@ -1658,6 +1663,7 @@ either by Infocom or created using the Inform compiler.")
        ("python" ,python)
        ("sdl" ,sdl2)
        ("udev" ,eudev)
+       ("vulkan-icd-loader" ,vulkan-icd-loader)
        ("wayland", wayland)
        ("zlib" ,zlib)))
     (native-inputs
@@ -2922,9 +2928,6 @@ Transport Tycoon Deluxe.")
     (build-system cmake-build-system)
     (arguments
      `(#:tests? #f ;; no tests available
-       #:configure-flags
-        (list (string-append "-DCMAKE_INSTALL_LIBDIR="
-                       (assoc-ref %outputs "out") "/lib"))
        #:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'fix-usr-share-paths
@@ -3435,12 +3438,8 @@ Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
        #:configure-flags
        (list "-DUSE_LZMA=OFF"           ;do not use bundled LZMA
              "-DUSE_LIBZIP=OFF"         ;use "zlib" instead
-             ;; Validate RUNPATH phase fails ("error: depends on
-             ;; 'libmgba.so.0.6', which cannot be found in RUNPATH") without
-             ;; the following S-exp.
              (string-append "-DCMAKE_INSTALL_LIBDIR="
-                            (assoc-ref %outputs "out")
-                            "/lib"))))
+                            (assoc-ref %outputs "out") "/lib"))))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("ffmpeg" ,ffmpeg)
               ("imagemagick" ,imagemagick)
@@ -5334,6 +5333,54 @@ some graphical niceities, and numerous bug-fixes and other improvements.")
     (home-page "http://quakespasm.sourceforge.net/")
     (license license:gpl2+)))
 
+(define-public vkquake
+  (package
+    (inherit quakespasm)
+    (name "vkquake")
+    (version "0.97.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/Novum/vkQuake/archive/"
+                           version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1p0nh2v2ilylw62fxc5qpfcmyhs0s64w8sgh036nc6kn21kbjc0d"))))
+    (arguments
+     `(#:make-flags
+       (let ((vulkanlib (string-append (assoc-ref %build-inputs
+                                                  "vulkan-icd-loader") "/lib")))
+         (list "CC=gcc"
+               "MP3LIB=mpg123"
+               "USE_CODEC_FLAC=1"
+               "USE_CODEC_MIKMOD=1"
+               "USE_SDL2=1"
+               (string-append "LDFLAGS=-Wl,-rpath=" vulkanlib)
+               "-CQuake"))
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (add-after 'unpack 'fix-makefile-paths
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((vulkan (assoc-ref %build-inputs
+                                               "vulkan-icd-loader"))
+                            (out (assoc-ref outputs "out")))
+                        (mkdir-p (string-append out "/bin"))
+                        (substitute* "Quake/Makefile" ((" /usr")
+                                                       (string-append " " out)))
+                        (substitute* "Quake/Makefile" (("/games")
+                                                       (string-append "/bin")))
+                        (substitute* "Quake/Makefile" (("..VULKAN_SDK.") vulkan))
+                        #t))))
+       ,@(strip-keyword-arguments '(#:make-flags #:phases)
+                                  (package-arguments quakespasm))))
+    (inputs `(("vulkan-icd-loader" ,vulkan-icd-loader)
+              ,@(package-inputs quakespasm)))
+    (description "vkquake is a modern engine for id software's Quake 1.
+It includes support for 64 bit CPUs, custom music playback, a new sound driver,
+some graphical niceities, and numerous bug-fixes and other improvements.")
+    (home-page "https://github.com/Novum/vkQuake")))
+
 (define-public yamagi-quake2
   (package
     (name "yamagi-quake2")