invidious: unstable-2021-11-13 -> unstable-2022-02-25

schnusch eeacdb91 d697ee65

+64 -17
+13 -8
pkgs/servers/invidious/default.nix
··· 1 - { lib, crystal, fetchFromGitHub, librsvg, pkg-config, libxml2, openssl, sqlite, lsquic, nixosTests }: 2 let 3 # When updating, always update the following: 4 # * the git revision ··· 8 # * shards.nix (by running `crystal2nix` in invidious’ source tree) 9 # * If the lsquic.cr dependency changed: lsquic in lsquic.nix (version, sha256) 10 # * If the lsquic version changed: boringssl' in lsquic.nix (version, sha256) 11 - rev = "00904ae3f2ab6a3cf5f96012d36c5672c3aa17b4"; 12 in 13 crystal.buildCrystalPackage rec { 14 pname = "invidious"; 15 - version = "unstable-2021-11-13"; 16 17 src = fetchFromGitHub { 18 owner = "iv-org"; 19 repo = pname; 20 inherit rev; 21 - sha256 = "sha256-DET4jvB5epkpl5/HTORNTWDL4Ck4IsqhdTApJE8t6Tg="; 22 }; 23 24 postPatch = ··· 33 assetCommitTemplate = ''{{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit -- assets`.strip}" }}''; 34 in 35 '' 36 # Use the version metadata from the derivation instead of using git at 37 # build-time 38 substituteInPlace src/invidious.cr \ ··· 48 --replace 'File.read("locales/' 'File.read("${placeholder "out"}/share/invidious/locales/' 49 50 # Reference sql initialisation/migration scripts by absolute path 51 - substituteInPlace src/invidious/helpers/helpers.cr \ 52 --replace 'config/sql' '${placeholder "out"}/share/invidious/config/sql' 53 54 - substituteInPlace src/invidious/users.cr \ 55 --replace 'Process.run(%(rsvg-convert' 'Process.run(%(${lib.getBin librsvg}/bin/rsvg-convert' 56 ''; 57 58 - nativeBuildInputs = [ pkg-config ]; 59 buildInputs = [ libxml2 openssl sqlite ]; 60 61 format = "crystal"; 62 shardsFile = ./shards.nix; 63 - crystalBinaries.invidious.src = "src/invidious.cr"; 64 65 postConfigure = '' 66 # lib includes nix store paths which can’t be patched, so the links have to
··· 1 + { lib, crystal, fetchFromGitHub, librsvg, pkg-config, libxml2, openssl, shards, sqlite, lsquic, videojs, nixosTests }: 2 let 3 # When updating, always update the following: 4 # * the git revision ··· 8 # * shards.nix (by running `crystal2nix` in invidious’ source tree) 9 # * If the lsquic.cr dependency changed: lsquic in lsquic.nix (version, sha256) 10 # * If the lsquic version changed: boringssl' in lsquic.nix (version, sha256) 11 + rev = "081fd541afc9b2f9b821e0f8f4c66dda0839295c"; 12 in 13 crystal.buildCrystalPackage rec { 14 pname = "invidious"; 15 + version = "unstable-2022-02-25"; 16 17 src = fetchFromGitHub { 18 owner = "iv-org"; 19 repo = pname; 20 inherit rev; 21 + sha256 = "12m1fd8yfs6fqchvf9masr837dcghsg5x2nb8vcpzakzia5qc2kf"; 22 }; 23 24 postPatch = ··· 33 assetCommitTemplate = ''{{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit -- assets`.strip}" }}''; 34 in 35 '' 36 + for d in ${videojs}/*; do ln -s "$d" assets/videojs; done 37 + 38 # Use the version metadata from the derivation instead of using git at 39 # build-time 40 substituteInPlace src/invidious.cr \ ··· 50 --replace 'File.read("locales/' 'File.read("${placeholder "out"}/share/invidious/locales/' 51 52 # Reference sql initialisation/migration scripts by absolute path 53 + substituteInPlace src/invidious/database/base.cr \ 54 --replace 'config/sql' '${placeholder "out"}/share/invidious/config/sql' 55 56 + substituteInPlace src/invidious/user/captcha.cr \ 57 --replace 'Process.run(%(rsvg-convert' 'Process.run(%(${lib.getBin librsvg}/bin/rsvg-convert' 58 ''; 59 60 + nativeBuildInputs = [ pkg-config shards ]; 61 buildInputs = [ libxml2 openssl sqlite ]; 62 63 format = "crystal"; 64 shardsFile = ./shards.nix; 65 + crystalBinaries.invidious = { 66 + src = "src/invidious.cr"; 67 + options = [ "--release" "--progress" "--verbose" "--no-debug" "-Dskip_videojs_download" ]; 68 + }; 69 70 postConfigure = '' 71 # lib includes nix store paths which can’t be patched, so the links have to
+12
pkgs/servers/invidious/shards.nix
··· 59 rev = "v0.4.1"; 60 sha256 = "1l08cydkdidq9yyil1wl240hvk41iycv04jrg6nx5mkvzw4z1bzg"; 61 }; 62 sqlite3 = { 63 owner = "crystal-lang"; 64 repo = "crystal-sqlite3"; 65 rev = "v0.18.0"; 66 sha256 = "03nnvpchhq9f9ywsm3pk2rrj4a3figw7xs96zdziwgr5znkz6x93"; 67 }; 68 }
··· 59 rev = "v0.4.1"; 60 sha256 = "1l08cydkdidq9yyil1wl240hvk41iycv04jrg6nx5mkvzw4z1bzg"; 61 }; 62 + spectator = { 63 + owner = "icy-arctic-fox"; 64 + repo = "spectator"; 65 + rev = "v0.10.4"; 66 + sha256 = "0rcxq2nbslvwrd8m9ajw6dzaw3hagxmkdy9s8p34cgnr4c9dijdq"; 67 + }; 68 sqlite3 = { 69 owner = "crystal-lang"; 70 repo = "crystal-sqlite3"; 71 rev = "v0.18.0"; 72 sha256 = "03nnvpchhq9f9ywsm3pk2rrj4a3figw7xs96zdziwgr5znkz6x93"; 73 + }; 74 + ameba = { 75 + owner = "crystal-ameba"; 76 + repo = "ameba"; 77 + rev = "v0.14.3"; 78 + sha256 = "1cfr95xi6hsyxw1wlrh571hc775xhwmssk3k14i8b7dgbwfmm5x1"; 79 }; 80 }
+13 -9
pkgs/servers/invidious/update.sh
··· 1 #!/usr/bin/env nix-shell 2 - #!nix-shell -i bash -p common-updater-scripts curl crystal2nix jq git gnused nix nix-prefetch-git nix-update 3 git_url='https://github.com/iv-org/invidious.git' 4 git_branch='master' 5 git_dir='/var/tmp/invidious.git' 6 - nix_file="$(dirname "${BASH_SOURCE[0]}")/default.nix" 7 pkg='invidious' 8 9 set -euo pipefail ··· 45 "$new_version" \ 46 "$new_sha256" \ 47 --rev="$new_rev" 48 - git add "$nix_file" 49 commit_msg="$pkg: $old_version -> $new_version" 50 51 - cd "${nix_file%/*}" 52 if git -C "$git_dir" diff-tree --quiet "${old_rev}..${new_rev}" -- 'shard.lock'; then 53 info "shard.lock did not change since $old_rev." 54 else 55 info "Updating shards.nix..." 56 - git -C "$git_dir" reset --hard "$new_rev" 57 crystal2nix -- "$git_dir/shard.lock" # argv's index seems broken 58 - git add 'shards.nix' 59 60 lsquic_old_version=$(nix-instantiate --eval --strict --json -A "${pkg}.lsquic.version" '../../..' | jq -r) 61 lsquic_new_version=$(nix eval --raw -f 'shards.nix' lsquic.rev \ ··· 72 | jq -r .sha256) 73 sed -e "0,/^ *version = .*/ s// version = \"$boringssl_new_version\";/" \ 74 -e "0,/^ *sha256 = .*/ s// sha256 = \"$boringssl_new_sha256\";/" \ 75 - -i lsquic.nix 76 - git add 'lsquic.nix' 77 commit_msg="$commit_msg 78 79 lsquic: $lsquic_old_version -> $lsquic_new_version" ··· 81 fi 82 fi 83 84 - git commit --verbose --message "$commit_msg"
··· 1 #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p common-updater-scripts curl crystal crystal2nix jq git gnused nix nix-prefetch-git nix-update pkg-config 3 git_url='https://github.com/iv-org/invidious.git' 4 git_branch='master' 5 git_dir='/var/tmp/invidious.git' 6 pkg='invidious' 7 8 set -euo pipefail ··· 44 "$new_version" \ 45 "$new_sha256" \ 46 --rev="$new_rev" 47 commit_msg="$pkg: $old_version -> $new_version" 48 49 + cd "$(dirname "${BASH_SOURCE[0]}")" 50 + 51 + # fetch video.js dependencies 52 + info "Running scripts/fetch-player-dependencies.cr..." 53 + git -C "$git_dir" reset --hard "$new_rev" 54 + (cd "$git_dir" && crystal run scripts/fetch-player-dependencies.cr -- --minified) 55 + rm -f "$git_dir/assets/videojs/.gitignore" 56 + videojs_new_sha256=$(nix hash-path --type sha256 --base32 "$git_dir/assets/videojs") 57 + sed -e "s,\boutputHash = .*,outputHash = \"$videojs_new_sha256\";," -i 'videojs.nix' 58 + 59 if git -C "$git_dir" diff-tree --quiet "${old_rev}..${new_rev}" -- 'shard.lock'; then 60 info "shard.lock did not change since $old_rev." 61 else 62 info "Updating shards.nix..." 63 crystal2nix -- "$git_dir/shard.lock" # argv's index seems broken 64 65 lsquic_old_version=$(nix-instantiate --eval --strict --json -A "${pkg}.lsquic.version" '../../..' | jq -r) 66 lsquic_new_version=$(nix eval --raw -f 'shards.nix' lsquic.rev \ ··· 77 | jq -r .sha256) 78 sed -e "0,/^ *version = .*/ s// version = \"$boringssl_new_version\";/" \ 79 -e "0,/^ *sha256 = .*/ s// sha256 = \"$boringssl_new_sha256\";/" \ 80 + -i 'lsquic.nix' 81 commit_msg="$commit_msg 82 83 lsquic: $lsquic_old_version -> $lsquic_new_version" ··· 85 fi 86 fi 87 88 + git commit --verbose --message "$commit_msg" *.nix
+15
pkgs/servers/invidious/videojs.nix
···
··· 1 + { stdenvNoCC, cacert, crystal, openssl, pkg-config, invidious }: 2 + 3 + stdenvNoCC.mkDerivation { 4 + name = "videojs"; 5 + 6 + inherit (invidious) src; 7 + 8 + builder = ./videojs.sh; 9 + 10 + nativeBuildInputs = [ cacert crystal openssl pkg-config ]; 11 + 12 + outputHashAlgo = "sha256"; 13 + outputHashMode = "recursive"; 14 + outputHash = "0b4vxd29kpvy60yhqm376r1872gds17s6wljqw0zlr16j762k50r"; 15 + }
+9
pkgs/servers/invidious/videojs.sh
···
··· 1 + source $stdenv/setup 2 + 3 + unpackPhase 4 + cd source 5 + # this helper downloads the videojs files and checks their checksums 6 + # against videojs-dependencies.yml so it should be pure 7 + crystal run scripts/fetch-player-dependencies.cr -- --minified 8 + rm -f assets/videojs/.gitignore 9 + mv assets/videojs "$out"
+2
pkgs/top-level/all-packages.nix
··· 6437 invidious = callPackage ../servers/invidious { 6438 # needs a specific version of lsquic 6439 lsquic = callPackage ../servers/invidious/lsquic.nix { }; 6440 }; 6441 6442 invoice2data = callPackage ../tools/text/invoice2data { };
··· 6437 invidious = callPackage ../servers/invidious { 6438 # needs a specific version of lsquic 6439 lsquic = callPackage ../servers/invidious/lsquic.nix { }; 6440 + # normally video.js is downloaded at build time 6441 + videojs = callPackage ../servers/invidious/videojs.nix { }; 6442 }; 6443 6444 invoice2data = callPackage ../tools/text/invoice2data { };