2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, python3
|
|
|
|
, makeWrapper
|
2023-08-04 22:07:22 +00:00
|
|
|
, writeScriptBin
|
2023-05-24 13:37:59 +00:00
|
|
|
, darwin
|
2023-07-15 17:15:38 +00:00
|
|
|
, which
|
2024-07-27 06:49:29 +00:00
|
|
|
, nix-update-script
|
|
|
|
, testers
|
|
|
|
, pylyzer
|
2023-05-24 13:37:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "pylyzer";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.0.56";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mtshiba";
|
|
|
|
repo = "pylyzer";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-t/v9Ghnfsnwvo05PnvRInXRCbA0fi9ZQkIrrvtzBSCg=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2024-07-27 06:49:29 +00:00
|
|
|
"rustpython-ast-0.3.1" = "sha256-KjglE3KvA9F7eg9pPTV6+PrLxiWnCgtkMOsFsoPC5N8=";
|
2024-05-15 15:35:15 +00:00
|
|
|
};
|
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
git
|
|
|
|
python3
|
|
|
|
makeWrapper
|
2023-08-04 22:07:22 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
(writeScriptBin "diskutil" "")
|
2023-05-24 13:37:59 +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
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
which
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +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
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
tests.version = testers.testVersion { package = pylyzer; };
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Fast static code analyzer & language server for Python";
|
2023-05-24 13:37:59 +00:00
|
|
|
homepage = "https://github.com/mtshiba/pylyzer";
|
|
|
|
changelog = "https://github.com/mtshiba/pylyzer/releases/tag/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ natsukium ];
|
|
|
|
mainProgram = "pylyzer";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
}
|