3
0
Fork 0
forked from mirrors/nixpkgs

gzdoom: 4.8.2 -> 4.10.0

This commit is contained in:
Azat Bahawi 2022-12-12 23:56:49 +03:00
parent c04f46c963
commit 3f2752723f
No known key found for this signature in database
GPG key ID: C8C6BDDB3847F72B

View file

@ -1,107 +1,102 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, makeWrapper, openal, fluidsynth { lib
, soundfont-fluid, libGL, SDL2, bzip2, zlib, libjpeg, libsndfile, libvpx, mpg123 , stdenv
, game-music-emu, pkg-config, copyDesktopItems, makeDesktopItem, gtk3 }: , fetchFromGitHub
, makeWrapper
, makeDesktopItem
, copyDesktopItems
, SDL2
, bzip2
, cmake
, fluidsynth
, game-music-emu
, gtk3
, libGL
, libjpeg
, libsndfile
, libvpx
, mpg123
, ninja
, openal
, pkg-config
, vulkan-loader
, zlib
, zmusic
}:
let stdenv.mkDerivation rec {
zmusic = stdenv.mkDerivation rec { pname = "gzdoom";
pname = "zmusic"; version = "4.10.0";
version = "1.1.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ZDoom"; owner = "ZDoom";
repo = "ZMusic"; repo = "gzdoom";
rev = version; rev = "g${version}";
hash = "sha256-wrNWfTIbNU/S2qFObUSkb6qyaceh+Y7Loxqudl86+W4="; fetchSubmodules = true;
}; hash = "sha256-F3p2X/hjPV9fuaA7T2bQTP6SlKcfc8GniJgv8BcopGw=";
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ fluidsynth ];
cmakeFlags = [ "-DDYN_FLUIDSYNTH=OFF" ];
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
'';
}; };
gzdoom = stdenv.mkDerivation rec { outputs = [ "out" "doc" ];
pname = "gzdoom";
version = "4.8.2";
src = fetchFromGitHub { nativeBuildInputs = [
owner = "ZDoom"; cmake
repo = "gzdoom"; copyDesktopItems
rev = "g${version}"; makeWrapper
hash = "sha256-aT7DUZih3EDqncaXYIPIyGsz4fI267N29PmN3qyVjyo="; ninja
fetchSubmodules = true; pkg-config
}; ];
nativeBuildInputs = [ cmake makeWrapper pkg-config copyDesktopItems ]; buildInputs = [
buildInputs = [ SDL2
SDL2 bzip2
bzip2 fluidsynth
fluidsynth game-music-emu
game-music-emu gtk3
gtk3 libGL
libGL libjpeg
libjpeg libsndfile
libsndfile libvpx
libvpx mpg123
mpg123 openal
openal vulkan-loader
zlib zlib
zmusic zmusic
]; ];
patches = [ postPatch = ''
(fetchpatch { # TODO: Delete me when upgrading to 4.9 substituteInPlace tools/updaterevision/UpdateRevision.cmake \
url = "https://github.com/ZDoom/gzdoom/commit/aae85a1b9169953d8dcc5f138a477d5c7d75addb.patch"; --replace "ret_var(Tag)" "ret_var(\"${src.rev}\")" \
sha256 = "upuLDgVMaGaFSVaDV9Hj13DR5LUma51xv+Mfsz9m9a0="; --replace "ret_var(Timestamp)" "ret_var(\"1970-00-00 00:00:00 +0000\")" \
}) --replace "ret_var(Hash)" "ret_var(\"${src.rev}\")"
]; '';
NIX_CFLAGS_LINK = "-lopenal -lfluidsynth"; cmakeFlags = [
"-DDYN_GTK=OFF"
"-DDYN_OPENAL=OFF"
];
cmakeFlags = [ "-DDYN_GTK=OFF" ]; desktopItems = [
(makeDesktopItem {
name = "gzdoom";
exec = "gzdoom";
desktopName = "GZDoom";
categories = [ "Game" ];
})
];
desktopItems = [ postInstall = ''
(makeDesktopItem { mv $out/bin/gzdoom $out/share/games/doom/gzdoom
name = "gzdoom"; makeWrapper $out/share/games/doom/gzdoom $out/bin/gzdoom
exec = "gzdoom"; '';
desktopName = "GZDoom";
categories = [ "Game" ];
})
];
installPhase = '' meta = with lib; {
runHook preInstall homepage = "https://github.com/ZDoom/gzdoom";
description = "Modder-friendly OpenGL and Vulkan source port based on the DOOM engine";
install -Dm755 gzdoom "$out/lib/gzdoom/gzdoom" longDescription = ''
for i in *.pk3; do GZDoom is a feature centric port for all DOOM engine games, based on
install -Dm644 "$i" "$out/lib/gzdoom/$i" ZDoom, adding an OpenGL renderer and powerful scripting capabilities.
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
runHook postInstall
''; '';
license = licenses.gpl3Plus;
meta = with lib; { platforms = platforms.linux;
homepage = "https://github.com/ZDoom/gzdoom"; maintainers = with maintainers; [ azahi lassulus ];
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" ];
maintainers = with maintainers; [ azahi lassulus ];
};
}; };
in gzdoom }