about summary refs log tree commit diff
path: root/pkgs/games/zdoom
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-12-17 15:05:45 +0300
committerNikolay Amiantov <ab@fmap.me>2016-12-17 15:33:12 +0300
commit1cc9d9ef2ce80dee5c8f2ef9f8ae20ae76337d73 (patch)
tree12c96747d47e0785802e9f6dbe5b1976645e4b5d /pkgs/games/zdoom
parent60903f7320cdfc517a23ce80a0c21a31d4a2eee9 (diff)
zdoom: 2.7.1 -> 2.8.1
Diffstat (limited to 'pkgs/games/zdoom')
-rw-r--r--pkgs/games/zdoom/default.nix65
1 files changed, 41 insertions, 24 deletions
diff --git a/pkgs/games/zdoom/default.nix b/pkgs/games/zdoom/default.nix
index ce25f3efda3f6..4aca0e0114dc4 100644
--- a/pkgs/games/zdoom/default.nix
+++ b/pkgs/games/zdoom/default.nix
@@ -1,40 +1,57 @@
-{ stdenv, fetchFromGitHub, cmake, fmod, mesa, SDL }:
-
-stdenv.mkDerivation {
-  name = "zdoom-2.7.1";
-  src = fetchFromGitHub {
-    #url = "https://github.com/rheit/zdoom";
-    owner = "rheit";
-    repo = "zdoom";
-    rev = "2.7.1";
-    sha256 = "00bx4sgl9j1dyih7yysfq4ah6msxw8580g53p99jfym34ky5ppkh";
+{ stdenv, fetchurl, p7zip, cmake
+, SDL2, openal, fluidsynth, soundfont-fluid, bzip2, zlib, libjpeg, game-music-emu
+, libsndfile, mpg123 }:
+
+stdenv.mkDerivation rec {
+  name = "zdoom-${version}";
+  majorVersion = "2.8";
+  version = "${majorVersion}.1";
+
+  src = fetchurl {
+    url = "https://zdoom.org/files/zdoom/${majorVersion}/zdoom-${version}-src.7z";
+    sha256 = "0453fqrh9l00xwphfxni5qkf9y134n3s1mr1dvi5cbkxcva7j8bq";
   };
 
-  buildInputs = [ cmake fmod mesa SDL ];
+  nativeBuildInputs = [ p7zip cmake ];
+  buildInputs = [
+    SDL2 openal fluidsynth bzip2 zlib libjpeg game-music-emu libsndfile mpg123
+  ];
 
   cmakeFlags = [
-    "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so"
-    "-DSDL_INCLUDE_DIR=${SDL.dev}/include"
+    "-DFORCE_INTERNAL_GME=OFF"
+    "-DGME_INCLUDE_DIR=${game-music-emu}/include"
+    "-DGME_LIBRARIES=${game-music-emu}/lib/libgme.so"
   ];
 
-  NIX_CFLAGS_COMPILE = [ "-I ${SDL.dev}/include/SDL" ];
-   
+  sourceRoot = ".";
+
+  enableParallelBuilding = true;
+
+  NIX_CFLAGS_LINK = [ "-lopenal" "-lfluidsynth" ];
+
   preConfigure = ''
-    sed s@zdoom.pk3@$out/share/zdoom.pk3@ -i src/version.h
- '';
+    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 = ''
+    install -Dm755 zdoom "$out/lib/zdoom/zdoom"
+    for i in *.pk3; do
+      install -Dm644 "$i" "$out/lib/zdoom/$i"
+    done
     mkdir -p $out/bin
-    cp zdoom $out/bin
-    mkdir -p $out/share
-    cp zdoom.pk3 $out/share
+    ln -s $out/lib/zdoom/zdoom $out/bin/zdoom
   '';
 
-  meta = {
-    homepage = http://zdoom.org/;
+  meta = with stdenv.lib; {
+    homepage = "http://zdoom.org/";
     description = "Enhanced port of the official DOOM source code";
-    license = stdenv.lib.licenses.unfree;
-    maintainers = [ stdenv.lib.maintainers.lassulus ];
+    # Doom source license, MAME license
+    license = licenses.unfreeRedistributable;
+    platforms = platforms.linux;
+    maintainers = with maintainer;s [ lassulus ];
   };
 }