servo: add update script

This commit is contained in:
Martin Weinelt
2025-02-19 23:35:21 +01:00
parent ad0f5861d2
commit 063a4fa0fc
2 changed files with 30 additions and 0 deletions
+2
View File
@@ -143,6 +143,8 @@ rustPlatform.buildRustPackage {
--prefix LD_LIBRARY_PATH : ${runtimePaths}
'';
passthru.updateScript = ./update.sh;
meta = {
description = "The embeddable, independent, memory-safe, modular, parallel web rendering engine";
homepage = "https://servo.org";
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils common-updater-scripts curl jq nix-update
# This update script exists, because nix-update is unable to ignore various
# bogus tags that exist on the upstream repo e.g.
# - selectors-v0.18.0/v0.20.0/v0.21.0/v0.22.0
# - homu-tmp
#
# Once https://github.com/Mic92/nix-update/issues/322 is resolved it can be
# removed.
set -exuo pipefail
# Determine latest commit id and date
TMP=$(mktemp)
curl -o "$TMP" https://api.github.com/repos/servo/servo/commits/main
COMMIT_ID=$(jq -r '.sha' "$TMP")
COMMIT_TIMESTAMP=$(jq -r '.commit.author.date' "$TMP")
COMMIT_DATE=$(date -d "$COMMIT_TIMESTAMP" +"%Y-%m-%d")
rm $TMP
cd "$(git rev-parse --show-toplevel)"
# Update version, src
update-source-version servo "0-unstable-${COMMIT_DATE}" --file=pkgs/by-name/se/servo/package.nix --rev="$COMMIT_ID"
# Update cargoHash
nix-update --version=skip servo