nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, rustPlatform
4, fetchFromGitHub
5, git
6, python3
7, makeWrapper
8, darwin
9, which
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "pylyzer";
14 version = "0.0.30";
15
16 src = fetchFromGitHub {
17 owner = "mtshiba";
18 repo = "pylyzer";
19 rev = "v${version}";
20 hash = "sha256-o90NmUTRdmfjOO0swc4d3SsbywiMeT1zKrkiFO3VeGk=";
21 };
22
23 cargoHash = "sha256-IUNT30hKpBlmXoHiJQihQF4oD7odSJh2NK3d2On1WQA=";
24
25 nativeBuildInputs = [
26 git
27 python3
28 makeWrapper
29 ];
30
31 buildInputs = [
32 python3
33 ] ++ lib.optionals stdenv.isDarwin [
34 darwin.apple_sdk.frameworks.Security
35 ];
36
37 preBuild = ''
38 export HOME=$TMPDIR
39 '';
40
41 postInstall = ''
42 mkdir -p $out/lib
43 cp -r $HOME/.erg/ $out/lib/erg
44 '';
45
46 nativeCheckInputs = [
47 which
48 ];
49
50 checkFlags = [
51 # this test causes stack overflow
52 # > thread 'exec_import' has overflowed its stack
53 "--skip=exec_import"
54 ];
55
56 postFixup = ''
57 wrapProgram $out/bin/pylyzer --set ERG_PATH $out/lib/erg
58 '';
59
60 meta = with lib; {
61 description = "A fast static code analyzer & language server for Python";
62 homepage = "https://github.com/mtshiba/pylyzer";
63 changelog = "https://github.com/mtshiba/pylyzer/releases/tag/v${version}";
64 license = licenses.mit;
65 maintainers = with maintainers; [ natsukium ];
66 };
67}