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