Merge pull request #320861 from SuperSamus/itch-update

itch: 26.1.3 -> 26.1.9
This commit is contained in:
Weijia Wang 2024-07-02 17:30:45 +02:00 committed by GitHub
commit 9547e46d03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 51 additions and 92 deletions

View File

@ -1,50 +0,0 @@
{ lib
, buildGoModule
, fetchFromGitHub
, stdenv
, Cocoa
, fetchpatch
}:
buildGoModule rec {
pname = "butler";
version = "15.21.0";
src = fetchFromGitHub {
owner = "itchio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-vciSmXR3wI3KcnC+Uz36AgI/WUfztA05MJv1InuOjJM=";
};
buildInputs = lib.optionals stdenv.isDarwin [
Cocoa
];
patches = [
# update x/sys dependency for darwin build https://github.com/itchio/butler/pull/245
(fetchpatch {
url = "https://github.com/itchio/butler/pull/245/commits/ef651d373e3061fda9692dd44ae0f7ce215e9655.patch";
hash = "sha256-rZZn/OGiv3mRyy89uORyJ99zWN21kZCCQAlFvSKxlPU=";
})
];
proxyVendor = true;
vendorHash = "sha256-GvUUCQ2BPW0HlXZljBWJ2Wyys9OEIM55dEWAa6J19Zg=";
doCheck = false;
meta = with lib; {
# butler cannot be build with Go >=1.21
# See https://github.com/itchio/butler/issues/256
# and https://github.com/itchio/dmcunrar-go/issues/1
# The dependency causing the issue is marked as 'no maintainence intended'.
# Last butler release is from 05/2021.
broken = true;
description = "Command-line itch.io helper";
homepage = "https://github.com/itchio/butler";
license = licenses.mit;
maintainers = with maintainers; [ martfont ];
};
}

View File

@ -1,23 +1,21 @@
{ lib
, stdenvNoCC
, fetchzip
, fetchFromGitHub
, butler
, electron
, steam-run
, makeWrapper
, copyDesktopItems
, makeDesktopItem
{
lib,
stdenvNoCC,
fetchzip,
fetchFromGitHub,
electron,
steam-run,
makeWrapper,
copyDesktopItems,
makeDesktopItem,
}:
stdenvNoCC.mkDerivation rec {
pname = "itch";
version = "26.1.3";
# TODO: Using kitch instead of itch, revert when possible
src = fetchzip {
url = "https://broth.itch.ovh/kitch/linux-amd64/${version}/archive/default#.zip";
let
version = "26.1.9";
butler = fetchzip {
url = "https://broth.itch.zone/butler/linux-amd64/15.21.0/butler.zip";
stripRoot = false;
hash = "sha256-FHwbzLPMzIpyg6KyYTq6/rSNRH76dytwb9D5f9vNKkU=";
hash = "sha256-jHni/5qf7xST6RRonP2EW8fJ6647jobzrnHe8VMx4IA=";
};
itch-setup = fetchzip {
@ -26,16 +24,31 @@ stdenvNoCC.mkDerivation rec {
hash = "sha256-5MP6X33Jfu97o5R1n6Og64Bv4ZMxVM0A8lXeQug+bNA=";
};
icons = let sparseCheckout = "/release/images/itch-icons"; in
sparseCheckout = "/release/images/itch-icons";
icons =
fetchFromGitHub {
owner = "itchio";
repo = "itch";
rev = "v${version}-canary";
hash = "sha256-0AMyDZ5oI7/pSvudoEqXnMZJtpcKVlUSR6YVm+s4xv0=";
sparseCheckout = [ sparseCheckout ];
} + sparseCheckout;
owner = "itchio";
repo = "itch";
rev = "v${version}";
hash = "sha256-jugg+hdP0y0OkFhdQuEI9neWDuNf2p3+DQuwxe09Zck=";
sparseCheckout = [ sparseCheckout ];
}
+ sparseCheckout;
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "itch";
inherit version;
nativeBuildInputs = [ copyDesktopItems makeWrapper ];
src = fetchzip {
url = "https://broth.itch.ovh/itch/linux-amd64/${finalAttrs.version}/archive/default#.zip";
stripRoot = false;
hash = "sha256-4k6afBgOKGs7rzXAtIBpmuQeeT/Va8/0bZgNYjuJhgI=";
};
nativeBuildInputs = [
copyDesktopItems
makeWrapper
];
desktopItems = [
(makeDesktopItem {
@ -44,7 +57,10 @@ stdenvNoCC.mkDerivation rec {
tryExec = "itch";
icon = "itch";
desktopName = "itch";
mimeTypes = [ "x-scheme-handler/itchio" "x-scheme-handler/itch" ];
mimeTypes = [
"x-scheme-handler/itchio"
"x-scheme-handler/itch"
];
comment = "Install and play itch.io games easily";
categories = [ "Game" ];
})
@ -54,19 +70,15 @@ stdenvNoCC.mkDerivation rec {
installPhase = ''
runHook preInstall
# TODO: Remove when the next stable Itch is stabilized
substituteInPlace ./resources/app/package.json \
--replace "kitch" "itch"
mkdir -p $out/bin $out/share/itch/resources/app
cp -r resources/app "$out/share/itch/resources/"
install -Dm644 LICENSE -t "$out/share/licenses/$pkgname/"
install -Dm644 LICENSES.chromium.html -t "$out/share/licenses/$pkgname/"
for icon in $icons/icon*.png
for icon in ${icons}/icon*.png
do
iconsize="''${icon#$icons/icon}"
iconsize="''${icon#${icons}/icon}"
iconsize="''${iconsize%.png}"
icondir="$out/share/icons/hicolor/''${iconsize}x''${iconsize}/apps/"
install -Dm644 "$icon" "$icondir/itch.png"
@ -80,16 +92,16 @@ stdenvNoCC.mkDerivation rec {
--add-flags ${electron}/bin/electron \
--add-flags $out/share/itch/resources/app \
--set BROTH_USE_LOCAL butler,itch-setup \
--prefix PATH : ${butler}/bin/:${itch-setup}
--prefix PATH : ${butler}:${itch-setup}
'';
meta = with lib; {
meta = {
description = "Best way to play itch.io games";
homepage = "https://github.com/itchio/itch";
license = licenses.mit;
platforms = platforms.linux;
license = lib.licenses.mit;
platforms = lib.platforms.linux;
sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
maintainers = with maintainers; [ pasqui23 ];
maintainers = with lib.maintainers; [ pasqui23 ];
mainProgram = "itch";
};
}
})

View File

@ -156,6 +156,7 @@ mapAliases ({
bro = throw "'bro' has been renamed to/replaced by 'zeek'"; # Converted to throw 2023-09-10
inherit (libsForQt5.mauiPackages) buho; # added 2022-05-17
bukut = throw "bukut has been removed since it has been archived by upstream"; # Added 2023-05-24
butler = throw "butler was removed because it was broken and abandoned upstream"; # added 2024-06-18
# Shorter names; keep the longer name for back-compat. Added 2023-04-11
buildFHSUserEnv = buildFHSEnv;
buildFHSUserEnvChroot = buildFHSEnvChroot;

View File

@ -1688,10 +1688,6 @@ with pkgs;
btc-rpc-explorer = callPackage ../tools/misc/btc-rpc-explorer { };
butler = callPackage ../by-name/bu/butler/package.nix {
inherit (darwin.apple_sdk.frameworks) Cocoa;
};
carbon-now-cli = callPackage ../tools/typesetting/carbon-now-cli { };
cf-vault = callPackage ../tools/admin/cf-vault { };