From 03968bade43d23c47e8b4f102c711c171c446645 Mon Sep 17 00:00:00 2001 From: lelgenio Date: Tue, 7 May 2024 21:29:59 -0300 Subject: [PATCH] update 3.3.0 -> 5.2.3 --- default.nix | 55 +++++++++++++++++------- flake.lock | 23 ++-------- flake.nix | 8 +--- patches/0001-don-t-hardcode-zenity.patch | 25 ----------- patches/0002-don-t-check-map-count.patch | 25 ----------- patches/0003-don-t-check-version.patch | 25 ----------- 6 files changed, 44 insertions(+), 117 deletions(-) delete mode 100644 patches/0001-don-t-hardcode-zenity.patch delete mode 100644 patches/0002-don-t-check-map-count.patch delete mode 100644 patches/0003-don-t-check-version.patch diff --git a/default.nix b/default.nix index 4042c33..65bb481 100644 --- a/default.nix +++ b/default.nix @@ -1,21 +1,46 @@ -{ pkgs, lib, stdenv, fetchFromGitHub, makeWrapper }: +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, curl +, jq +, python3 +, wmctrl +, xdotool +, gnome +, gobject-introspection +, wrapGAppsHook +}: stdenv.mkDerivation rec { pname = "dzgui"; - version = "3.3.0"; + version = "5.2.3"; src = fetchFromGitHub { owner = "aclist"; repo = "dztui"; - rev = "10c29c0542a07fb81b5922f96b416e3a2e8079cc"; - sha256 = "sha256-VmW0ohXK+9CAr4yGaA/NSW7+E1vUvZthom8MculmOEs="; + rev = "release/${version}"; + sha256 = "sha256-fXFu2p9jxYfmsrQ1DBbd6pLcgRs/8HJiH6t4A5KevyQ="; }; - nativeBuildInputs = [ makeWrapper ]; + postPatch = '' + sed -i 's@/usr/bin/zenity@zenity@g' dzgui.sh + sed -i '/ check_map_count/d' dzgui.sh + sed -i '/ check_version/d' dzgui.sh + ''; - runtimeDeps = with pkgs; [ + nativeBuildInputs = [ + makeWrapper + gobject-introspection + wrapGAppsHook + ]; + + runtimeDeps = [ curl jq - python3 + (python3.withPackages (p: with p; [ + pygobject3 + ])) + wmctrl xdotool gnome.zenity @@ -26,21 +51,19 @@ stdenv.mkDerivation rec { # steam ]; - patches = lib.pipe ./patches [ - builtins.readDir - lib.attrNames - (map (name: ./patches/${name})) - ]; - installPhase = '' - install -DT dzgui.sh $out/bin/.dzgui-unwrapped_ - makeWrapper $out/bin/.dzgui-unwrapped_ $out/bin/dzgui \ - --prefix PATH ':' ${lib.makeBinPath runtimeDeps} + install -DT dzgui.sh $out/bin/dzgui install -DT ${./dzgui.desktop} $out/share/applications/dzgui.desktop install -DT images/dzgui $out/share/icons/hicolor/256x256/apps/dzgui.png ''; + preFixup = '' + gappsWrapperArgs+=( + --prefix PATH ':' ${lib.makeBinPath runtimeDeps} + ) + ''; + meta = with lib; { homepage = "https://github.com/pronovic/banner"; description = "DayZ TUI/GUI server browser"; diff --git a/flake.lock b/flake.lock index c19bdcc..6c2e518 100644 --- a/flake.lock +++ b/flake.lock @@ -1,28 +1,12 @@ { "nodes": { - "dzgui": { - "flake": false, - "locked": { - "lastModified": 1702780245, - "narHash": "sha256-cdW5LN2Q7eYW8xIqKPQfeYPd7e6VdJGaoA9NMHesCrE=", - "owner": "aclist", - "repo": "dztui", - "rev": "28323f3edb8fa747dc559d1939ccdd7729e4e3a1", - "type": "github" - }, - "original": { - "owner": "aclist", - "repo": "dztui", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1702539185, - "narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=", + "lastModified": 1714562304, + "narHash": "sha256-Mr3U37Rh6tH0FbaDFu0aZDwk9mPAe7ASaqDOGgLqqLU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447", + "rev": "bcd44e224fd68ce7d269b4f44d24c2220fd821e7", "type": "github" }, "original": { @@ -33,7 +17,6 @@ }, "root": { "inputs": { - "dzgui": "dzgui", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index d139db7..4c315d0 100644 --- a/flake.nix +++ b/flake.nix @@ -2,12 +2,8 @@ description = "DayZ TUI/GUI server browser"; inputs = { nixpkgs.url = "nixpkgs/nixpkgs-unstable"; - dzgui = { - url = "github:aclist/dztui"; - flake = false; - }; }; - outputs = { self, nixpkgs, dzgui, ... }: + outputs = { self, nixpkgs, ... }: let # DayZ only runs on x86_64 systems system = "x86_64-linux"; @@ -24,7 +20,7 @@ overlays = { default = (final: _: { - dzgui = (final.callPackage ./. { }).overrideAttrs (_: { src = dzgui; }); + dzgui = (final.callPackage ./. { }); }); }; diff --git a/patches/0001-don-t-hardcode-zenity.patch b/patches/0001-don-t-hardcode-zenity.patch deleted file mode 100644 index bac2403..0000000 --- a/patches/0001-don-t-hardcode-zenity.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 79100e2057f8bf9806beacb55b7dca0424d1ca0c Mon Sep 17 00:00:00 2001 -From: lelgenio -Date: Wed, 17 May 2023 22:47:53 -0300 -Subject: [PATCH 1/3] don't hardcode zenity - ---- - dzgui.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dzgui.sh b/dzgui.sh -index 7c9d023..73c54bb 100755 ---- a/dzgui.sh -+++ b/dzgui.sh -@@ -39,7 +39,7 @@ notify_url="$stable_url/helpers/d.html" - notify_img_url="$stable_url/helpers/d.webp" - forum_url="https://github.com/aclist/dztui/discussions" - version_file="$config_path/versions" --steamsafe_zenity="/usr/bin/zenity" -+steamsafe_zenity="zenity" - - #TODO: prevent connecting to offline servers - #TODO: abstract zenity title params and dimensions --- -2.40.1 - diff --git a/patches/0002-don-t-check-map-count.patch b/patches/0002-don-t-check-map-count.patch deleted file mode 100644 index b58dcfa..0000000 --- a/patches/0002-don-t-check-map-count.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7d2f5301ab455e784d6ec1c5c88b25645a147d16 Mon Sep 17 00:00:00 2001 -From: lelgenio -Date: Wed, 17 May 2023 22:36:46 -0300 -Subject: [PATCH 2/3] don't check map count - ---- - dzgui.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dzgui.sh b/dzgui.sh -index 73c54bb..893851d 100755 ---- a/dzgui.sh -+++ b/dzgui.sh -@@ -1892,7 +1892,7 @@ initial_setup(){ - watcher_deps - check_architecture - check_version -- check_map_count -+ # check_map_count - fetch_helpers - config - steam_deps --- -2.40.1 - diff --git a/patches/0003-don-t-check-version.patch b/patches/0003-don-t-check-version.patch deleted file mode 100644 index adfc9e3..0000000 --- a/patches/0003-don-t-check-version.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0ac99c0f2b5d1b86c1cd155c69e2a3fd86a0d448 Mon Sep 17 00:00:00 2001 -From: lelgenio -Date: Fri, 18 Aug 2023 14:15:35 -0300 -Subject: [PATCH 3/3] don't check for new versions - ---- - dzgui.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dzgui.sh b/dzgui.sh -index 893851d..ec072e4 100755 ---- a/dzgui.sh -+++ b/dzgui.sh -@@ -1891,7 +1891,7 @@ initial_setup(){ - run_depcheck - watcher_deps - check_architecture -- check_version -+ # check_version - # check_map_count - fetch_helpers - config --- -2.40.1 -