12 stdenvNoCC.mkDerivation rec {
16 # TODO: Using kitch instead of itch, revert when possible
18 url = "https://broth.itch.ovh/k${pname}/linux-amd64/${version}/archive/default#.zip";
20 sha256 = "sha256-thXe+glpltSiKNGIRgvOZQZPJWfDHWo3dLdziyp2BM4=";
23 itch-setup = fetchzip {
24 url = "https://broth.itch.ovh/itch-setup/linux-amd64/1.26.0/itch-setup.zip";
26 sha256 = "sha256-5MP6X33Jfu97o5R1n6Og64Bv4ZMxVM0A8lXeQug+bNA=";
29 icons = let sparseCheckout = "/release/images/itch-icons"; in
33 rev = "v${version}-canary";
34 sha256 = "sha256-veZiKs9qHge+gCEpJ119bAT56ssXJAH3HBcYkEHqBFg=";
35 sparseCheckout = [ sparseCheckout ];
38 nativeBuildInputs = [ copyDesktopItems makeWrapper ];
47 mimeTypes = [ "x-scheme-handler/itchio" "x-scheme-handler/itch" ];
48 comment = "Install and play itch.io games easily";
49 categories = [ "Game" ];
53 # As taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=itch-bin
57 # TODO: Remove when the next stable Itch is stabilized
58 substituteInPlace ./resources/app/package.json \
59 --replace "kitch" "itch"
61 mkdir -p $out/bin $out/share/${pname}/resources/app
62 cp -r resources/app "$out/share/${pname}/resources/"
64 install -Dm644 LICENSE -t "$out/share/licenses/$pkgname/"
65 install -Dm644 LICENSES.chromium.html -t "$out/share/licenses/$pkgname/"
67 for icon in $icons/icon*.png
69 iconsize="''${icon#$icons/icon}"
70 iconsize="''${iconsize%.png}"
71 icondir="$out/share/icons/hicolor/''${iconsize}x''${iconsize}/apps/"
72 install -Dm644 "$icon" "$icondir/itch.png"
79 makeWrapper ${steam-run}/bin/steam-run $out/bin/${pname} \
80 --add-flags ${electron}/bin/electron \
81 --add-flags $out/share/${pname}/resources/app \
82 --set BROTH_USE_LOCAL butler,itch-setup \
83 --prefix PATH : ${butler}/bin/:${itch-setup}
87 description = "The best way to play itch.io games";
88 homepage = "https://github.com/itchio/itch";
89 license = licenses.mit;
90 platforms = platforms.linux;
91 sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
92 maintainers = with maintainers; [ pasqui23 ];