1. (use-modules (guix packages)
  2. (guix download)
  3. (guix gexp)
  4. (guix git-download)
  5. (guix build-system cmake)
  6. (gnu packages)
  7. (gnu packages pkg-config)
  8. (gnu packages audio)
  9. (gnu packages compression)
  10. (gnu packages gl)
  11. (gnu packages gtk)
  12. (gnu packages image)
  13. (gnu packages mp3)
  14. (gnu packages pulseaudio)
  15. (gnu packages sdl)
  16. ((guix licenses) #:prefix license:))
  17. (package
  18. (name "gzdoom-new")
  19. (version "4.13.2")
  20. (source
  21. (origin
  22. (method git-fetch)
  23. (uri (git-reference
  24. (url "https://github.com/coelckers/gzdoom")
  25. (commit (string-append "g" version))))
  26. (file-name (git-file-name name version))
  27. (sha256
  28. (base32 "0zlvrdayrj1rk5x2hwnc57l8pl29bl64zmfq3qc9yfypknj1syfy"))))
  29. (arguments
  30. (list
  31. #:tests? #f
  32. ;; #:configure-flags
  33. ;; #~(list
  34. ;; (string-append
  35. ;; "-DCMAKE_CXX_FLAGS:="
  36. ;; "-DSHARE_DIR=\\\"" #$output "/share/\\\" "
  37. ;; "-DGUIX_OUT_PK3=\\\"" #$output "/share/games/doom\\\"")
  38. ;; ;; The build requires some extra convincing not to use the bundled
  39. ;; ;; libgme previously deleted in the soure snippet.
  40. ;; "-DFORCE_INTERNAL_GME=OFF"
  41. ;; ;; Link libraries at build time instead of loading them at run time.
  42. ;; "-DDYN_OPENAL=OFF"
  43. ;; "-DDYN_FLUIDSYNTH=OFF"
  44. ;; "-DDYN_GTK=OFF"
  45. ;; "-DDYN_MPG123=OFF"
  46. ;; "-DDYN_SNDFILE=OFF")
  47. #:phases
  48. #~(modify-phases %standard-phases
  49. (add-before 'configure 'fix-file-names
  50. (lambda* (#:key inputs #:allow-other-keys)
  51. (substitute* "src/CMakeLists.txt"
  52. (("COMMAND /bin/sh")
  53. (string-append "COMMAND " (which "sh"))))
  54. (substitute*
  55. "libraries/zmusic/mididevices/music_fluidsynth_mididevice.cpp"
  56. (("/usr/share/sounds/sf2/FluidR3_GM.sf2")
  57. (search-input-file inputs
  58. "share/soundfonts/FluidR3Mono_GM.sf3")))
  59. (substitute*
  60. "libraries/zmusic/mididevices/music_timiditypp_mididevice.cpp"
  61. (("(exename = \")(timidity)(\".*)" dum prefix exe suffix)
  62. (string-append prefix
  63. (search-input-file inputs
  64. (string-append "bin/" exe))
  65. suffix))))))
  66. ))
  67. (build-system cmake-build-system)
  68. (inputs (list bzip2
  69. fluid-3
  70. fluidsynth
  71. gtk+
  72. libgme
  73. libjpeg-turbo
  74. libsndfile
  75. mesa
  76. mpg123
  77. openal
  78. sdl2
  79. timidity++
  80. zlib))
  81. (native-inputs (list pkg-config unzip))
  82. (synopsis "Modern Doom 2 source port")
  83. (description "GZdoom is a port of the Doom 2 game engine, with a modern
  84. renderer. It improves modding support with ZDoom's advanced mapping features
  85. and the new ZScript language. In addition to Doom, it supports Heretic, Hexen,
  86. Strife, Chex Quest, and fan-created games like Harmony, Hacx and Freedoom.")
  87. (home-page "https://zdoom.org/index")
  88. ;; The source uses x86 assembly
  89. (supported-systems '("x86_64-linux" "i686-linux"))
  90. (license (list license:gpl3+ ; gzdoom game
  91. license:lgpl3+ ; gzdoom renderer
  92. license:expat ; gdtoa
  93. (license:non-copyleft ; modified dumb
  94. "file://dumb/licence.txt"
  95. "Dumb license, explicitly GPL compatible."))))