3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #55149 from eadwu/vscode-extensions.ms-python.python/2019.1.0

vscode-extensions.ms-python.python: 2018.12.1 -> 2019.6.22090
This commit is contained in:
worldofpeace 2019-07-14 05:22:00 -04:00 committed by GitHub
commit 696767a9c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 13 deletions

View file

@ -62,7 +62,9 @@ rec {
ms-vscode.cpptools = callPackage ./cpptools {};
ms-python.python = callPackage ./python {};
ms-python.python = callPackage ./python {
extractNuGet = callPackage ./python/extract-nuget.nix { };
};
vscodevim.vim = buildVscodeMarketplaceExtension {
mktplcRef = {

View file

@ -1,5 +1,5 @@
{ lib, vscode-utils
{ lib, stdenv, fetchurl, vscode-utils, extractNuGet
, icu, curl, openssl, lttng-ust, autoPatchelfHook
, pythonUseFixed ? false, python # When `true`, the python default setting will be fixed to specified.
# Use version from `PATH` for default setting otherwise.
# Defaults to `false` as we expect it to be project specific most of the time.
@ -14,16 +14,48 @@ assert ctagsUseFixed -> null != ctags;
let
pythonDefaultsTo = if pythonUseFixed then "${python}/bin/python" else "python";
ctagsDefaultsTo = if ctagsUseFixed then "${ctags}/bin/ctags" else "ctags";
in
vscode-utils.buildVscodeMarketplaceExtension {
# The arch tag comes from 'PlatformName' defined here:
# https://github.com/Microsoft/vscode-python/blob/master/src/client/activation/types.ts
arch =
if stdenv.isLinux && stdenv.isx86_64 then "linux-x64"
else if stdenv.isDarwin then "osx-x64"
else throw "Only x86_64 Linux and Darwin are supported.";
languageServerSha256 = {
"linux-x64" = "0mqjl3l1zk1zd7n0rrb2vdsrx6czhl4irdm4j5jishg9zp03gkkd";
"osx-x64" = "1csq8q8fszv9xk9qiabg12zybxnzn8y2jsnvjrlg4b8kvm63sz40";
}."${arch}";
# version is languageServerVersion in the package.json
languageServer = extractNuGet rec {
name = "Python-Language-Server";
version = "0.2.82";
src = fetchurl {
url = "https://pvsc.azureedge.net/python-language-server-stable/${name}-${arch}.${version}.nupkg";
sha256 = languageServerSha256;
};
};
in vscode-utils.buildVscodeMarketplaceExtension {
mktplcRef = {
name = "python";
publisher = "ms-python";
version = "2018.12.1";
sha256 = "1cf3yll2hfililcwq6avscgi35caccv8m8fdsvzqdfrggn5h41h4";
version = "2019.6.22090";
sha256 = "11q4ac7acp946h43myjmp2f2vh10m1c4hn1n0s5pqgjvn0i6bi3i";
};
buildInputs = [
icu
curl
openssl
lttng-ust
];
nativeBuildInputs = [
autoPatchelfHook
];
postPatch = ''
# Patch `packages.json` so that nix's *python* is used as default value for `python.pythonPath`.
substituteInPlace "./package.json" \
@ -34,8 +66,14 @@ vscode-utils.buildVscodeMarketplaceExtension {
--replace "\"default\": \"ctags\"" "\"default\": \"${ctagsDefaultsTo}\""
'';
meta = with lib; {
license = licenses.mit;
maintainers = [ maintainers.jraygauthier ];
};
postInstall = ''
mkdir -p "$out/$installPrefix/languageServer.${languageServer.version}"
cp -R --no-preserve=ownership ${languageServer}/* "$out/$installPrefix/languageServer.${languageServer.version}"
chmod -R +wx "$out/$installPrefix/languageServer.${languageServer.version}"
'';
meta = with lib; {
license = licenses.mit;
maintainers = [ maintainers.jraygauthier ];
};
}

View file

@ -0,0 +1,15 @@
{ stdenv, unzip }:
{ name, version, src, ... }:
stdenv.mkDerivation {
inherit name version src;
buildInputs = [ unzip ];
dontBuild = true;
unpackPhase = "unzip $src";
installPhase = ''
mkdir -p "$out"
chmod -R +w .
find . -mindepth 1 -maxdepth 1 | xargs cp -a -t "$out"
'';
}

View file

@ -33,11 +33,17 @@ let
inherit vscodeExtUniqueId;
inherit configurePhase buildPhase dontPatchELF dontStrip;
installPrefix = "share/${extendedPkgName}/extensions/${vscodeExtUniqueId}";
buildInputs = [ unzip ] ++ buildInputs;
installPhase = ''
mkdir -p "$out/share/${extendedPkgName}/extensions/${vscodeExtUniqueId}"
find . -mindepth 1 -maxdepth 1 | xargs -d'\n' mv -t "$out/share/${extendedPkgName}/extensions/${vscodeExtUniqueId}/"
runHook preInstall
mkdir -p "$out/$installPrefix"
find . -mindepth 1 -maxdepth 1 | xargs -d'\n' mv -t "$out/$installPrefix/"
runHook postInstall
'';
});