about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/vscode-extensions/cpptools
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-08-14 00:02:54 +0000
committerAlyssa Ross <hi@alyssa.is>2019-08-14 00:02:54 +0000
commitf9abd30e11337cf07034f2cc8ad1691aa4a69386 (patch)
treec3b5c34b1c533f5c231dc6707e96795fb3a9a138 /nixpkgs/pkgs/misc/vscode-extensions/cpptools
parent44e04ea2730f8e3b863b81b0056babe233c244f6 (diff)
parent1036dc664169b32613ec11b58cc1740c7511a340 (diff)
downloadnixlib-f9abd30e11337cf07034f2cc8ad1691aa4a69386.tar
nixlib-f9abd30e11337cf07034f2cc8ad1691aa4a69386.tar.gz
nixlib-f9abd30e11337cf07034f2cc8ad1691aa4a69386.tar.bz2
nixlib-f9abd30e11337cf07034f2cc8ad1691aa4a69386.tar.lz
nixlib-f9abd30e11337cf07034f2cc8ad1691aa4a69386.tar.xz
nixlib-f9abd30e11337cf07034f2cc8ad1691aa4a69386.tar.zst
nixlib-f9abd30e11337cf07034f2cc8ad1691aa4a69386.zip
Merge commit '1036dc664169b32613ec11b58cc1740c7511a340'
Diffstat (limited to 'nixpkgs/pkgs/misc/vscode-extensions/cpptools')
-rw-r--r--nixpkgs/pkgs/misc/vscode-extensions/cpptools/default.nix47
1 files changed, 29 insertions, 18 deletions
diff --git a/nixpkgs/pkgs/misc/vscode-extensions/cpptools/default.nix b/nixpkgs/pkgs/misc/vscode-extensions/cpptools/default.nix
index 37e5759c8584..a60dad9b7b70 100644
--- a/nixpkgs/pkgs/misc/vscode-extensions/cpptools/default.nix
+++ b/nixpkgs/pkgs/misc/vscode-extensions/cpptools/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchzip, vscode-utils, jq, mono, clang-tools, writeScript, runtimeShell
+{ stdenv, vscode-utils
+, fetchurl, unzip
+, mono, writeScript, runtimeShell
+, jq, clang-tools
 , gdbUseFixed ? true, gdb # The gdb default setting will be fixed to specified. Use version from `PATH` otherwise.
 }:
 
@@ -30,25 +33,37 @@ assert gdbUseFixed -> null != gdb;
 let
   gdbDefaultsTo = if gdbUseFixed then "${gdb}/bin/gdb" else "gdb";
 
-  langComponentBinaries = stdenv.mkDerivation {
+  langComponentBinaries = stdenv.mkDerivation rec {
     name = "cpptools-language-component-binaries";
 
-    src = fetchzip {
+    src = fetchurl {
       # Follow https://go.microsoft.com/fwlink/?linkid=2037608
-      url = "https://download.visualstudio.microsoft.com/download/pr/97ed3eeb-b31e-421c-92dc-4f3a98af301e/069a1e6ab1b4b017853a7e9e08067744/bin_linux.zip";
-      sha256 = "19flm4vcrg89x0b20bd0g45apabzfqgvcpjddnmyk312jc242gmb";
+      url = "https://download.visualstudio.microsoft.com/download/pr/fd05d7fd-b771-4746-9c54-b5b30afcd82e/1f443716d6156a265bf50cb6e53fa999/bin_linux.zip";
+      sha256 = "198xnq709clibjmd8rrv0haniy2m3qvhn89hg9hpj6lvg9lsr7a4";
     };
 
-    patchPhase = ''
-      elfInterpreter="${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2"
-      patchelf --set-interpreter "$elfInterpreter" ./Microsoft.VSCode.CPP.Extension.linux
-      patchelf --set-interpreter "$elfInterpreter" ./Microsoft.VSCode.CPP.IntelliSense.Msvc.linux
-      chmod a+x ./Microsoft.VSCode.CPP.Extension.linux ./Microsoft.VSCode.CPP.IntelliSense.Msvc.linux
+    sourceRoot = name;
+
+    nativeBuildInputs = [ unzip ];
+
+    unpackPhase = ''
+      runHook preUnpack
+      unzip -d $name $src || true
+      runHook postUnpack
     '';
 
     installPhase = ''
+      runHook preInstall
       mkdir -p "$out/bin"
-      find . -mindepth 1 -maxdepth 1 | xargs cp -a -t "$out/bin"
+      cp -a -t "$out/bin" ./bin/*
+      runHook postInstall
+    '';
+
+    postFixup = ''
+      elfInterpreter="$(cat $NIX_CC/nix-support/dynamic-linker)"
+      patchelf --set-interpreter "$elfInterpreter" $out/bin/Microsoft.VSCode.CPP.Extension.linux
+      patchelf --set-interpreter "$elfInterpreter" $out/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.linux
+      chmod a+x $out/bin/Microsoft.VSCode.CPP.Extension.linux $out/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.linux
     '';
   };
 
@@ -68,8 +83,8 @@ vscode-utils.buildVscodeMarketplaceExtension {
   mktplcRef = {
     name = "cpptools";
     publisher = "ms-vscode";
-    version = "0.23.1";
-    sha256 = "08kfzvyl8vgjmhqzpp7pxw0gd87jr5g7z15ag4cpcil4inq4c8k3";
+    version = "0.24.0";
+    sha256 = "0b0rwj3aadd4kf561zpzv95r96dqvhkn7db8d7rz3naaqydz0z8i";
   };
 
   buildInputs = [
@@ -80,16 +95,12 @@ vscode-utils.buildVscodeMarketplaceExtension {
     mv ./package.json ./package_ori.json
 
     # 1. Add activation events so that the extension is functional. This listing is empty when unpacking the extension but is filled at runtime.
-    # 2. Patch `packages.json` so that nix's *gdb* is used as default value for `miDebuggerPath`.
+    # 2. Patch `package.json` so that nix's *gdb* is used as default value for `miDebuggerPath`.
     cat ./package_ori.json | \
       jq --slurpfile actEvts ${./package-activation-events.json} '(.activationEvents) = $actEvts[0]' | \
       jq '(.contributes.debuggers[].configurationAttributes | .attach , .launch | .properties.miDebuggerPath | select(. != null) | select(.default == "/usr/bin/gdb") | .default) = "${gdbDefaultsTo}"' > \
       ./package.json
 
-    # Patch `packages.json` so that nix's *gdb* is used as default value for `miDebuggerPath`.
-    substituteInPlace "./package.json" \
-      --replace "\"default\": \"/usr/bin/gdb\"" "\"default\": \"${gdbDefaultsTo}\""
-
     # Prevent download/install of extensions
     touch "./install.lock"