55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
bash,
|
|
replaceVars,
|
|
rustPlatform,
|
|
fetchFromGitHub,
|
|
versionCheckHook,
|
|
nix-update-script,
|
|
rust-jemalloc-sys,
|
|
}:
|
|
rustPlatform.buildRustPackage (finalAttrs: {
|
|
pname = "pyrefly";
|
|
version = "1.2.0-dev.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "facebook";
|
|
repo = "pyrefly";
|
|
tag = finalAttrs.version;
|
|
hash = "sha256-IQOyAYSnQ8GTIWhfNr/fMQl/TP4v3/tcf72hyHzkfjk=";
|
|
};
|
|
|
|
buildAndTestSubdir = "pyrefly";
|
|
|
|
cargoHash = "sha256-x2gKbMopAN9FJ276KhPQouvb6Gw1z3PY4RRCdhkuhmo=";
|
|
|
|
buildInputs = [ rust-jemalloc-sys ];
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
versionCheckProgramArg = "--version";
|
|
doInstallCheck = true;
|
|
|
|
patches = [
|
|
(replaceVars ./fix-shebang.patch { bash = lib.getExe bash; })
|
|
];
|
|
|
|
# redirect tests writing to /tmp
|
|
preCheck = ''
|
|
export TMPDIR=$(mktemp -d)
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
description = "Fast type checker and IDE for Python";
|
|
homepage = "https://github.com/facebook/pyrefly";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "pyrefly";
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
maintainers = with lib.maintainers; [
|
|
cybardev
|
|
QuiNzX
|
|
];
|
|
};
|
|
})
|