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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
1.4 KiB
Nix
Raw Normal View History

2023-04-30 12:25:19 +00:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, git
, python3
, makeWrapper
2023-08-02 18:47:38 +00:00
, writeScriptBin
2023-04-30 12:25:19 +00:00
, darwin
, which
2023-04-30 12:25:19 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "pylyzer";
version = "0.0.51";
2023-04-30 12:25:19 +00:00
src = fetchFromGitHub {
owner = "mtshiba";
repo = "pylyzer";
rev = "refs/tags/v${version}";
hash = "sha256-TKAmIy5dP2m1iokxSqfxTj79UDkW00+se/NDGS3euwA=";
2023-04-30 12:25:19 +00:00
};
cargoHash = "sha256-035ueF42g6By+6TOGEultc8n350g3mRT00raQgWIcUM=";
2023-04-30 12:25:19 +00:00
nativeBuildInputs = [
git
python3
makeWrapper
2023-08-02 18:47:38 +00:00
] ++ lib.optionals stdenv.isDarwin [
(writeScriptBin "diskutil" "")
2023-04-30 12:25:19 +00:00
];
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
];
2023-04-30 12:25:19 +00:00
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 ];
};
}