Skip to content

Commit a7f22e8

Browse files
FraGagJohnRTitor
authored andcommitted
vscode-extensions.vadimcn.vscode-lldb: Fix update.sh
- Fix nix-shell invocation (`-p packages` and `path` are mutually exclusive) - Patch hashes in the correct files - Use nurl instead of nix-prefetch (the latter currently fails due to <msteen/nix-prefetch#54>) - Update GitHub repo name Fixes #204311
1 parent c612142 commit a7f22e8

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
pkgs ? import ../../../../../.. { },
3+
}:
4+
5+
# Ideally, pkgs points to default.nix file of Nixpkgs official tree
6+
with pkgs;
7+
8+
mkShell {
9+
inputsFrom = [
10+
(import ../../update-shell.nix { inherit pkgs; })
11+
];
12+
packages = [
13+
nix-prefetch-github
14+
nurl
15+
prefetch-npm-deps
16+
];
17+
}

pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/update.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env nix-shell
2-
#! nix-shell ../../update-shell.nix -i bash -p nix-prefetch-github prefetch-npm-deps
2+
#! nix-shell update-shell.nix -i bash
33

44
set -eo pipefail
55
cd "$(dirname "${BASH_SOURCE[0]}")"
@@ -12,8 +12,10 @@ of https://github.com/vadimcn/llvm-project and update lldb with correct version
1212
# Ideally, nixpkgs points to default.nix file of Nixpkgs official tree
1313
nixpkgs=../../../../../..
1414
nixFile=./default.nix
15+
adapterNixFile=./adapter.nix
16+
nodeDepsNixFile=./node_deps.nix
1517
owner=vadimcn
16-
repo=vscode-lldb
18+
repo=codelldb
1719
version="$1"
1820
if [[ $# -ne 1 ]]; then
1921
# no version specified, find the newest one
@@ -34,14 +36,14 @@ echo "$old_version -> $version"
3436

3537
# update hashes
3638
sed -E 's/\bversion = ".*?"/version = "'$version'"/' --in-place "$nixFile"
37-
srcHash=$(nix-prefetch-github vadimcn vscode-lldb --rev "v$version" | jq --raw-output .hash)
39+
srcHash=$(nix-prefetch-github vadimcn codelldb --rev "v$version" | jq --raw-output .hash)
3840
sed -E 's#\bhash = ".*?"#hash = "'$srcHash'"#' --in-place "$nixFile"
39-
cargoHash=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).vscode-extensions.vadimcn.vscode-lldb.adapter.cargoDeps.overrideAttrs (_: { outputHash = sha256; })")
40-
sed -E 's#\bcargoHash = ".*?"#cargoHash = "'$cargoHash'"#' --in-place "$nixFile"
41+
cargoHash=$(nurl --expr "(import $nixpkgs {}).vscode-extensions.vadimcn.vscode-lldb.adapter.cargoDeps.vendorStaging")
42+
sed -E 's#\bcargoHash = ".*?"#cargoHash = "'$cargoHash'"#' --in-place "$adapterNixFile"
4143

4244
pushd $TMPDIR
4345
curl -LO https://raw.githubusercontent.com/$owner/$repo/v${version}/package-lock.json
4446
npmDepsHash=$(prefetch-npm-deps ./package-lock.json)
4547
popd
46-
sed -E 's#\bnpmDepsHash = ".*?"#npmDepsHash = "'$npmDepsHash'"#' --in-place "$nixFile"
48+
sed -E 's#\bnpmDepsHash = ".*?"#npmDepsHash = "'$npmDepsHash'"#' --in-place "$nodeDepsNixFile"
4749

0 commit comments

Comments
 (0)