From e9b39ae01c1af6f4be2359a19c0817656412d82c Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Thu, 2 Jun 2022 21:26:59 +0200 Subject: butler: init at 15.21.0 --- pkgs/games/itch/butler.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pkgs/games/itch/butler.nix (limited to 'pkgs/games') diff --git a/pkgs/games/itch/butler.nix b/pkgs/games/itch/butler.nix new file mode 100644 index 0000000000000..68f1bac49e903 --- /dev/null +++ b/pkgs/games/itch/butler.nix @@ -0,0 +1,29 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "butler"; + version = "15.21.0"; + + src = fetchFromGitHub { + owner = "itchio"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-vciSmXR3wI3KcnC+Uz36AgI/WUfztA05MJv1InuOjJM="; + }; + + proxyVendor = true; + + vendorSha256 = "sha256-EIl0ZFDKbZopUR22hp5a2vRUu0O1h1O953NrtoNa2x8="; + + doCheck = false; + + meta = with lib; { + description = "Command-line itch.io helper"; + homepage = "https://github.com/itchio/butler"; + license = licenses.mit; + maintainers = with maintainers; [ martfont ]; + }; +} -- cgit 1.4.1 From deabb657a28f8c84226ac6a630bb0ce20c38e5b4 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Thu, 2 Jun 2022 21:29:40 +0200 Subject: itch: install binary in system --- pkgs/games/itch/default.nix | 85 ++++++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 24 deletions(-) (limited to 'pkgs/games') diff --git a/pkgs/games/itch/default.nix b/pkgs/games/itch/default.nix index 34a2775c3c80c..991623b6c9f7e 100644 --- a/pkgs/games/itch/default.nix +++ b/pkgs/games/itch/default.nix @@ -1,30 +1,56 @@ { lib , stdenvNoCC -, fetchurl -, libnotify -, nss -, gtk3 +, fetchpatch +, fetchzip , fetchFromGitHub +, butler +, electron_11 +, steam-run +, makeWrapper +, copyDesktopItems , makeDesktopItem -, itch-setup -, runtimeShell }: -stdenvNoCC.mkDerivation rec{ +stdenvNoCC.mkDerivation rec { pname = "itch"; version = "25.5.1"; - src = fetchFromGitHub { - owner = "itchio"; - repo = pname; - rev = "v${version}"; - hash = "sha256-Pi3l3uK4kr+N3p7fGQuqckYIzycRqJHDVX00reoSbp4="; + src = fetchzip { + url = "https://broth.itch.ovh/${pname}/linux-amd64/${version}/itch.zip"; + stripRoot = false; + sha256 = "sha256-ejfS+sqhacW2h8u96W4fout3V8xrBs0SrW5w/7X83m4="; }; + patches = [ + # Fixes crash while browsing the store. + (fetchpatch { + name = "itch.patch"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/itch.patch?h=itch-bin&id=0b181454567029141749f870880b10093216e133"; + sha256 = "sha256-gmLL/BMondSflERm0z+DuGDP56JhDXiyxEwLUavTD8Q="; + }) + ]; + + itch-setup = fetchzip { + url = "https://broth.itch.ovh/itch-setup/linux-amd64/1.26.0/itch-setup.zip"; + stripRoot = false; + sha256 = "sha256-5MP6X33Jfu97o5R1n6Og64Bv4ZMxVM0A8lXeQug+bNA="; + }; + + icons = let sparseCheckout = "/release/images/itch-icons"; in + fetchFromGitHub { + owner = "itchio"; + repo = pname; + rev = "v${version}"; + hash = "sha256-1L6STTBHA9xL9IaERaH2OTvurTSng1D+P3KoW0ucEJc="; + inherit sparseCheckout; + } + sparseCheckout; + + nativeBuildInputs = [ copyDesktopItems makeWrapper ]; + desktopItems = [ (makeDesktopItem { name = pname; - exec = pname; - tryExec = "itch %U"; + exec = "itch %U"; + tryExec = pname; icon = pname; desktopName = pname; mimeTypes = [ "x-scheme-handler/itchio" "x-scheme-handler/itch" ]; @@ -33,23 +59,33 @@ stdenvNoCC.mkDerivation rec{ }) ]; - itchBin = '' - #!${runtimeShell} - exec ${itch-setup}/bin/itch-setup --prefer-launch -- "$@" - ''; + # As taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=itch-bin + installPhase = '' + runHook preInstall - passAsFile = [ "itchBin" ]; + mkdir -p $out/bin $out/share/${pname}/resources/app + cp -r resources/app "$out/share/${pname}/resources/" - # as taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=itch - installPhase = '' - install -Dm0777 $itchBinPath $out/bin/itch - for icon in release/images/itch-icons/icon*.png + install -Dm644 LICENSE -t "$out/share/licenses/$pkgname/" + install -Dm644 LICENSES.chromium.html -t "$out/share/licenses/$pkgname/" + + for icon in $icons/icon*.png do - iconsize="''${icon#release/images/itch-icons/icon}" + iconsize="''${icon#$icons/icon}" iconsize="''${iconsize%.png}" icondir="$out/share/icons/hicolor/''${iconsize}x''${iconsize}/apps/" install -Dm644 "$icon" "$icondir/itch.png" done + + runHook postInstall + ''; + + postFixup = '' + makeWrapper ${steam-run}/bin/steam-run $out/bin/${pname} \ + --add-flags ${electron_11}/bin/electron \ + --add-flags $out/share/${pname}/resources/app \ + --set BROTH_USE_LOCAL butler,itch-setup \ + --prefix PATH : ${butler}/bin/:${itch-setup} ''; meta = with lib; { @@ -57,6 +93,7 @@ stdenvNoCC.mkDerivation rec{ homepage = "https://github.com/itchio/itch"; license = licenses.mit; platforms = platforms.linux; + sourceProvenance = lib.sourceTypes.binaryBytecode; maintainers = with maintainers; [ pasqui23 ]; }; } -- cgit 1.4.1 From b3080101af5fd937ee3ba6a6bfc60c4f3c5881d4 Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Thu, 2 Jun 2022 21:29:57 +0200 Subject: itch-setup: remove --- pkgs/games/itch-setup/default.nix | 24 ------------------------ pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 pkgs/games/itch-setup/default.nix (limited to 'pkgs/games') diff --git a/pkgs/games/itch-setup/default.nix b/pkgs/games/itch-setup/default.nix deleted file mode 100644 index 55d488bcaac06..0000000000000 --- a/pkgs/games/itch-setup/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ lib, writeShellScriptBin, steam-run, fetchurl }: -let - - pname = "itch-setup"; - version = "1.26.0"; - - src = fetchurl { - url = "https://broth.itch.ovh/itch-setup/linux-amd64/${version}/unpacked/default"; - hash = "sha256-bcJKqhgZK42Irx12BIvbTDMb/DHEOEXljetlDokF7x8="; - executable = true; - }; - -in -(writeShellScriptBin pname ''exec ${steam-run}/bin/steam-run ${src} "$@"'') // { - - passthru = { inherit pname version src; }; - meta = with lib; { - description = "An installer for the itch.io desktop app"; - homepage = "https://github.com/itchio/itch-setup"; - license = licenses.mit; - platforms = platforms.linux; - maintainers = with maintainers; [ pasqui23 ]; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 3b2a08673c7fa..fdf0e40de72cd 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -619,6 +619,7 @@ mapAliases ({ iops = throw "iops was removed: upstream is gone"; # Added 2022-02-06 iproute = iproute2; # moved from top-level 2021-03-14 ipsecTools = throw "ipsecTools has benn removed, because it was no longer maintained upstream"; # Added 2021-12-15 + itch-setup = throw "itch-setup has benn removed, use itch instead"; # Added 2022-06-02 ### J ### diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a80bc9b84c6fe..38b94345ec5f0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2429,8 +2429,6 @@ with pkgs; itch = callPackage ../games/itch {}; - itch-setup = callPackage ../games/itch-setup {}; - lastpass-cli = callPackage ../tools/security/lastpass-cli { }; leetcode-cli = callPackage ../applications/misc/leetcode-cli { }; -- cgit 1.4.1