depot/third_party/nixpkgs/pkgs/development/tools/language-servers/pylyzer/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

70 lines
1.4 KiB
Nix

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, git
, python3
, makeWrapper
, writeScriptBin
, darwin
, which
}:
rustPlatform.buildRustPackage rec {
pname = "pylyzer";
version = "0.0.48";
src = fetchFromGitHub {
owner = "mtshiba";
repo = "pylyzer";
rev = "v${version}";
hash = "sha256-NQvMOBjRIf7sQBff2iZe8MbnZiZZN0DTE+HBvxsvKpM=";
};
cargoHash = "sha256-eDa3UKPgATJQLIkHpG/G50V20TW/5vwjRTfshHb3zTQ=";
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 = "A 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 ];
};
}