2016-12-17 12:05:45 +00:00
|
|
|
{ stdenv, fetchurl, p7zip, cmake
|
|
|
|
, SDL2, openal, fluidsynth, soundfont-fluid, bzip2, zlib, libjpeg, game-music-emu
|
|
|
|
, libsndfile, mpg123 }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "zdoom";
|
2016-12-17 12:05:45 +00:00
|
|
|
majorVersion = "2.8";
|
|
|
|
version = "${majorVersion}.1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://zdoom.org/files/zdoom/${majorVersion}/zdoom-${version}-src.7z";
|
|
|
|
sha256 = "0453fqrh9l00xwphfxni5qkf9y134n3s1mr1dvi5cbkxcva7j8bq";
|
2009-02-22 22:06:34 +00:00
|
|
|
};
|
2012-11-26 13:22:27 +00:00
|
|
|
|
2016-12-17 12:05:45 +00:00
|
|
|
nativeBuildInputs = [ p7zip cmake ];
|
|
|
|
buildInputs = [
|
|
|
|
SDL2 openal fluidsynth bzip2 zlib libjpeg game-music-emu libsndfile mpg123
|
|
|
|
];
|
2012-11-26 13:22:27 +00:00
|
|
|
|
2015-05-15 09:04:08 +01:00
|
|
|
cmakeFlags = [
|
2016-12-17 12:05:45 +00:00
|
|
|
"-DFORCE_INTERNAL_GME=OFF"
|
|
|
|
"-DGME_INCLUDE_DIR=${game-music-emu}/include"
|
|
|
|
"-DGME_LIBRARIES=${game-music-emu}/lib/libgme.so"
|
2015-05-15 09:04:08 +01:00
|
|
|
];
|
2009-02-22 22:06:34 +00:00
|
|
|
|
2016-12-17 12:05:45 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
NIX_CFLAGS_LINK = [ "-lopenal" "-lfluidsynth" ];
|
|
|
|
|
2015-05-15 09:04:08 +01:00
|
|
|
preConfigure = ''
|
2016-12-17 12:05:45 +00:00
|
|
|
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
|
|
|
|
'';
|
2009-02-22 22:06:34 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2016-12-17 12:05:45 +00:00
|
|
|
install -Dm755 zdoom "$out/lib/zdoom/zdoom"
|
|
|
|
for i in *.pk3; do
|
|
|
|
install -Dm644 "$i" "$out/lib/zdoom/$i"
|
|
|
|
done
|
2009-02-22 22:06:34 +00:00
|
|
|
mkdir -p $out/bin
|
2016-12-17 12:05:45 +00:00
|
|
|
ln -s $out/lib/zdoom/zdoom $out/bin/zdoom
|
2009-02-22 22:06:34 +00:00
|
|
|
'';
|
|
|
|
|
2016-12-17 12:05:45 +00:00
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://zdoom.org/;
|
2009-02-22 22:06:34 +00:00
|
|
|
description = "Enhanced port of the official DOOM source code";
|
2016-12-17 12:05:45 +00:00
|
|
|
# Doom source license, MAME license
|
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
platforms = platforms.linux;
|
2016-12-18 08:27:59 +00:00
|
|
|
maintainers = with maintainers; [ lassulus ];
|
2009-02-22 22:06:34 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|