summary refs log tree commit diff
path: root/pkgs/games/gzdoom
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-12-17 15:04:44 +0300
committerNikolay Amiantov <ab@fmap.me>2016-12-17 15:33:12 +0300
commit60903f7320cdfc517a23ce80a0c21a31d4a2eee9 (patch)
treee57c5b20fdf08335bb41df3af53f7c40903064db /pkgs/games/gzdoom
parent0063c8acb4a5de8d90c0cbadf54ce337bd921e76 (diff)
downloadnixpkgs-60903f7320cdfc517a23ce80a0c21a31d4a2eee9.tar
nixpkgs-60903f7320cdfc517a23ce80a0c21a31d4a2eee9.tar.gz
nixpkgs-60903f7320cdfc517a23ce80a0c21a31d4a2eee9.tar.bz2
nixpkgs-60903f7320cdfc517a23ce80a0c21a31d4a2eee9.tar.lz
nixpkgs-60903f7320cdfc517a23ce80a0c21a31d4a2eee9.tar.xz
nixpkgs-60903f7320cdfc517a23ce80a0c21a31d4a2eee9.tar.zst
nixpkgs-60903f7320cdfc517a23ce80a0c21a31d4a2eee9.zip
gzdoom: 2015-05-07 -> 2.2.0
Diffstat (limited to 'pkgs/games/gzdoom')
-rw-r--r--pkgs/games/gzdoom/default.nix53
1 files changed, 35 insertions, 18 deletions
diff --git a/pkgs/games/gzdoom/default.nix b/pkgs/games/gzdoom/default.nix
index 332c2fbeff1..9e6cc48b435 100644
--- a/pkgs/games/gzdoom/default.nix
+++ b/pkgs/games/gzdoom/default.nix
@@ -1,34 +1,51 @@
-{stdenv, fetchFromGitHub, cmake, fmod, mesa, SDL2}:
+{ stdenv, fetchFromGitHub, cmake, zdoom
+, openal, fluidsynth, soundfont-fluid, mesa_noglu, SDL2
+, bzip2, zlib, libjpeg, libsndfile, mpg123, game-music-emu }:
 
-stdenv.mkDerivation {
-  name = "gzdoom-2015-05-07";
-  src = fetchFromGitHub{
+stdenv.mkDerivation rec {
+  name = "gzdoom-${version}";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
     owner = "coelckers";
     repo = "gzdoom";
-    rev = "a59824cd8897dea5dd452c31be1328415478f990";
-    sha256 = "1lg9dk5prn2bjmyznq941a862alljvfgbb42whbpg0vw9vhpikak";
+    rev = "g${version}";
+    sha256 = "0xxgd8fa29pcdir1xah5cvx41bfy76p4dydpp13mf44p9pr29hrb";
   };
 
-  buildInputs = [ cmake fmod mesa SDL2 ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    SDL2 mesa_noglu openal fluidsynth bzip2 zlib libjpeg libsndfile mpg123
+    game-music-emu
+  ];
+
+  enableParallelBuilding = true;
 
-  cmakeFlags = [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ];
+  NIX_CFLAGS_LINK = [ "-lopenal" "-lfluidsynth" ];
 
-  preConfigure=''
-    sed s@gzdoom.pk3@$out/share/gzdoom.pk3@ -i src/version.h
+  preConfigure = ''
+    sed -i \
+      -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \
+      -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \
+      src/sound/music_fluidsynth_mididevice.cpp
   '';
 
   installPhase = ''
-    mkdir -p $out/bin
-    cp gzdoom $out/bin
-    mkdir -p $out/share
-    cp gzdoom.pk3 $out/share
+    install -Dm755 gzdoom "$out/lib/gzdoom/gzdoom"
+    for i in *.pk3; do
+      install -Dm644 "$i" "$out/lib/gzdoom/$i"
+    done
+    mkdir $out/bin
+    ln -s $out/lib/gzdoom/gzdoom $out/bin/gzdoom
   '';
 
-  meta = {
-    homepage = https://github.com/coelckers/gzdoom;
+  meta = with stdenv.lib; {
+    homepage = "https://github.com/coelckers/gzdoom";
     description = "A Doom source port based on ZDoom. It features an OpenGL renderer and lots of new features";
-    license = stdenv.lib.licenses.unfree;
-    maintainers = [ stdenv.lib.maintainers.lassulus ];
+    # Doom source license, MAME license
+    license = licenses.unfreeRedistributable;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lassulus ];
   };
 }