all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#46190] [PATCH] gnu: teeworlds: Fix audio
@ 2021-01-30 12:56 Lars-Dominik Braun
  2021-01-31 15:58 ` bug#46190: " Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Lars-Dominik Braun @ 2021-01-30 12:56 UTC (permalink / raw)
  To: 46190

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

Hi,

attached patch switches teeworlds’s build to cmake, which fixes the
audio issue.  Looks like cmake has a feature check for wavpack, which
the bam build system does not have and thus it selects the wrong code
path, causing wavpack to fail loading audio files.

Cheers,
Lars


[-- Attachment #2: 0001-gnu-teeworlds-Fix-audio.patch --]
[-- Type: text/x-diff, Size: 5555 bytes --]

From 223a48785cc111e2428f8041a8cc7dd436598dbb Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <lars@6xq.net>
Date: Sat, 30 Jan 2021 13:53:05 +0100
Subject: [PATCH] gnu: teeworlds: Fix audio

* gnu/packages/games.scm (teeworlds)[source]: Enable recursive cloning
[build-system]: Switch to cmake-build-system
[arguments]: Remove custom phases 'build and 'install
[inputs]: Add openssl
[native-inputs]: Remove bam
[license]: Add map/language data license
---
 gnu/packages/games.scm | 65 +++++++-----------------------------------
 1 file changed, 10 insertions(+), 55 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index be7a3cc181..e3e18bf09e 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -6104,11 +6104,13 @@ small robot living in the nano world, repair its maker.")
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/teeworlds/teeworlds")
-                    (commit version)))
+                    (commit version)
+                    ;; There are two submodules in datasrc/{languages,maps}
+                    (recursive? #t)))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "169dl83q08zl4h813az8hjs4rs3dms9yjn6bnsld4fjcj0imvvc6"))
+                "1l19ksmimg6b8zzjy0skyhh7z11ql7n5gvilkv7ay5x2b9ndbqwz"))
               (modules '((guix build utils)
                          (ice-9 ftw)
                          (ice-9 regex)
@@ -6121,15 +6123,12 @@ small robot living in the nano world, repair its maker.")
                             (remove (cut string-match "(^.)|(^md5$)" <>)
                                     (scandir base-dir)))
                   #t))))
-    (build-system gnu-build-system)
+    (build-system cmake-build-system)
     (arguments
      `(#:tests? #f                      ; no tests included
-       #:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (srfi srfi-26))
        #:phases
        (modify-phases %standard-phases
-         (replace 'configure
+         (add-after 'unpack 'patch-paths
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Embed path to assets.
              (substitute* "src/engine/shared/storage.cpp"
@@ -6138,51 +6137,7 @@ small robot living in the nano world, repair its maker.")
                                (assoc-ref outputs "out")
                                "/share/teeworlds/data"
                                "\"")))
-
-             ;; Bam expects all files to have a recent time stamp.
-             (for-each (cut utime <> 1 1)
-                       (find-files "."))
-
-             ;; Do not use bundled libraries.
-             (substitute* "bam.lua"
-               (("local json = Compile.+$")
-                "local json = nil
-settings.link.libs:Add(\"jsonparser\")")
-               (("local png = Compile.+$")
-                "local png = nil
-settings.link.libs:Add(\"pnglite\")")
-               (("local wavpack = Compile.+$")
-                "local wavpack = nil
-settings.link.libs:Add(\"wavpack\")")
-               (("if config\\.zlib\\.value == 1")
-                "if config.zlib.value"))
-             (substitute* "src/engine/client/graphics_threaded.cpp"
-               (("engine/external/pnglite/pnglite\\.h")
-                "pnglite.h"))
-             (substitute* "src/engine/client/sound.cpp"
-               (("engine/external/wavpack/wavpack\\.h")
-                "wavpack/wavpack.h"))
-             #t))
-         (replace 'build
-           (lambda _
-             (invoke "bam" "-a" "-v" "conf=release")))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((arch ,(system->linux-architecture
-                            (or (%current-target-system)
-                                (%current-system))))
-                    (build (string-append "build/" (if (string=? arch "i386")
-                                                       "x86" arch)
-                                          "/release/"))
-                    (data-built (string-append build "data/"))
-                    (out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin/"))
-                    (data (string-append out "/share/teeworlds/data/")))
-               (for-each (cut install-file <> bin)
-                         (map (cut string-append build <>)
-                              '("teeworlds" "teeworlds_srv")))
-               (copy-recursively data-built data)
-               #t))))))
+             #t)))))
     (inputs
      `(("freetype" ,freetype)
        ("glu" ,glu)
@@ -6193,17 +6148,17 @@ settings.link.libs:Add(\"wavpack\")")
        ("sdl2-image" ,sdl2-image)
        ("sdl2-mixer" ,sdl2-mixer)
        ("wavpack" ,wavpack)
+       ("openssl" ,openssl)
        ("zlib" ,zlib)))
     (native-inputs
-     `(("bam" ,bam)
-       ("python" ,python-wrapper)
+     `(("python" ,python-wrapper)
        ("pkg-config" ,pkg-config)))
     (home-page "https://www.teeworlds.com")
     (synopsis "2D retro multiplayer shooter game")
     (description "Teeworlds is an online multiplayer game.  Battle with up to
 16 players in a variety of game modes, including Team Deathmatch and Capture
 The Flag.  You can even design your own maps!")
-    (license license:bsd-3)))
+    (license (list license:bsd-3 license:cc-by-sa3.0)))) ; game+maps&languages
 
 (define-public enigma
   (package
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#46190: [PATCH] gnu: teeworlds: Fix audio
  2021-01-30 12:56 [bug#46190] [PATCH] gnu: teeworlds: Fix audio Lars-Dominik Braun
@ 2021-01-31 15:58 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2021-01-31 15:58 UTC (permalink / raw)
  To: Lars-Dominik Braun; +Cc: 46190-done

Hello,

Lars-Dominik Braun <lars@6xq.net> writes:

> Subject: [PATCH] gnu: teeworlds: Fix audio
>
> * gnu/packages/games.scm (teeworlds)[source]: Enable recursive cloning
> [build-system]: Switch to cmake-build-system
> [arguments]: Remove custom phases 'build and 'install
> [inputs]: Add openssl
> [native-inputs]: Remove bam
> [license]: Add map/language data license

Applied. Thank you.

Regards,
-- 
Nicolas Goaziou




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-31 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-30 12:56 [bug#46190] [PATCH] gnu: teeworlds: Fix audio Lars-Dominik Braun
2021-01-31 15:58 ` bug#46190: " Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.