dzgui-nix/package/default.nix

83 lines
1.8 KiB
Nix
Raw Normal View History

2024-10-01 12:10:35 -03:00
{
lib,
stdenv,
pkgs,
fetchFromGitea,
2024-10-01 12:10:35 -03:00
makeWrapper,
curl,
jq,
python3,
wmctrl,
xdotool,
gnome,
gobject-introspection,
wrapGAppsHook,
}:
stdenv.mkDerivation rec {
pname = "dzgui";
2024-12-13 22:21:02 -03:00
version = "5.5.3";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "aclist";
repo = "dztui";
2024-12-13 22:21:02 -03:00
rev = "c11511abffce734691ee2d6981ede966838afb4d";
hash = "sha256-eUOQ56AIGaZ1DNUPJkQQu48ZkK3bxeR0ghwHzWcCqHE=";
};
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
sed -i '/ write_desktop_file >/d' dzgui.sh
'';
nativeBuildInputs = [
makeWrapper
gobject-introspection
wrapGAppsHook
];
runtimeDeps = [
curl
jq
2024-10-01 12:10:35 -03:00
(python3.withPackages (p: with p; [ pygobject3 ]))
wmctrl
xdotool
2024-11-30 13:03:56 -03:00
# TODO: remove 24.05 compatibility when it goes EOL
(pkgs.zenity or gnome.zenity)
## Here we don't declare steam as a dependency because
## we could either use the native or flatpack version
## and also so this does not become a non-free package
# steam
];
installPhase = ''
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://codeberg.org/aclist/dztui";
description = "DayZ TUI/GUI server browser";
license = licenses.gpl3;
longDescription = ''
DZGUI allows you to connect to both official and modded/community DayZ
servers on Linux and provides a graphical interface for doing so.
'';
platforms = platforms.all;
};
}