2022-09-11 15:47:08 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, makeWrapper, openal, fluidsynth
|
2022-09-09 14:08:57 +00:00
|
|
|
, soundfont-fluid, libGL, SDL2, bzip2, zlib, libjpeg, libsndfile, libvpx, mpg123
|
2022-10-06 18:32:54 +00:00
|
|
|
, game-music-emu, pkg-config, copyDesktopItems, makeDesktopItem, gtk3 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
let
|
2022-09-09 14:08:57 +00:00
|
|
|
zmusic = stdenv.mkDerivation rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "zmusic";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "1.1.3";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ZDoom";
|
|
|
|
repo = "ZMusic";
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-wrNWfTIbNU/S2qFObUSkb6qyaceh+Y7Loxqudl86+W4=";
|
|
|
|
};
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
buildInputs = [ fluidsynth ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DDYN_FLUIDSYNTH=OFF" ];
|
|
|
|
|
2020-07-18 16:06:22 +00: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
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
gzdoom = stdenv.mkDerivation rec {
|
|
|
|
pname = "gzdoom";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "4.8.2";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-09-09 14:08:57 +00:00
|
|
|
owner = "ZDoom";
|
2020-07-18 16:06:22 +00:00
|
|
|
repo = "gzdoom";
|
|
|
|
rev = "g${version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
hash = "sha256-aT7DUZih3EDqncaXYIPIyGsz4fI267N29PmN3qyVjyo=";
|
2020-07-18 16:06:22 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config copyDesktopItems ];
|
2020-07-18 16:06:22 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
bzip2
|
2022-10-06 18:32:54 +00:00
|
|
|
fluidsynth
|
|
|
|
game-music-emu
|
|
|
|
gtk3
|
|
|
|
libGL
|
2020-07-18 16:06:22 +00:00
|
|
|
libjpeg
|
|
|
|
libsndfile
|
2022-09-09 14:08:57 +00:00
|
|
|
libvpx
|
2020-07-18 16:06:22 +00:00
|
|
|
mpg123
|
2022-10-06 18:32:54 +00:00
|
|
|
openal
|
|
|
|
zlib
|
2020-07-18 16:06:22 +00:00
|
|
|
zmusic
|
|
|
|
];
|
|
|
|
|
2022-09-11 15:47:08 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch { # TODO: Delete me when upgrading to 4.9
|
|
|
|
url = "https://github.com/ZDoom/gzdoom/commit/aae85a1b9169953d8dcc5f138a477d5c7d75addb.patch";
|
|
|
|
sha256 = "upuLDgVMaGaFSVaDV9Hj13DR5LUma51xv+Mfsz9m9a0=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
NIX_CFLAGS_LINK = "-lopenal -lfluidsynth";
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
cmakeFlags = [ "-DDYN_GTK=OFF" ];
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "gzdoom";
|
|
|
|
exec = "gzdoom";
|
|
|
|
desktopName = "GZDoom";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Game" ];
|
2021-08-08 23:34:03 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
installPhase = ''
|
2021-08-08 23:34:03 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-07-18 16:06:22 +00: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-08 23:34:03 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-09-09 14:08:57 +00:00
|
|
|
homepage = "https://github.com/ZDoom/gzdoom";
|
|
|
|
description = "A Doom source port based on ZDoom. It features an OpenGL renderer and lots of new features";
|
|
|
|
license = licenses.gpl3Plus;
|
2020-07-18 16:06:22 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ azahi lassulus ];
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in gzdoom
|