2020-10-12 20:05:09 +01:00
|
|
|
#!/usr/bin/env nix-shell
|
2021-02-05 11:37:39 +00:00
|
|
|
#!nix-shell -i bash -p jq nix-prefetch
|
2020-10-12 20:05:09 +01:00
|
|
|
set -eo pipefail
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
if [[ $# -ne 1 ]]; then
|
|
|
|
echo "Usage: ./update.sh <version>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "
|
|
|
|
FIXME: This script doesn't update patched lldb. Please manually check branches
|
|
|
|
of https://github.com/vadimcn/llvm-project and update lldb with correct version of LLVM.
|
|
|
|
"
|
|
|
|
|
|
|
|
nixpkgs=../../../..
|
|
|
|
nixFile=./default.nix
|
|
|
|
owner=vadimcn
|
|
|
|
repo=vscode-lldb
|
|
|
|
version="$1"
|
|
|
|
|
|
|
|
sed -E 's/\bversion = ".*?"/version = "'$version'"/' --in-place "$nixFile"
|
|
|
|
srcHash=$(nix-prefetch fetchFromGitHub --owner vadimcn --repo vscode-lldb --rev "v$version" --fetchSubmodules)
|
2021-04-20 12:50:04 +01:00
|
|
|
sed -E 's#\bsha256 = ".*?"#sha256 = "'$srcHash'"#' --in-place "$nixFile"
|
2020-10-12 20:05:09 +01:00
|
|
|
cargoHash=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).vscode-extensions.vadimcn.vscode-lldb.adapter.cargoDeps.overrideAttrs (_: { outputHash = sha256; })")
|
|
|
|
sed -E 's#\bcargoSha256 = ".*?"#cargoSha256 = "'$cargoHash'"#' --in-place "$nixFile"
|
|
|
|
|
|
|
|
src="$(nix-build $nixpkgs -A vscode-extensions.vadimcn.vscode-lldb.src --no-out-link)"
|
|
|
|
jq '{ name, version: $version, dependencies: (.dependencies + .devDependencies) }' \
|
|
|
|
--arg version "$version" \
|
|
|
|
"$src/package.json" \
|
|
|
|
> build-deps/package.json
|
|
|
|
|
|
|
|
# Regenerate nodePackages.
|
|
|
|
cd "$nixpkgs/pkgs/development/node-packages"
|
|
|
|
exec ./generate.sh
|