biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / networking / instant-messengers / element / seshat / update.sh
blob6e7e75e66bce9c1c7ba2dc48d330ad4561eddb0f
1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=../../../../../../ -i bash -p wget prefetch-yarn-deps yarn nix-prefetch nix-prefetch-github
4 if [ "$#" -gt 1 ] || [[ "$1" == -* ]]; then
5 echo "Regenerates packaging data for the seshat package."
6 echo "Usage: $0 [git release tag]"
7 exit 1
8 fi
10 version="$1"
12 set -euo pipefail
14 if [ -z "$version" ]; then
15 version="$(wget -O- "https://api.github.com/repos/matrix-org/seshat/tags" | jq -r '.[] | .name' | sort --version-sort | tail -1)"
18 SRC="https://raw.githubusercontent.com/matrix-org/seshat/$version"
20 tmpdir=$(mktemp -d)
21 trap 'rm -rf "$tmpdir"' EXIT
23 pushd $tmpdir
24 wget "$SRC/seshat-node/yarn.lock"
25 yarn_hash=$(prefetch-yarn-deps yarn.lock)
26 popd
28 src_hash=$(nix-prefetch-github matrix-org seshat --rev ${version} | jq -r .hash)
30 cat > pin.json << EOF
32 "version": "$version",
33 "srcHash": "$src_hash",
34 "yarnHash": "$yarn_hash",
35 "cargoHash": "0000000000000000000000000000000000000000000000000000"
37 EOF
39 cargo_hash=$(nix-prefetch "{ sha256 }: (import ../../../../../.. {}).element-desktop.seshat.cargoDeps")
41 cat > pin.json << EOF
43 "version": "$version",
44 "srcHash": "$src_hash",
45 "yarnHash": "$yarn_hash",
46 "cargoHash": "$cargo_hash"
48 EOF