diff mbox series

[bug#51635,2/2] gnu: openttd: Let the music play.

Message ID dccd63a5dd0a503704b2fdde90d8ff69aed7b8f3.camel@gmail.com
State Accepted
Headers show
Series Enable music playback in OpenTTD | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Liliana Marie Prikler Nov. 6, 2021, 1:06 p.m. UTC
* gnu/packages/games.scm (openttd)[inputs]: Remove timidity++.
Add fluidsynth and freepats-gm.
[#:phases]<patch-sources>: New phase.
---
 gnu/packages/games.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 14131fa065..47ed3fc1b4 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -4481,6 +4481,15 @@  (define-public openttd
          (list (string-append "-DCMAKE_INSTALL_BINDIR=" out "/bin")))
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch-sources
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/music/fluidsynth.cpp"
+               (("default_sf\\[\\] = \\{" all)
+                (string-append all "
+\t/* Guix hardcoded :P */
+\t\"" (string-append (assoc-ref inputs "freepats-gm")
+                     "/share/soundfonts/FreePatsGM.sf2") "\",
+")))))
          (add-before 'check 'install-data
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (for-each
@@ -4489,7 +4498,8 @@  (define-public openttd
                                   (assoc-ref outputs "out")))
               (list "opengfx" "openmsx" "opensfx")))))))
     (inputs
-     `(("timidity++" ,timidity++)
+     `(("fluidsynth" ,fluidsynth)
+       ("freepats-gm" ,freepats-gm)
        ,@(package-inputs openttd-engine)))
     (native-inputs
      `(("opengfx" ,openttd-opengfx)