summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-12-10 16:46:06 +0300
committerAzat Bahawi <azat@bahawi.net>2022-12-10 16:46:06 +0300
commit475579f4407dc64058dc26c90152d832354b6bd8 (patch)
tree0fcb9e6bdf4100f81c1c0b37a7118634a5bff090
parentMerge pull request #205424 from r-ryantm/auto-update/python310Packages.aioshelly (diff)
downloadnixpkgs-origin/gzdoom-4100.tar.gz
gzdoom: 4.8.2 -> 4.10.0origin/gzdoom-4100
-rw-r--r--pkgs/games/gzdoom/default.nix140
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 98 insertions, 46 deletions
diff --git a/pkgs/games/gzdoom/default.nix b/pkgs/games/gzdoom/default.nix
index 3eb69fa3c112..c57965107187 100644
--- a/pkgs/games/gzdoom/default.nix
+++ b/pkgs/games/gzdoom/default.nix
@@ -1,46 +1,95 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, makeWrapper, openal, fluidsynth
-, soundfont-fluid, libGL, SDL2, bzip2, zlib, libjpeg, libsndfile, libvpx, mpg123
-, game-music-emu, pkg-config, copyDesktopItems, makeDesktopItem, gtk3 }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, SDL2
+, alsa-lib
+, bzip2
+, cmake
+, copyDesktopItems
+, fluidsynth
+, game-music-emu
+, gtk3
+, libGL
+, libjpeg
+, libsndfile
+, libvpx
+, makeDesktopItem
+, makeWrapper
+, mpg123
+, ninja
+, openal
+, openmp
+, pkg-config
+, soundfont-fluid
+, vulkan-loader
+, zlib
+}:
let
zmusic = stdenv.mkDerivation rec {
pname = "zmusic";
- version = "1.1.3";
+ version = "1.1.11";
src = fetchFromGitHub {
owner = "ZDoom";
repo = "ZMusic";
rev = version;
- hash = "sha256-wrNWfTIbNU/S2qFObUSkb6qyaceh+Y7Loxqudl86+W4=";
+ hash = "sha256-QvP8ranwBs8VupBie4vrHdm517OOpCuV3Rbjeb/L9PY=";
};
- nativeBuildInputs = [ cmake pkg-config ];
+ patches = [
+ (fetchpatch {
+ name = "system-fluidsynth.patch";
+ url = "https://git.alpinelinux.org/aports/plain/testing/zmusic/system-fluidsynth.patch?id=59bac94da374cb01bc2a0e49d9e9287812fa1ac0";
+ hash = "sha256-xKaqiNk1Kt9yNLB22IVmSEtGeOtxrCi7YtFCmhNr0MI=";
+ })
+ ];
- buildInputs = [ fluidsynth ];
+ postPatch = ''
+ substituteInPlace source/mididevices/music_fluidsynth_mididevice.cpp \
+ --replace "/usr/share/sounds/sf2" "${soundfont-fluid}/share/soundfonts" \
+ --replace "FluidR3_GM.sf2" "FluidR3_GM2-2.sf2"
+ '';
- cmakeFlags = [ "-DDYN_FLUIDSYNTH=OFF" ];
+ nativeBuildInputs = [
+ cmake
+ ninja
+ 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
- '';
+ buildInputs = [
+ alsa-lib
+ fluidsynth
+ libsndfile
+ mpg123
+ zlib
+ ];
};
gzdoom = stdenv.mkDerivation rec {
pname = "gzdoom";
- version = "4.8.2";
+ version = "4.10.0";
src = fetchFromGitHub {
owner = "ZDoom";
repo = "gzdoom";
rev = "g${version}";
- hash = "sha256-aT7DUZih3EDqncaXYIPIyGsz4fI267N29PmN3qyVjyo=";
fetchSubmodules = true;
+ hash = "sha256-F3p2X/hjPV9fuaA7T2bQTP6SlKcfc8GniJgv8BcopGw=";
};
- nativeBuildInputs = [ cmake makeWrapper pkg-config copyDesktopItems ];
+ outputs = [ "out" "doc" ];
+
+ nativeBuildInputs = [
+ cmake
+ copyDesktopItems
+ git
+ makeWrapper
+ ninja
+ pkg-config
+ ];
+
buildInputs = [
SDL2
bzip2
@@ -53,20 +102,23 @@ let
libvpx
mpg123
openal
+ openmp
+ vulkan-loader
zlib
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";
+ postPatch = ''
+ substituteInPlace tools/updaterevision/UpdateRevision.cmake \
+ --replace "ret_var(Tag)" "ret_var(\"${src.rev}\")" \
+ --replace "ret_var(Timestamp)" "ret_var(\"1970-00-00 00:00:00 +0000\")" \
+ --replace "ret_var(Hash)" "ret_var(\"${src.rev}\")"
+ '';
- cmakeFlags = [ "-DDYN_GTK=OFF" ];
+ cmakeFlags = [
+ "-DDYN_GTK=OFF"
+ "-DDYN_OPENAL=OFF"
+ ];
desktopItems = [
(makeDesktopItem {
@@ -77,29 +129,27 @@ let
})
];
- installPhase = ''
- 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
-
- runHook postInstall
+ postInstall = ''
+ mv $out/bin/gzdoom $out/share/games/doom/gzdoom
+ makeWrapper $out/share/games/doom/gzdoom $out/bin/gzdoom
'';
meta = with lib; {
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;
+ description = "Modder-friendly OpenGL and Vulkan source port based on the DOOM engine";
+ longDescription = ''
+ GZDoom is a feature centric port for all DOOM engine games, based on
+ ZDoom, adding an OpenGL renderer and powerful scripting capabilities.
+ '';
+ # https://github.com/ZDoom/ZMusic/tree/master/licenses
+ # https://github.com/ZDoom/gzdoom/blob/master/LICENSE
+ licenses = with licenses; [
+ bsd
+ free
+ gpl3Plus
+ lgpl21Plus
+ lgpl3Plus
+ ];
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ azahi lassulus ];
};
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 726b157b81c9..972b31915274 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -34367,7 +34367,9 @@ with pkgs;
gweled = callPackage ../games/gweled { };
- gzdoom = callPackage ../games/gzdoom { };
+ gzdoom = callPackage ../games/gzdoom {
+ inherit (llvmPackages) openmp;
+ };
harmonist = callPackage ../games/harmonist { };