about summary refs log tree commit diff
path: root/pkgs/applications/editors/vscode/extensions/vadimcn.vscode-lldb/lldb.nix
blob: 7708c52c80b03ecd459f95178256f110f974ba32 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Patched lldb for Rust language support.
{
  fetchFromGitHub,
  runCommand,
  llvmPackages,
}:
let
  llvmSrc = fetchFromGitHub {
    owner = "vadimcn";
    repo = "llvm-project";
    # codelldb/14.x branch
    rev = "4c267c83cbb55fedf2e0b89644dc1db320fdfde7";
    hash = "sha256-jM//ej6AxnRYj+8BAn4QrxHPT6HiDzK5RqHPSg3dCcw=";
  };
in
(llvmPackages.lldb.overrideAttrs (oldAttrs: rec {
  passthru = (oldAttrs.passthru or { }) // {
    inherit llvmSrc;
  };

  doInstallCheck = true;

  # installCheck for lldb_14 currently broken
  # https://github.com/NixOS/nixpkgs/issues/166604#issuecomment-1086103692
  # ignore the oldAttrs installCheck
  installCheckPhase = ''
    versionOutput="$($out/bin/lldb --version)"
    echo "'lldb --version' returns: $versionOutput"
    echo "$versionOutput" | grep -q 'rust-enabled'
  '';
})).override
  ({
    monorepoSrc = llvmSrc;
    libllvm = llvmPackages.libllvm.override ({ monorepoSrc = llvmSrc; });
  })