diff --git a/default.nix b/default.nix index 07746da..3f1dbf3 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,7 @@ { pkgs, lib, stdenv, fetchFromGitHub, makeWrapper }: stdenv.mkDerivation rec { pname = "dzgui"; - version = "0.1"; + version = "3.3.0"; src = fetchFromGitHub { owner = "aclist"; @@ -27,21 +27,18 @@ stdenv.mkDerivation rec { ]; patches = [ - ./dont-write-desktop-entry-during-runtime.patch + ./patches/dont-hardcode-zenity.patch + ./patches/dont-write-desktop-entry-during-runtime.patch + ./patches/dont-check-map-count.patch ]; - postPatch = '' - sed -i \ - -e 's|/usr/bin/zenity|${pkgs.gnome.zenity}/bin/zenity|' \ - -e 's|2>/dev/null||' \ - dzgui.sh - ''; - installPhase = '' install -DT dzgui.sh $out/bin/.dzgui-unwrapped_ - install -DT ${./dzgui.desktop} $out/share/applications/dzgui.desktop makeWrapper $out/bin/.dzgui-unwrapped_ $out/bin/dzgui \ --prefix PATH ':' ${lib.makeBinPath runtimeDeps} + + install -DT ${./dzgui.desktop} $out/share/applications/dzgui.desktop + install -DT images/dzgui $out/share/icons/hicolor/256x256/apps/dzgui.png ''; meta = with lib; { diff --git a/dont-write-desktop-entry-during-runtime.patch b/dont-write-desktop-entry-during-runtime.patch deleted file mode 100644 index 417efbd..0000000 --- a/dont-write-desktop-entry-during-runtime.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/dzgui.sh b/dzgui.sh -index d8a895b..0c6c002 100755 ---- a/dzgui.sh -+++ b/dzgui.sh -@@ -222,10 +222,6 @@ freedesktop_dirs(){ - for i in dzgui grid.png hero.png logo.png; do - curl -s "$img_url/$i" > "$sd_install_path/$i" - done -- write_desktop_file > "$freedesktop_path/dzgui.desktop" -- if [[ $is_steam_deck -eq 1 ]]; then -- write_desktop_file > "$HOME/Desktop/dzgui.desktop" -- fi - } - find_library_folder(){ - steam_path=$(python3 $helpers_path/vdf2json.py -i $default_steam_path/steamapps/libraryfolders.vdf | jq -r '.libraryfolders[]|select(.apps|has("221100")).path') diff --git a/dzgui.desktop b/dzgui.desktop index 98317c2..95c1f7d 100644 --- a/dzgui.desktop +++ b/dzgui.desktop @@ -4,4 +4,5 @@ Type=Application Terminal=false Exec=dzgui Name=DZGUI +Icon=dzgui Categories=Game diff --git a/flake.lock b/flake.lock index e7f5fa7..22fa3db 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "dzgui": { "flake": false, "locked": { - "lastModified": 1677659849, - "narHash": "sha256-yTa/CN+GN/+UIp/2501iYRVoo4X6HcZdaS62gutBI4o=", + "lastModified": 1684281410, + "narHash": "sha256-mjkEouCBiAu4so1kolmHbZAyH63LSGlrv4JANcj8+Vc=", "owner": "aclist", "repo": "dztui", - "rev": "c7c93558ae130e5281cebb3231f32377d37d21e2", + "rev": "8f66d12131f639116436dc41adf45632ab4251b5", "type": "github" }, "original": { @@ -18,16 +18,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1678470307, - "narHash": "sha256-OEeMUr3ueLIXyW/OaFUX5jUdimyQwMg/7e+/Q0gC/QE=", + "lastModified": 1684280442, + "narHash": "sha256-nC1/kfh6tpMQSLQalbNTNnireIlxvLLugrjZdasNh+I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0c4800d579af4ed98ecc47d464a5e7b0870c4b1f", + "rev": "6c591e7adc514090a77209f56c9d0c551ab8530d", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-unstable", + "ref": "nixos-22.11", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index cf863e6..c988f88 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { description = "DayZ TUI/GUI server browser"; inputs = { - nixpkgs.url = "nixpkgs/nixos-unstable"; + nixpkgs.url = "nixpkgs/nixos-22.11"; dzgui = { url = "github:aclist/dztui"; flake = false; diff --git a/patches/dont-check-map-count.patch b/patches/dont-check-map-count.patch new file mode 100644 index 0000000..1924dfe --- /dev/null +++ b/patches/dont-check-map-count.patch @@ -0,0 +1,13 @@ +diff --git a/dzgui.sh b/dzgui.sh +index cbd49c2..d61b716 100755 +--- a/dzgui.sh ++++ b/dzgui.sh +@@ -1850,7 +1850,7 @@ initial_setup(){ + watcher_deps + check_architecture + check_version +- check_map_count ++ # check_map_count + fetch_helpers + config + steam_deps diff --git a/patches/dont-hardcode-zenity.patch b/patches/dont-hardcode-zenity.patch new file mode 100644 index 0000000..191d10f --- /dev/null +++ b/patches/dont-hardcode-zenity.patch @@ -0,0 +1,13 @@ +diff --git a/dzgui.sh b/dzgui.sh +index 6f98976..8293d45 100755 +--- a/dzgui.sh ++++ b/dzgui.sh +@@ -37,7 +37,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 diff --git a/patches/dont-write-desktop-entry-during-runtime.patch b/patches/dont-write-desktop-entry-during-runtime.patch new file mode 100644 index 0000000..6314d4c --- /dev/null +++ b/patches/dont-write-desktop-entry-during-runtime.patch @@ -0,0 +1,12 @@ +diff --git a/dzgui.sh b/dzgui.sh +index d61b716..6f98976 100755 +--- a/dzgui.sh ++++ b/dzgui.sh +@@ -214,6 +214,7 @@ Categories=Game + END + } + freedesktop_dirs(){ ++ return + mkdir -p "$sd_install_path" + mkdir -p "$freedesktop_path" + #TODO: update url