From 31246e060b20a05c725bcb369b0af52cc05d61dc Mon Sep 17 00:00:00 2001 From: Gliczy <129636582+Gliczy@users.noreply.github.com> Date: Thu, 12 Sep 2024 22:27:49 +0200 Subject: [PATCH 1/5] gzdoom: move to pkgs/by-name --- .../gzdoom/default.nix => by-name/gz/gzdoom/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{games/doom-ports/gzdoom/default.nix => by-name/gz/gzdoom/package.nix} (100%) diff --git a/pkgs/games/doom-ports/gzdoom/default.nix b/pkgs/by-name/gz/gzdoom/package.nix similarity index 100% rename from pkgs/games/doom-ports/gzdoom/default.nix rename to pkgs/by-name/gz/gzdoom/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2dda1e36002a..9bbe61e7b98a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35112,8 +35112,6 @@ with pkgs; eternity = callPackage ../games/doom-ports/eternity-engine { }; - gzdoom = callPackage ../games/doom-ports/gzdoom { }; - odamex = callPackage ../games/doom-ports/odamex { }; prboom-plus = callPackage ../games/doom-ports/prboom-plus { }; From e726b99310e6f516c6b158c595d92753f1a598a3 Mon Sep 17 00:00:00 2001 From: Gliczy <129636582+Gliczy@users.noreply.github.com> Date: Thu, 12 Sep 2024 22:39:33 +0200 Subject: [PATCH 2/5] gzdoom: fix vulkan --- pkgs/by-name/gz/gzdoom/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/gz/gzdoom/package.nix b/pkgs/by-name/gz/gzdoom/package.nix index f34276c7783f..b1fef391ba6f 100644 --- a/pkgs/by-name/gz/gzdoom/package.nix +++ b/pkgs/by-name/gz/gzdoom/package.nix @@ -91,7 +91,8 @@ stdenv.mkDerivation rec { postInstall = '' mv $out/bin/gzdoom $out/share/games/doom/gzdoom - makeWrapper $out/share/games/doom/gzdoom $out/bin/gzdoom + makeWrapper $out/share/games/doom/gzdoom $out/bin/gzdoom \ + --set LD_LIBRARY_PATH ${lib.makeLibraryPath [ vulkan-loader ]} for size in 16 24 32 48 64 128; do mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps From b3646e9cd998d02bf3bfedfdb787f56da0d31bb0 Mon Sep 17 00:00:00 2001 From: Gliczy <129636582+Gliczy@users.noreply.github.com> Date: Thu, 12 Sep 2024 22:41:09 +0200 Subject: [PATCH 3/5] gzdoom: fixes --- pkgs/by-name/gz/gzdoom/package.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/gz/gzdoom/package.nix b/pkgs/by-name/gz/gzdoom/package.nix index b1fef391ba6f..2ab2b21009c3 100644 --- a/pkgs/by-name/gz/gzdoom/package.nix +++ b/pkgs/by-name/gz/gzdoom/package.nix @@ -68,9 +68,10 @@ stdenv.mkDerivation rec { 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}\")" + --replace-fail "ret_var(Tag)" "ret_var(\"${src.rev}\")" \ + --replace-fail "ret_var(Timestamp)" "ret_var(\"1970-00-00 00:00:00 +0000\")" \ + --replace-fail "ret_var(Hash)" "ret_var(\"${src.rev}\")" \ + --replace-fail "" "${src.rev}" ''; cmakeFlags = [ @@ -96,8 +97,8 @@ stdenv.mkDerivation rec { for size in 16 24 32 48 64 128; do mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps - convert -background none -resize "$size"x"$size" $src/src/win32/icon1.ico -flatten \ - $out/share/icons/hicolor/"$size"x"$size"/apps/gzdoom.png + magick $src/src/win32/icon1.ico -background none -resize "$size"x"$size" -flatten \ + $out/share/icons/hicolor/"$size"x"$size"/apps/gzdoom.png done; ''; From 6dc99a6a1160de88b8c44ee23b75d0cf166cffdf Mon Sep 17 00:00:00 2001 From: Gliczy <129636582+Gliczy@users.noreply.github.com> Date: Thu, 12 Sep 2024 22:44:25 +0200 Subject: [PATCH 4/5] gzdoom: nixfmt --- pkgs/by-name/gz/gzdoom/package.nix | 67 +++++++++++++++++------------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/pkgs/by-name/gz/gzdoom/package.nix b/pkgs/by-name/gz/gzdoom/package.nix index 2ab2b21009c3..50b49ddab8bc 100644 --- a/pkgs/by-name/gz/gzdoom/package.nix +++ b/pkgs/by-name/gz/gzdoom/package.nix @@ -1,28 +1,29 @@ -{ lib -, stdenv -, fetchFromGitHub -, makeWrapper -, makeDesktopItem -, copyDesktopItems -, SDL2 -, bzip2 -, cmake -, fluidsynth -, game-music-emu -, gtk3 -, imagemagick -, libGL -, libjpeg -, libsndfile -, libvpx -, libwebp -, mpg123 -, ninja -, openal -, pkg-config -, vulkan-loader -, zlib -, zmusic +{ + lib, + stdenv, + fetchFromGitHub, + makeWrapper, + makeDesktopItem, + copyDesktopItems, + SDL2, + bzip2, + cmake, + fluidsynth, + game-music-emu, + gtk3, + imagemagick, + libGL, + libjpeg, + libsndfile, + libvpx, + libwebp, + mpg123, + ninja, + openal, + pkg-config, + vulkan-loader, + zlib, + zmusic, }: stdenv.mkDerivation rec { @@ -37,7 +38,10 @@ stdenv.mkDerivation rec { hash = "sha256-taie1Iod3pXvuxxBC7AArmtndkIV0Di9mtJoPvPkioo="; }; - outputs = [ "out" "doc" ]; + outputs = [ + "out" + "doc" + ]; nativeBuildInputs = [ cmake @@ -102,7 +106,7 @@ stdenv.mkDerivation rec { done; ''; - meta = with lib; { + meta = { homepage = "https://github.com/ZDoom/gzdoom"; description = "Modder-friendly OpenGL and Vulkan source port based on the DOOM engine"; mainProgram = "gzdoom"; @@ -110,8 +114,11 @@ stdenv.mkDerivation rec { GZDoom is a feature centric port for all DOOM engine games, based on ZDoom, adding an OpenGL renderer and powerful scripting capabilities. ''; - license = licenses.gpl3Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ azahi lassulus ]; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + azahi + lassulus + ]; }; } From 6c31bc6af8ba2d0bb2a3eb68ddaa4c15cea834f2 Mon Sep 17 00:00:00 2001 From: Gliczy <129636582+Gliczy@users.noreply.github.com> Date: Thu, 12 Sep 2024 22:47:01 +0200 Subject: [PATCH 5/5] gzdoom: add myself as maintainer --- pkgs/by-name/gz/gzdoom/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/gz/gzdoom/package.nix b/pkgs/by-name/gz/gzdoom/package.nix index 50b49ddab8bc..1856d479426d 100644 --- a/pkgs/by-name/gz/gzdoom/package.nix +++ b/pkgs/by-name/gz/gzdoom/package.nix @@ -119,6 +119,7 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ azahi lassulus + Gliczy ]; }; }