nix-bitcoin/pkgs/clightning-rest/generate.sh
Jonas Nick 4cd9d0c6de
Merge fort-nix/nix-bitcoin#542: rtl: 0.13.0 -> 0.13.1, clightning-rest: 0.8.0 -> 0.9.0
02f1599503 clightning-rest: 0.8.0 -> 0.9.0 (Erik Arvstedt)
c3769014b1 rtl: 0.13.0 -> 0.13.1 (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 02f1599503

Tree-SHA512: b3bc9937ab3bb19702686c459ce920adaf83972c96c26568f7b0447f2ca200552e873e33120785268f86c582b575befb4b163fe8fae5eefe445ebd0b7244e334
2022-08-28 19:08:32 +00:00

41 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env nix-shell
#! nix-shell -i bash -p gnupg wget gnused
set -euo pipefail
version="0.9.0"
repo=https://github.com/Ride-The-Lightning/c-lightning-REST
scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
updateSrc() {
TMPDIR=$(mktemp -d /tmp/clightning-rest.XXX)
trap 'rm -rf $TMPDIR' EXIT
# Fetch and verify source tarball
export GNUPGHOME=$TMPDIR
# Fetch saubyk's key
gpg --keyserver hkps://keyserver.ubuntu.com --recv-key 3E9BD4436C288039CA827A9200C9E2BC2E45666F
file=v${version}.tar.gz
wget -P "$TMPDIR" "${repo}/archive/refs/tags/${file}"
wget -P "$TMPDIR" "${repo}/releases/download/v${version}/${file}.asc"
gpg --verify "${TMPDIR}/${file}.asc" "${TMPDIR}/${file}"
hash=$(nix hash file "${TMPDIR}/${file}")
sed -i "
s|\bversion = .*;|version = \"$version\";|
s|\bhash = .*;|hash = \"$hash\";|
" default.nix
}
updateNodeModulesHash() {
"$scriptDir/../../helper/update-fixed-output-derivation.sh" ./default.nix clightning-rest.nodeModules nodeModules
}
if [[ $# == 0 ]]; then
# Each of these can be run separately
updateSrc
updateNodeModulesHash
else
"$@"
fi