unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#30381] gnu: Add gzdoom.
@ 2018-02-07 18:03 okapi
  2018-02-09 10:16 ` Ludovic Courtès
  2018-02-09 10:20 ` Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: okapi @ 2018-02-07 18:03 UTC (permalink / raw)
  To: 30381

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-fluid-3.patch --]
[-- Type: text/x-diff; name=0001-gnu-Add-fluid-3.patch, Size: 2082 bytes --]

From f75ca85cd1cc89a3ba60c6c813ae4ab33bc86a40 Mon Sep 17 00:00:00 2001
From: okapi <okapi@firemail.cc>
Date: Wed, 17 Jan 2018 00:08:23 +0100
Subject: [PATCH 1/2] gnu: Add fluid-3.

* gnu/packages/audio.scm (fluid-3): New variable.
---
 gnu/packages/audio.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 0046f9a73..250c386c2 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -3264,3 +3264,35 @@ the following features:
 transforms (FFTs) of the sound being played, as well as other graphical
 representations.")
     (license license:expat)))
+
+(define-public fluid-3
+  (let ((commit "871c8ce2002e8b3c198f532fdb4fbcce7914f951"))
+    (package
+      (name "fluid-3")
+      (version "2.1")
+      (source
+       (origin
+         (method url-fetch)
+         ;; Only one file is required, but the release bundles the whole
+         ;; software which is 50MiB as tar and 200MiB unpacked. The website
+         ;; directly links the soundfont release to the github file download.
+         (uri (string-append "https://github.com/musescore/MuseScore/raw/"
+                             commit "/share/sound/FluidR3Mono_GM.sf3"))
+         (file-name (string-append name "-" commit ".tar.gz"))
+         (sha256
+          (base32
+           "1hjfg5i15bw9279007xs92zsggjgn4s4k9pc00s851l3kvc6dkfg"))))
+      (build-system trivial-build-system)
+      (arguments
+       `(#:modules ((guix build utils))
+         #:builder
+         (begin
+           (use-modules (guix build utils))
+           (let ((file (assoc-ref %build-inputs "source"))
+                 (out (string-append %output "/share/soundfonts")))
+             (mkdir-p out)
+             (copy-file file (string-append out "/FluidR3Mono_GM.sf3"))))))
+      (home-page  "https://github.com/musescore/MuseScore/tree/master/share/sound")
+      (synopsis "Pro-quality GM soundfont")
+      (description "Fluid-3 is Frank Wen's pro-quality GM soundfont.")
+      (license license:expat))))
-- 
2.16.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-gzdoom.patch --]
[-- Type: text/x-diff; name=0002-gnu-Add-gzdoom.patch, Size: 6033 bytes --]

From c3b7fea66a5bc5bd13f448da15d704659ee5bcb7 Mon Sep 17 00:00:00 2001
From: okapi <okapi@firemail.cc>
Date: Wed, 17 Jan 2018 00:21:42 +0100
Subject: [PATCH 2/2] gnu: Add gzdoom.

* gnu/packages/games.scm (gzdoom): New variable.
* gnu/packages/patches/gzdoom-search-in-installed-share.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/games.scm                             | 88 ++++++++++++++++++++++
 .../patches/gzdoom-search-in-installed-share.patch | 14 ++++
 3 files changed, 103 insertions(+)
 create mode 100644 gnu/packages/patches/gzdoom-search-in-installed-share.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b89077e87..f517c6ca4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -734,6 +734,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch	\
   %D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \
   %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \
+  %D%/packages/patches/gzdoom-search-in-installed-share.patch	\
   %D%/packages/patches/handbrake-pkg-config-path.patch		\
   %D%/packages/patches/hdf4-architectures.patch 		\
   %D%/packages/patches/hdf4-reproducibility.patch 		\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 1213d87a5..5aed43d4e 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5406,3 +5406,91 @@ smuggler or bounty hunter.  Forge and break alliances with the various
 factions fighting for power, freedom or self-determination.  The universe is
 whatever you make of it.")
     (license license:gpl3)))
+
+(define-public gzdoom
+  (package
+    (name "gzdoom")
+    (version "3.2.5")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "https://zdoom.org/files/gzdoom/src/gzdoom-g"
+                              version ".zip"))
+              (sha256
+               (base32
+                "1164d1zf5in98gp4j981ml3hwmks3q7vzfanlqpjlx2c09jmlv0q"))
+              (patches (search-patches "gzdoom-search-in-installed-share.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (delete-file-recursively "bzip2")
+                  (delete-file-recursively "game-music-emu")
+                  (delete-file-recursively "jpeg-6b")
+                  (delete-file-recursively "zlib")))))
+    (arguments
+     '(#:tests? #f
+       #:configure-flags
+       (let ((out (assoc-ref %outputs "out")))
+         (list
+          (string-append
+           "-DCMAKE_CXX_FLAGS:="
+           "-DSHARE_DIR=\\\"" out "/share/\\\" "
+           "-DGUIX_OUT_PK3=\\\"" out "/share/games/doom\\\"")
+          ;; look for libraries at buildtime instead of
+          ;; dynamically finding them at runtime
+          "-DDYN_OPENAL=OFF"
+          "-DDYN_FLUIDSYNTH=OFF"
+          "-DDYN_GTK=OFF"
+          "-DDYN_MPG123=OFF"
+          "-DDYN_SNDFILE=OFF"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'fix-referenced-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((fluid-3 (assoc-ref inputs "fluid-3"))
+                   (timidity++ (assoc-ref inputs "timidity++"))
+                   (out (assoc-ref outputs "out")))
+
+               (substitute*
+                   "src/CMakeLists.txt"
+                 (("COMMAND /bin/sh")
+                  (string-append "COMMAND " (which "sh"))))
+
+               (substitute*
+                   "src/sound/mididevices/music_fluidsynth_mididevice.cpp"
+                 (("/usr/share/sounds/sf2/FluidR3_GM.sf2")
+                  (string-append fluid-3 "/share/soundfonts/FluidR3Mono_GM.sf3")))
+
+               (substitute*
+                   "src/sound/mididevices/music_timiditypp_mididevice.cpp"
+                 (("exename = \"timidity\"")
+                  (string-append "exename = \"" timidity++ "/bin/timidity\"")))
+               #t))))))
+    (build-system cmake-build-system)
+    (inputs `(("bzip2" ,bzip2)
+              ("fluid-3" ,fluid-3)
+              ("fluidsynth" ,fluidsynth)
+              ("gtk+3" ,gtk+)
+              ("libgme" ,libgme)
+              ("libjpeg" ,libjpeg)
+              ("libsndfile" ,libsndfile)
+              ("mesa" ,mesa)
+              ("mpg123" ,mpg123)
+              ("openal" ,openal)
+              ("sdl2" ,sdl2)
+              ("timidity++" ,timidity++)
+              ("zlib" ,zlib)))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("unzip" ,unzip)))
+    (synopsis "Modern Doom 2 source port")
+    (description "Gzdoom is a Doom 2 source port with a modern renderer.
+It improves modding support with ZDoom's advanced mapping features and the new
+ZScript language.  In addition to Doom, it supports Heretic, Hexen, Strife,
+Chex Quest, and fan-created games like Harmony and Hacx.")
+    (home-page "https://zdoom.org/index")
+    (license (list license:gpl3+         ; gzdoom game
+                   license:lgpl3+        ; gzdoom renderer
+                   license:expat         ; gdtoa
+                   (license:non-copyleft ; modified dumb
+                    "file://dumb/licence.txt"
+                    "Dumb license, explicitly GPL compatible.")))))
diff --git a/gnu/packages/patches/gzdoom-search-in-installed-share.patch b/gnu/packages/patches/gzdoom-search-in-installed-share.patch
new file mode 100644
index 000000000..d16b604db
--- /dev/null
+++ b/gnu/packages/patches/gzdoom-search-in-installed-share.patch
@@ -0,0 +1,14 @@
+--- /src/d_main.cpp	2018-01-16 22:13:09.700602781 +0200
++++ /src/d_main.cpp	2018-01-16 22:22:36.560617961 +0200
+@@ -1716,6 +1716,11 @@
+ 		return wad;
+ 	}
+ 
++    mysnprintf (wad, countof(wad), "%s/%s", GUIX_OUT_PK3, file);
++    if (DirEntryExists (wad)) {
++        return wad;
++    }
++
+ 	if (GameConfig != NULL && GameConfig->SetSection ("FileSearch.Directories"))
+ 	{
+ 		const char *key;
-- 
2.16.1


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

end of thread, other threads:[~2018-02-18 23:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-07 18:03 [bug#30381] gnu: Add gzdoom okapi
2018-02-09 10:16 ` Ludovic Courtès
     [not found]   ` <f1bb9dc3477a3a89f4baf355b97a64ac@firemail.cc>
2018-02-18 23:17     ` Ludovic Courtès
2018-02-09 10:20 ` Ludovic Courtès
     [not found]   ` <9752ffae572668a688ceccda891a5821@firemail.cc>
2018-02-18 23:26     ` bug#30381: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).