From c3b7fea66a5bc5bd13f448da15d704659ee5bcb7 Mon Sep 17 00:00:00 2001 From: okapi 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