vscode-extensions.ms-vscode.cpptools: 1.9.1 -> 1.11.0

+33 -51
+28 -49
pkgs/applications/editors/vscode/extensions/cpptools/default.nix
··· 1 { lib, vscode-utils 2 - , fetchurl, mono, writeScript, runtimeShell 3 , jq, clang-tools 4 , gdbUseFixed ? true, gdb # The gdb default setting will be fixed to specified. Use version from `PATH` otherwise. 5 }: 6 7 /* ··· 29 30 let 31 gdbDefaultsTo = if gdbUseFixed then "${gdb}/bin/gdb" else "gdb"; 32 - 33 - 34 - openDebugAD7Script = writeScript "OpenDebugAD7" '' 35 - #!${runtimeShell} 36 - BIN_DIR="$(cd "$(dirname "$0")" && pwd -P)" 37 - ${if gdbUseFixed 38 - then '' 39 - export PATH=''${PATH}''${PATH:+:}${gdb}/bin 40 - '' 41 - else ""} 42 - ${mono}/bin/mono $BIN_DIR/bin/OpenDebugAD7.exe $* 43 - ''; 44 in 45 - 46 vscode-utils.buildVscodeMarketplaceExtension rec { 47 mktplcRef = { 48 name = "cpptools"; 49 publisher = "ms-vscode"; 50 - version = "1.9.1"; 51 }; 52 53 - vsix = fetchurl { 54 - name = "${mktplcRef.publisher}-${mktplcRef.name}.gz"; 55 - url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${mktplcRef.publisher}/vsextensions/${mktplcRef.name}/${mktplcRef.version}/vspackage?targetPlatform=linux-x64"; 56 - sha256 = "sha256-BtTl9DR8hnwNpO5k99M4dtqcTQ2hTzVbjR8VZh+tdDI="; 57 - }; 58 - 59 - unpackPhase = '' 60 - runHook preUnpack 61 - 62 - gzip -d $src --stdout &> temporary.zip 63 - unzip temporary.zip 64 - rm temporary.zip 65 - 66 - cd extension/ 67 - 68 - runHook postUnpack 69 - ''; 70 71 buildInputs = [ 72 jq 73 ]; 74 75 postPatch = '' ··· 84 85 # Prevent download/install of extensions 86 touch "./install.lock" 87 - 88 - # Mono runtimes from nix package (used by generated `OpenDebugAD7`). 89 - mv ./debugAdapters/bin/OpenDebugAD7 ./debugAdapters/bin/OpenDebugAD7_orig 90 - cp -p "${openDebugAD7Script}" "./debugAdapters/bin/OpenDebugAD7" 91 92 # Clang-format from nix package. 93 - mv ./LLVM/ ./LLVM_orig 94 mkdir "./LLVM/" 95 find "${clang-tools}" -mindepth 1 -maxdepth 1 | xargs ln -s -t "./LLVM" 96 97 - # Patching cpptools and cpptools-srv 98 - elfInterpreter="$(cat $NIX_CC/nix-support/dynamic-linker)" 99 - patchelf --set-interpreter "$elfInterpreter" ./bin/cpptools 100 - patchelf --set-interpreter "$elfInterpreter" ./bin/cpptools-srv 101 - chmod a+x ./bin/cpptools{-srv,} 102 ''; 103 104 - meta = with lib; { 105 - license = licenses.unfree; 106 - maintainers = [ maintainers.jraygauthier ]; 107 - # A 32 bit linux would also be possible with some effort (specific download of binaries + 108 - # patching of the elf files with 32 bit interpreter). 109 - platforms = [ "x86_64-linux" ]; 110 - }; 111 }
··· 1 { lib, vscode-utils 2 + , fetchurl, writeScript, runtimeShell 3 , jq, clang-tools 4 , gdbUseFixed ? true, gdb # The gdb default setting will be fixed to specified. Use version from `PATH` otherwise. 5 + , autoPatchelfHook, makeWrapper, stdenv, lttng-ust, libkrb5, zlib 6 }: 7 8 /* ··· 30 31 let 32 gdbDefaultsTo = if gdbUseFixed then "${gdb}/bin/gdb" else "gdb"; 33 in 34 vscode-utils.buildVscodeMarketplaceExtension rec { 35 mktplcRef = { 36 name = "cpptools"; 37 publisher = "ms-vscode"; 38 + version = "1.11.0"; 39 + sha256 = "c0725d3914aeb2515627691727455cc27e7a75031fa02ca957be02cc210bd64d"; 40 + arch = "linux-x64"; 41 }; 42 43 + nativeBuildInputs = [ 44 + autoPatchelfHook 45 + makeWrapper 46 + ]; 47 48 buildInputs = [ 49 jq 50 + lttng-ust 51 + libkrb5 52 + zlib 53 + stdenv.cc.cc.lib 54 ]; 55 56 postPatch = '' ··· 65 66 # Prevent download/install of extensions 67 touch "./install.lock" 68 69 # Clang-format from nix package. 70 + mv ./LLVM/ ./LLVM_orig 71 mkdir "./LLVM/" 72 find "${clang-tools}" -mindepth 1 -maxdepth 1 | xargs ln -s -t "./LLVM" 73 74 + # Patching binaries 75 + chmod +x bin/cpptools bin/cpptools-srv bin/cpptools-wordexp debugAdapters/bin/OpenDebugAD7 76 + patchelf --replace-needed liblttng-ust.so.0 liblttng-ust.so.1 ./debugAdapters/bin/libcoreclrtraceptprovider.so 77 ''; 78 79 + postFixup = lib.optionalString gdbUseFixed '' 80 + wrapProgram $out/share/vscode/extensions/ms-vscode.cpptools/debugAdapters/bin/OpenDebugAD7 --prefix PATH : ${lib.makeBinPath [ gdb ]} 81 + ''; 82 + 83 + meta = with lib; { 84 + description = "The C/C++ extension adds language support for C/C++ to Visual Studio Code, including features such as IntelliSense and debugging."; 85 + homepage = "https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools"; 86 + license = licenses.unfree; 87 + maintainers = with maintainers; [ jraygauthier stargate01 ]; 88 + platforms = [ "x86_64-linux" ]; 89 + }; 90 }
+5 -2
pkgs/applications/editors/vscode/extensions/mktplcExtRefToFetchArgs.nix
··· 1 - { publisher, name, version, sha256 ? "" }: 2 { 3 - url = "https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${name}/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage"; 4 sha256 = sha256; 5 # The `*.vsix` file is in the end a simple zip file. Change the extension 6 # so that existing `unzip` hooks takes care of the unpacking.
··· 1 + { publisher, name, version, arch ? "", sha256 ? "" }: 2 + let 3 + archurl = (if arch == "" then "" else "?targetPlatform=${arch}"); 4 + in 5 { 6 + url = "https://${publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${publisher}/extension/${name}/${version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage${archurl}"; 7 sha256 = sha256; 8 # The `*.vsix` file is in the end a simple zip file. Change the extension 9 # so that existing `unzip` hooks takes care of the unpacking.