depot/third_party/nixpkgs/pkgs/development/tools/language-servers/pylyzer/default.nix

76 lines
1.5 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, git
, python3
, makeWrapper
, writeScriptBin
, darwin
, which
}:
rustPlatform.buildRustPackage rec {
pname = "pylyzer";
version = "0.0.54";
src = fetchFromGitHub {
owner = "mtshiba";
repo = "pylyzer";
rev = "refs/tags/v${version}";
hash = "sha256-GUZMzV0yztlLcxvuTAuRoQ4eQhoMMyqjdu3cfOCJCJE=";
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"rustpython-ast-0.3.1" = "sha256-q9N+z3F6YICQuUMp3a10OS792tCq0GiSSlkcaLxi3Gs=";
};
};
nativeBuildInputs = [
git
python3
makeWrapper
] ++ lib.optionals stdenv.isDarwin [
(writeScriptBin "diskutil" "")
];
buildInputs = [
python3
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
preBuild = ''
export HOME=$TMPDIR
'';
postInstall = ''
mkdir -p $out/lib
cp -r $HOME/.erg/ $out/lib/erg
'';
nativeCheckInputs = [
which
];
checkFlags = [
# this test causes stack overflow
# > thread 'exec_import' has overflowed its stack
"--skip=exec_import"
];
postFixup = ''
wrapProgram $out/bin/pylyzer --set ERG_PATH $out/lib/erg
'';
meta = with lib; {
description = "Fast static code analyzer & language server for Python";
homepage = "https://github.com/mtshiba/pylyzer";
changelog = "https://github.com/mtshiba/pylyzer/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ natsukium ];
};
}