From ff22fdef1e004138dc7fc7f58fe4365134b4e53f Mon Sep 17 00:00:00 2001 From: Florian Brandes Date: Fri, 2 Jun 2023 14:46:14 +0200 Subject: [PATCH] gamepad-tool: init at 1.2 Signed-off-by: Florian Brandes --- pkgs/games/gamepad-tool/default.nix | 46 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 48 insertions(+) create mode 100644 pkgs/games/gamepad-tool/default.nix diff --git a/pkgs/games/gamepad-tool/default.nix b/pkgs/games/gamepad-tool/default.nix new file mode 100644 index 000000000000..b73a1d4f3c0d --- /dev/null +++ b/pkgs/games/gamepad-tool/default.nix @@ -0,0 +1,46 @@ +{ stdenvNoCC, fetchurl, dpkg, lib, qt5, autoPatchelfHook, SDL2 }: + +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "gamepad-tool"; + version = "1.2"; + + src = fetchurl { + url = "https://generalarcade.com/gamepadtool/linux/gamepadtool_${finalAttrs.version}_amd64.deb"; + hash = "sha256-ZuB0TOyT2B5QkU1o5h3/8PL85tBq06hlz5YclRanD88="; + }; + + nativeBuildInputs = [ dpkg qt5.wrapQtAppsHook autoPatchelfHook ]; + + unpackCmd = '' + mkdir -p root + dpkg-deb -x $curSrc root + ''; + + dontBuild = true; + + buildInputs = [ + SDL2 + qt5.qtbase + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin $out/share/applications + cp usr/bin/gamepad-tool $out/bin + cp -r usr/share/icons $out/share/icons + substitute usr/share/applications/gamepad-tool-debian.desktop \ + $out/share/applications/gamepad-tool.desktop \ + --replace "Exec=gamepad-tool" "Exec=$out/bin/gamepad-tool" \ + --replace "/usr/share/icons/hicolor/256x256/apps/gamepad-tool.png" "$out/share/icons/hicolor/256x256/apps/gamepad-tool.png" + runHook postInstall + ''; + + meta = with lib; { + description = "A simple GUI tool to create/modify gamepad mappings for games that use SDL2 Game Controller API"; + homepage = "https://generalarcade.com/gamepadtool/"; + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ gador ]; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 593aac570487..2f6a980f9cb2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -36139,6 +36139,8 @@ with pkgs; freenukum = callPackage ../games/freenukum { }; + gamepad-tool = callPackage ../games/gamepad-tool { }; + gnome-hexgl = callPackage ../games/gnome-hexgl { }; gotypist = callPackage ../games/gotypist { };