tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
servo: add update script
Martin Weinelt
11 months ago
063a4fa0
ad0f5861
+30
2 changed files
expand all
collapse all
unified
split
pkgs
by-name
se
servo
package.nix
update.sh
+2
pkgs/by-name/se/servo/package.nix
···
143
143
--prefix LD_LIBRARY_PATH : ${runtimePaths}
144
144
'';
145
145
146
146
+
passthru.updateScript = ./update.sh;
147
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
1
+
#!/usr/bin/env nix-shell
2
2
+
#!nix-shell -i bash -p coreutils common-updater-scripts curl jq nix-update
3
3
+
4
4
+
# This update script exists, because nix-update is unable to ignore various
5
5
+
# bogus tags that exist on the upstream repo e.g.
6
6
+
# - selectors-v0.18.0/v0.20.0/v0.21.0/v0.22.0
7
7
+
# - homu-tmp
8
8
+
#
9
9
+
# Once https://github.com/Mic92/nix-update/issues/322 is resolved it can be
10
10
+
# removed.
11
11
+
12
12
+
set -exuo pipefail
13
13
+
14
14
+
# Determine latest commit id and date
15
15
+
TMP=$(mktemp)
16
16
+
curl -o "$TMP" https://api.github.com/repos/servo/servo/commits/main
17
17
+
COMMIT_ID=$(jq -r '.sha' "$TMP")
18
18
+
COMMIT_TIMESTAMP=$(jq -r '.commit.author.date' "$TMP")
19
19
+
COMMIT_DATE=$(date -d "$COMMIT_TIMESTAMP" +"%Y-%m-%d")
20
20
+
rm $TMP
21
21
+
22
22
+
cd "$(git rev-parse --show-toplevel)"
23
23
+
24
24
+
# Update version, src
25
25
+
update-source-version servo "0-unstable-${COMMIT_DATE}" --file=pkgs/by-name/se/servo/package.nix --rev="$COMMIT_ID"
26
26
+
27
27
+
# Update cargoHash
28
28
+
nix-update --version=skip servo