From 3276eb35eb212fcfa18a3d317ef8a8caca7ce143 Mon Sep 17 00:00:00 2001 From: DataEraserC <102341238+DataEraserC@users.noreply.github.com> Date: Sat, 28 Oct 2023 14:01:20 +0800 Subject: [PATCH] Rename watt-toolkit to watt-toolkit_{big version} --- default.nix | 2 +- pkgs/watt-toolkit/default.nix | 1 - pkgs/watt-toolkit_2/default.nix | 1 + .../watt-toolkit_2.nix} | 0 pkgs/watt-toolkit_3/default.nix | 1 + pkgs/watt-toolkit_3/watt-toolkit_3.nix | 67 +++++++++++++++++++ 6 files changed, 70 insertions(+), 2 deletions(-) delete mode 100644 pkgs/watt-toolkit/default.nix create mode 100644 pkgs/watt-toolkit_2/default.nix rename pkgs/{watt-toolkit/watt-toolkit.nix => watt-toolkit_2/watt-toolkit_2.nix} (100%) create mode 100644 pkgs/watt-toolkit_3/default.nix create mode 100644 pkgs/watt-toolkit_3/watt-toolkit_3.nix diff --git a/default.nix b/default.nix index 80d3a96..16f3f0c 100644 --- a/default.nix +++ b/default.nix @@ -33,7 +33,7 @@ iUnderstandThatReplacingMoltenVKAndDXVKIsNotSupportedByCodeWeaversAndWillNotBotherThemForSupport = true; }; - watt-toolkit = pkgs.callPackage ./pkgs/watt-toolkit { }; + watt-toolkit_2 = pkgs.callPackage ./pkgs/watt-toolkit_2 { }; # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # ... } diff --git a/pkgs/watt-toolkit/default.nix b/pkgs/watt-toolkit/default.nix deleted file mode 100644 index 39f4660..0000000 --- a/pkgs/watt-toolkit/default.nix +++ /dev/null @@ -1 +0,0 @@ -import ./watt-toolkit.nix diff --git a/pkgs/watt-toolkit_2/default.nix b/pkgs/watt-toolkit_2/default.nix new file mode 100644 index 0000000..a359f42 --- /dev/null +++ b/pkgs/watt-toolkit_2/default.nix @@ -0,0 +1 @@ +import ./watt-toolkit_2.nix diff --git a/pkgs/watt-toolkit/watt-toolkit.nix b/pkgs/watt-toolkit_2/watt-toolkit_2.nix similarity index 100% rename from pkgs/watt-toolkit/watt-toolkit.nix rename to pkgs/watt-toolkit_2/watt-toolkit_2.nix diff --git a/pkgs/watt-toolkit_3/default.nix b/pkgs/watt-toolkit_3/default.nix new file mode 100644 index 0000000..6e4f90d --- /dev/null +++ b/pkgs/watt-toolkit_3/default.nix @@ -0,0 +1 @@ +import ./watt-toolkit_3.nix diff --git a/pkgs/watt-toolkit_3/watt-toolkit_3.nix b/pkgs/watt-toolkit_3/watt-toolkit_3.nix new file mode 100644 index 0000000..c92ae39 --- /dev/null +++ b/pkgs/watt-toolkit_3/watt-toolkit_3.nix @@ -0,0 +1,67 @@ +{ lib, stdenv, fetchurl, dpkg, imagemagick, copyDesktopItems, makeDesktopItem +, autoPatchelfHook, wrapGAppsHook, icu, openssl, xorg }: + +let + version = "2.8.6"; + srcs = { + x86_64-linux = fetchurl { + url = + "https://github.com/BeyondDimension/SteamTools/releases/download/${version}/Steam++_linux_x64_v${version}.deb"; + sha256 = "183393l89s1il6ihyhwn3aai13yvgdi6831c09zmpvlcbaks0l9d"; + }; + aarch64-linux = fetchurl { + url = + "https://github.com/BeyondDimension/SteamTools/releases/download/${version}/Steam++_linux_arm64_v${version}.deb"; + sha256 = "1k3j9kr6mkrni7cbszb5sx4bj25ajdqsjlcrz4hm9kd3fc054zgf"; + }; + }; + src = srcs.${stdenv.hostPlatform.system} or (throw + "Unsupported system: ${stdenv.hostPlatform.system}"); +in stdenv.mkDerivation rec { + pname = "watt-toolkit"; + inherit version src; + + nativeBuildInputs = + [ autoPatchelfHook dpkg wrapGAppsHook imagemagick copyDesktopItems ]; + + desktopItems = [ + (makeDesktopItem { + name = "watt-toolkit"; + exec = "watt-toolkit"; + icon = "watt-toolkit"; + comment = meta.description; + desktopName = "Watt Toolkit"; + categories = [ "Utility" ]; + }) + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/opt $out/bin $out/share/icons/hicolor/256x256/apps + cp -r usr/share/Steam++ $out/opt/watt-toolkit + magick usr/share/Steam++/Steam++.ico watt-toolkit.png + install -Dm644 watt-toolkit-0.png $out/share/icons/hicolor/256x256/apps/watt-toolkit.png + ln -sf $out/opt/watt-toolkit/Steam++ $out/bin/watt-toolkit + runHook postInstall + ''; + + preFixup = let + libpath = + lib.makeLibraryPath ([ icu openssl xorg.libX11 xorg.libICE xorg.libSM ]); + in '' + gappsWrapperArgs+=( + --set LD_LIBRARY_PATH ${libpath} + ) + ''; + + meta = with lib; { + homepage = "https://steampp.net"; + description = "A cross-platform Steam toolbox"; + license = licenses.gpl3Only; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + maintainers = with maintainers; [ rs0vere ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; + broken = true; + }; +} +# https://github.com/NixOS/nixpkgs/commit/dc8096826abb3a3e5addc633ea74a58cceb1c78d