summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-01-28 20:46:03 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2024-01-28 21:03:31 -0500
commit2c5293afffa39d5d4aaec248a1973c7f62b1a0b4 (patch)
tree4552c9e64d00d486d531c388c01f8d455b23ad60 /gnu
parentf74789cd54a9b2c45a06642f0bebb11aed588065 (diff)
downloadguix-2c5293afffa39d5d4aaec248a1973c7f62b1a0b4.tar.gz
gnu: lugaru: Apply patch fixing sound.
* gnu/packages/patches/lugaru-fix-sound.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/games.scm (lugaru) [source]: Update source URL.
Apply patch.
[arguments]: Use gexps.
[inputs]: Remove labels and sort.

Change-Id: Iebefc9fc43d3473e51c8c732539e6aa2f14d9f5f
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/games.scm37
-rw-r--r--gnu/packages/patches/lugaru-fix-sound.patch32
3 files changed, 51 insertions, 19 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 2a88db9f6d..16058ac784 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1646,6 +1646,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lua-liblua-so.patch                      \
   %D%/packages/patches/lua-5.4-pkgconfig.patch			\
   %D%/packages/patches/lua-5.4-liblua-so.patch			\
+  %D%/packages/patches/lugaru-fix-sound.patch			\
   %D%/packages/patches/luit-posix.patch				\
   %D%/packages/patches/mactelnet-remove-init.patch		\
   %D%/packages/patches/mailutils-variable-lookup.patch		\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c6aa873ac7..06ba868f35 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -72,7 +72,7 @@
 ;;; Copyright © 2022 Roman Riabenko <roman@riabenko.com>
 ;;; Copyright © 2022, 2023 zamfofex <zamfofex@twdb.moe>
 ;;; Copyright © 2022 Gabriel Arazas <foo.dogsquared@gmail.com>
-;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2022, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Hendursaga <hendursaga@aol.com>
 ;;; Copyright © 2022 Parnikkapore <poomklao@yahoo.com>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
@@ -7199,27 +7199,26 @@ monsters in a quest to find the mystifyingly fabulous Orb of Zot.")
     (version "1.2")
     (source (origin
               (method url-fetch)
-              (uri (string-append "https://bitbucket.org/osslugaru/lugaru/downloads/"
-                                  "lugaru-" version ".tar.xz"))
+              (uri (string-append "https://github.com/osslugaru/lugaru/releases"
+                                  "/download/" version
+                                  "/lugaru-" version ".tar.xz"))
               (sha256
-               (base32
-                "15zgcshy22q51rm72zi6y9z7qlgnz5iw3gczjdlir4bqmxy4gspk"))))
+               (base32 "15zgcshy22q51rm72zi6y9z7qlgnz5iw3gczjdlir4bqmxy4gspk"))
+              (patches
+               (search-patches "lugaru-fix-sound.patch"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:configure-flags
-       (list "-DSYSTEM_INSTALL=ON")
-       ;; no test target
-       #:tests? #f))
-    (native-inputs
-     (list pkg-config))
+     (list #:configure-flags #~(list "-DSYSTEM_INSTALL=ON")
+           #:tests? #f))                ;no test suite
+    (native-inputs (list pkg-config))
     (inputs
-     `(("sdl2" ,sdl2)
-       ("glu" ,glu)
-       ("libjpeg" ,libjpeg-turbo)
-       ("libpng" ,libpng)
-       ("openal" ,openal)
-       ("vorbis" ,libvorbis)
-       ("zlib" ,zlib)))
+     (list glu
+           libjpeg-turbo
+           libpng
+           libvorbis
+           openal
+           sdl2
+           zlib))
     (home-page "https://osslugaru.gitlab.io")
     (synopsis "Cross-platform third-person action game")
     (description "Lugaru is a third-person action game.  The main character,
@@ -7228,7 +7227,7 @@ In his quest to find those responsible for slaughtering his village, he uncovers
 a far-reaching conspiracy involving the corrupt leaders of the rabbit republic
 and the starving wolves from a nearby den.  Turner takes it upon himself to
 fight against their plot and save his fellow rabbits from slavery.")
-    (license (list license:gpl2+ ; code
+    (license (list license:gpl2+        ; code
                    ;; assets:
                    license:cc-by-sa3.0
                    license:cc-by-sa4.0))))
diff --git a/gnu/packages/patches/lugaru-fix-sound.patch b/gnu/packages/patches/lugaru-fix-sound.patch
new file mode 100644
index 0000000000..742908c977
--- /dev/null
+++ b/gnu/packages/patches/lugaru-fix-sound.patch
@@ -0,0 +1,32 @@
+From 3adfb088eed81fc2c9e40ac55018378d4975f469 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Sun, 28 Jan 2024 19:50:51 -0500
+Subject: [PATCH] audio: Look extension from right, not left.
+
+* Source/Audio/openal_wrapper.cpp (decode_to_pcm): Find extension from
+the right (strrchr), not from the left, to avoid eagerly truncating a
+file name.
+
+Fixes: https://gitlab.com/osslugaru/lugaru/-/issues/124#note_1746570172
+---
+ Source/Audio/openal_wrapper.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/Audio/openal_wrapper.cpp b/Source/Audio/openal_wrapper.cpp
+index cc4fc36..072fcb8 100644
+--- a/Source/Audio/openal_wrapper.cpp
++++ b/Source/Audio/openal_wrapper.cpp
+@@ -316,7 +316,7 @@ static void* decode_to_pcm(const char* _fname, ALenum& format, ALsizei& size, AL
+     // !!! FIXME: if it's not Ogg, we don't have a decoder. I'm lazy.  :/
+     char* fname = (char*)alloca(strlen(_fname) + 16);
+     strcpy(fname, _fname);
+-    char* ptr = strchr(fname, '.');
++    char* ptr = strrchr(fname, '.');
+     if (ptr) {
+         *ptr = '\0';
+     }
+
+base-commit: 6a58b62858d9c3c3630abf00bf43075f65a09d38
+-- 
+2.41.0
+