nixpkgs/pkgs/games/gzdoom/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
2.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, makeWrapper, openal, fluidsynth
2022-09-01 19:32:41 +02:00
, soundfont-fluid, libGL, SDL2, bzip2, zlib, libjpeg, libsndfile, libvpx, mpg123
2021-08-06 00:03:52 +02:00
, game-music-emu, pkg-config, copyDesktopItems, makeDesktopItem }:
2015-05-10 19:50:56 +02:00
let
2022-09-01 19:32:41 +02:00
zmusic = stdenv.mkDerivation rec {
pname = "zmusic";
version = "1.1.3";
2022-09-01 19:32:41 +02:00
src = fetchFromGitHub {
owner = "ZDoom";
repo = "ZMusic";
rev = version;
hash = "sha256-wrNWfTIbNU/S2qFObUSkb6qyaceh+Y7Loxqudl86+W4=";
};
nativeBuildInputs = [ cmake pkg-config ];
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
};
gzdoom = stdenv.mkDerivation rec {
pname = "gzdoom";
2022-09-01 19:32:41 +02:00
version = "4.8.2";
src = fetchFromGitHub {
2022-09-01 19:32:41 +02:00
owner = "ZDoom";
repo = "gzdoom";
rev = "g${version}";
2022-09-01 19:32:41 +02:00
hash = "sha256-aT7DUZih3EDqncaXYIPIyGsz4fI267N29PmN3qyVjyo=";
fetchSubmodules = true;
};
2021-08-06 00:03:52 +02:00
nativeBuildInputs = [ cmake makeWrapper pkg-config copyDesktopItems ];
buildInputs = [
SDL2
libGL
openal
fluidsynth
bzip2
zlib
libjpeg
libsndfile
2022-09-01 19:32:41 +02:00
libvpx
mpg123
game-music-emu
zmusic
];
patches = [
(fetchpatch { # TODO: Delete me when upgrading to 4.9
url = "https://github.com/ZDoom/gzdoom/commit/aae85a1b9169953d8dcc5f138a477d5c7d75addb.patch";
sha256 = "upuLDgVMaGaFSVaDV9Hj13DR5LUma51xv+Mfsz9m9a0=";
})
];
NIX_CFLAGS_LINK = "-lopenal -lfluidsynth";
2021-08-06 00:03:52 +02:00
desktopItems = [
(makeDesktopItem {
name = "gzdoom";
exec = "gzdoom";
desktopName = "GZDoom";
categories = [ "Game" ];
2021-08-06 00:03:52 +02:00
})
];
installPhase = ''
2021-08-06 00:03:52 +02:00
runHook preInstall
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
'';
meta = with lib; {
2022-09-01 19:32:41 +02: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;
platforms = [ "x86_64-linux" ];
2022-09-01 19:32:41 +02:00
maintainers = with maintainers; [ azahi lassulus ];
};
};
in gzdoom