invidious: use sri hashes in versions.json
This commit is contained in:
@@ -3,9 +3,9 @@ let
|
||||
# All versions, revisions, and checksums are stored in ./versions.json.
|
||||
# The update process is the following:
|
||||
# * pick the latest commit
|
||||
# * update .invidious.rev, .invidious.version, and .invidious.sha256
|
||||
# * update .invidious.rev, .invidious.version, and .invidious.hash
|
||||
# * prefetch the videojs dependencies with scripts/fetch-player-dependencies.cr
|
||||
# and update .videojs.sha256 (they are normally fetched during build
|
||||
# and update .videojs.hash (they are normally fetched during build
|
||||
# but nix's sandboxing does not allow that)
|
||||
# * if shard.lock changed
|
||||
# * recreate shards.nix by running crystal2nix
|
||||
@@ -23,7 +23,7 @@ crystal.buildCrystalPackage rec {
|
||||
owner = "iv-org";
|
||||
repo = pname;
|
||||
fetchSubmodules = true;
|
||||
inherit (versions.invidious) rev sha256;
|
||||
inherit (versions.invidious) rev hash;
|
||||
};
|
||||
|
||||
postPatch =
|
||||
|
||||
@@ -52,8 +52,8 @@ fi
|
||||
|
||||
json_set '.invidious.version' "$new_version"
|
||||
json_set '.invidious.rev' "$new_rev"
|
||||
new_sha256=$(nix-prefetch -I 'nixpkgs=../../..' "$pkg")
|
||||
json_set '.invidious.sha256' "$new_sha256"
|
||||
new_hash=$(nix-prefetch -I 'nixpkgs=../../..' "$pkg")
|
||||
json_set '.invidious.hash' "$new_hash"
|
||||
commit_msg="$pkg: $old_version -> $new_version"
|
||||
|
||||
# fetch video.js dependencies
|
||||
@@ -61,8 +61,8 @@ info "Running scripts/fetch-player-dependencies.cr..."
|
||||
git -C "$git_dir" reset --hard "$new_rev"
|
||||
(cd "$git_dir" && crystal run scripts/fetch-player-dependencies.cr -- --minified)
|
||||
rm -f "$git_dir/assets/videojs/.gitignore"
|
||||
videojs_new_sha256=$(nix-hash --type sha256 --base32 "$git_dir/assets/videojs")
|
||||
json_set '.videojs.sha256' "$videojs_new_sha256"
|
||||
videojs_new_hash=$(nix-hash --type sha256 --sri "$git_dir/assets/videojs")
|
||||
json_set '.videojs.hash' "$videojs_new_hash"
|
||||
|
||||
if git -C "$git_dir" diff-tree --quiet "${old_rev}..${new_rev}" -- 'shard.lock'; then
|
||||
info "shard.lock did not change since $old_rev."
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"invidious": {
|
||||
"rev": "e8a36985aff1a5b33ddf9abea85dd2c23422c2f7",
|
||||
"sha256": "sha256-3nU6z1rd1oiNmIz3Ok02xBsT4oNSGX/n+3/WbRVCbhI=",
|
||||
"hash": "sha256-3nU6z1rd1oiNmIz3Ok02xBsT4oNSGX/n+3/WbRVCbhI=",
|
||||
"version": "0.20.1-unstable-2024-02-18"
|
||||
},
|
||||
"videojs": {
|
||||
"sha256": "0zj8fgxdg6jsllaxn795xipa6yxh4yf08hb8x0idyg74q37gfh4c"
|
||||
"hash": "sha256-jED3zsDkPN8i6GhBBJwnsHujbuwlHdsVpVqa1/pzSH4="
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,5 +14,5 @@ stdenvNoCC.mkDerivation {
|
||||
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = versions.videojs.sha256;
|
||||
outputHash = versions.videojs.hash;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user