From 1b42f2ffbf5c12044b9792a77f5828f6877ccae1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 14 Mar 2024 05:40:09 +0300 Subject: [PATCH] proton-ge-bin: init at init at 9-1 Co-authored-by: Shawn8901 --- pkgs/by-name/pr/proton-ge-bin/package.nix | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkgs/by-name/pr/proton-ge-bin/package.nix diff --git a/pkgs/by-name/pr/proton-ge-bin/package.nix b/pkgs/by-name/pr/proton-ge-bin/package.nix new file mode 100644 index 000000000000..1002a549cbcd --- /dev/null +++ b/pkgs/by-name/pr/proton-ge-bin/package.nix @@ -0,0 +1,50 @@ +{ lib +, stdenvNoCC +, fetchurl +, writeScript +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "proton-ge-bin"; + version = "GE-Proton9-1"; + + src = fetchurl { + url = "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/${finalAttrs.version}/${finalAttrs.version}.tar.gz"; + hash = "sha256-wCIffeayOy3kEwmIKB7e+NrliuSpKXoVYC334fxVB3U="; + }; + + buildCommand = '' + runHook preBuild + mkdir -p $out/{bin,opt} + tar -C $out/opt --strip=1 -x -f $src + ln -s $out/opt/toolmanifest.vdf $out/bin/toolmanifest.vdf + install -Dm644 $out/opt/compatibilitytool.vdf $out/bin/compatibilitytool.vdf + substituteInPlace $out/bin/compatibilitytool.vdf \ + --replace-fail '"install_path" "."' '"install_path" "${placeholder "out"}/opt"' + runHook postBuild + ''; + + /* + We use the created releases, and not the tags, for the update script as nix-update loads releases.atom + that contains both. Sometimes upstream pushes the tags but the Github releases don't get created due to + CI errors. Last time this happened was on 8-33, where a tag was created but no releases were created. + As of 2024-03-13, there have been no announcements indicating that the CI has been fixed, and thus + we avoid nix-update-script and use our own update script instead. + See: + */ + passthru.updateScript = writeScript "update-proton-ge" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl jq common-updater-scripts + repo="https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases" + version="$(curl -sL "$repo" | jq 'map(select(.prerelease == false)) | .[0].tag_name' --raw-output)" + update-source-version proton-ge-bin "$version" + ''; + + meta = { + description = "Compatibility tool for Steam Play based on Wine and additional components"; + homepage = "https://github.com/GloriousEggroll/proton-ge-custom"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ NotAShelf shawn8901 ]; + platforms = [ "x86_64-linux" ]; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + }; +})