2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, openal, fluidsynth_1
|
2020-07-16 23:45:10 +02:00
|
|
|
, soundfont-fluid, libGL, SDL2, bzip2, zlib, libjpeg, libsndfile, mpg123
|
2021-08-06 00:03:52 +02:00
|
|
|
, game-music-emu, pkg-config, copyDesktopItems, makeDesktopItem }:
|
2015-05-10 19:50:56 +02:00
|
|
|
|
2020-07-16 23:45:10 +02:00
|
|
|
let
|
|
|
|
zmusic-src = fetchFromGitHub {
|
2015-05-10 19:50:56 +02:00
|
|
|
owner = "coelckers";
|
2020-07-16 23:45:10 +02:00
|
|
|
repo = "zmusic";
|
2021-01-28 21:13:12 +01:00
|
|
|
rev = "bff02053bea30bd789e45f60b90db3ffc69c8cc8";
|
|
|
|
sha256 = "0vpr79gpdbhslg5qxyd1qxlv5akgli26skm1vb94yd8v69ymdcy2";
|
2015-05-10 19:50:56 +02:00
|
|
|
};
|
2020-07-16 23:45:10 +02:00
|
|
|
zmusic = stdenv.mkDerivation {
|
|
|
|
pname = "zmusic";
|
2021-01-28 21:13:12 +01:00
|
|
|
version = "1.1.3";
|
2020-07-16 23:45:10 +02:00
|
|
|
|
|
|
|
src = zmusic-src;
|
|
|
|
|
2021-01-17 06:49:22 +01:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-07-16 23:45:10 +02:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i \
|
|
|
|
-e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \
|
|
|
|
-e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \
|
|
|
|
source/mididevices/music_fluidsynth_mididevice.cpp
|
|
|
|
'';
|
2015-05-10 19:50:56 +02:00
|
|
|
|
|
|
|
};
|
2020-07-16 23:45:10 +02:00
|
|
|
|
|
|
|
gzdoom = stdenv.mkDerivation rec {
|
|
|
|
pname = "gzdoom";
|
2021-01-28 21:13:12 +01:00
|
|
|
version = "4.5.0";
|
2020-07-16 23:45:10 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "coelckers";
|
|
|
|
repo = "gzdoom";
|
|
|
|
rev = "g${version}";
|
2021-01-28 21:13:12 +01:00
|
|
|
sha256 = "0kmqnyhdi5psi7zwrx9j3pz0cplypsvhg4cr8w2jbawh6jb71sk9";
|
2020-07-16 23:45:10 +02:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-08-06 00:03:52 +02:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config copyDesktopItems ];
|
2020-07-16 23:45:10 +02:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
libGL
|
|
|
|
openal
|
|
|
|
fluidsynth_1
|
|
|
|
bzip2
|
|
|
|
zlib
|
|
|
|
libjpeg
|
|
|
|
libsndfile
|
|
|
|
mpg123
|
|
|
|
game-music-emu
|
|
|
|
zmusic
|
|
|
|
];
|
|
|
|
|
|
|
|
NIX_CFLAGS_LINK = "-lopenal -lfluidsynth";
|
|
|
|
|
2021-08-06 00:03:52 +02:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "gzdoom";
|
|
|
|
exec = "gzdoom";
|
|
|
|
desktopName = "GZDoom";
|
|
|
|
categories = "Game;";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-07-16 23:45:10 +02:00
|
|
|
installPhase = ''
|
2021-08-06 00:03:52 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-07-16 23:45:10 +02:00
|
|
|
install -Dm755 gzdoom "$out/lib/gzdoom/gzdoom"
|
|
|
|
for i in *.pk3; do
|
|
|
|
install -Dm644 "$i" "$out/lib/gzdoom/$i"
|
|
|
|
done
|
|
|
|
for i in fm_banks/*; do
|
|
|
|
install -Dm644 "$i" "$out/lib/gzdoom/$i"
|
|
|
|
done
|
|
|
|
for i in soundfonts/*; do
|
|
|
|
install -Dm644 "$i" "$out/lib/gzdoom/$i"
|
|
|
|
done
|
|
|
|
mkdir $out/bin
|
|
|
|
makeWrapper $out/lib/gzdoom/gzdoom $out/bin/gzdoom
|
2021-08-06 00:03:52 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-07-16 23:45:10 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-07-16 23:45:10 +02:00
|
|
|
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 = licenses.gpl3;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ lassulus ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in gzdoom
|