diff options
author | superherointj <5861043+superherointj@users.noreply.github.com> | 2023-03-18 15:54:49 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-18 15:54:49 -0300 |
commit | e5005453d3315aa58a04b901cbecbef5e241f7b1 (patch) | |
tree | c9f4b2b5d1e587ecd956dc31c801c1a5a97195bb /pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/update.sh | |
parent | 5dd36e42111214846f3484634256b160b62a2557 (diff) |
vscode-extensions: refactor of extensions (#221878)
* vscode-extensions: fix indentation for editorconfig * vscode-extensions.chenglou92.rescript-vscode: renamed directory * vscode-extensions.WakaTime.vscode-wakatime: rename directory * vscode-extensions.hashicorp.terraform: rename directory * vscode-extensions.ms-python.python: rename directory * vscode-extensions.sumneko.lua: rename directory * vscode-extensions.ms-vscode.cpptools: rename directory * vscode-extensions.ms-vscode-remote.remote-ssh: rename directory * vscode-extensions.rust-lang.rust-analyzer: rename directory * vscode-extensions.vadimcn.vscode-lldb: rename directory * vscode-extensions.ms-dotnettools.csharp: rename directory * vscode-extensions.ms-vsliveshare.vsliveshare: rename directory * vscode-extensions.ms-toolsai.jupyter: rename directory
Diffstat (limited to 'pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/update.sh')
-rwxr-xr-x | pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/update.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/update.sh b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/update.sh new file mode 100755 index 0000000000000..5f4ff18c1c78c --- /dev/null +++ b/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/update.sh @@ -0,0 +1,45 @@ +#! /usr/bin/env nix-shell +#! nix-shell ../../update-shell.nix -i bash + +set -eo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +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. +" + +# Ideally, nixpkgs points to default.nix file of Nixpkgs official tree +nixpkgs=../../../../../.. +nixFile=./default.nix +owner=vadimcn +repo=vscode-lldb +version="$1" +if [[ $# -ne 1 ]]; then + # no version specified, find the newest one + version=$( + curl -s "https://api.github.com/repos/$owner/$repo/releases" | + jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output | + sed 's/[\"v]//' + ) +fi +old_version=$(sed -nE 's/.*\bversion = "(.*)".*/\1/p' ./default.nix) +if grep -q 'cargoSha256 = ""' ./default.nix; then + old_version='broken' +fi +if [[ "$version" == "$old_version" ]]; then + echo "Up to date: $version" + exit +fi +echo "$old_version -> $version" + +# update hashes +sed -E 's/\bversion = ".*?"/version = "'$version'"/' --in-place "$nixFile" +srcHash=$(nix-prefetch fetchFromGitHub --owner vadimcn --repo vscode-lldb --rev "v$version") +sed -E 's#\bsha256 = ".*?"#sha256 = "'$srcHash'"#' --in-place "$nixFile" +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" + +# update node dependencies +src="$(nix-build $nixpkgs -A vscode-extensions.vadimcn.vscode-lldb.src --no-out-link)" +nix-shell -p node2nix -I nixpkgs=$nixpkgs --run "cd build-deps && ls -R && node2nix -14 -d -i \"$src/package.json\" -l \"$src/package-lock.json\"" |