servo: add update script

+30
+2
pkgs/by-name/se/servo/package.nix
··· 143 143 --prefix LD_LIBRARY_PATH : ${runtimePaths} 144 144 ''; 145 145 146 + passthru.updateScript = ./update.sh; 147 + 146 148 meta = { 147 149 description = "The embeddable, independent, memory-safe, modular, parallel web rendering engine"; 148 150 homepage = "https://servo.org";
+28
pkgs/by-name/se/servo/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p coreutils common-updater-scripts curl jq nix-update 3 + 4 + # This update script exists, because nix-update is unable to ignore various 5 + # bogus tags that exist on the upstream repo e.g. 6 + # - selectors-v0.18.0/v0.20.0/v0.21.0/v0.22.0 7 + # - homu-tmp 8 + # 9 + # Once https://github.com/Mic92/nix-update/issues/322 is resolved it can be 10 + # removed. 11 + 12 + set -exuo pipefail 13 + 14 + # Determine latest commit id and date 15 + TMP=$(mktemp) 16 + curl -o "$TMP" https://api.github.com/repos/servo/servo/commits/main 17 + COMMIT_ID=$(jq -r '.sha' "$TMP") 18 + COMMIT_TIMESTAMP=$(jq -r '.commit.author.date' "$TMP") 19 + COMMIT_DATE=$(date -d "$COMMIT_TIMESTAMP" +"%Y-%m-%d") 20 + rm $TMP 21 + 22 + cd "$(git rev-parse --show-toplevel)" 23 + 24 + # Update version, src 25 + update-source-version servo "0-unstable-${COMMIT_DATE}" --file=pkgs/by-name/se/servo/package.nix --rev="$COMMIT_ID" 26 + 27 + # Update cargoHash 28 + nix-update --version=skip servo