63 lines
1.2 KiB
Nix
63 lines
1.2 KiB
Nix
|
{ lib
|
||
|
, stdenv
|
||
|
, rustPlatform
|
||
|
, fetchFromGitHub
|
||
|
, git
|
||
|
, python3
|
||
|
, makeWrapper
|
||
|
, darwin
|
||
|
}:
|
||
|
|
||
|
rustPlatform.buildRustPackage rec {
|
||
|
pname = "pylyzer";
|
||
|
version = "0.0.27";
|
||
|
|
||
|
src = fetchFromGitHub {
|
||
|
owner = "mtshiba";
|
||
|
repo = "pylyzer";
|
||
|
rev = "v${version}";
|
||
|
hash = "sha256-RtfRYycHSDaOE71tTtChdMJKyRyTqracHw4p94heFwU=";
|
||
|
};
|
||
|
|
||
|
cargoHash = "sha256-Ggvcg96j9LlhDy0BMJzNDXE1Qtf04svt2ezXmkq3aUA=";
|
||
|
|
||
|
nativeBuildInputs = [
|
||
|
git
|
||
|
python3
|
||
|
makeWrapper
|
||
|
];
|
||
|
|
||
|
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
|
||
|
'';
|
||
|
|
||
|
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 ];
|
||
|
};
|
||
|
}
|