summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ru/rustpython/package.nix
blob: 52eb5c782cd244d4c6a26ce6fb46167437fe7197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  lib,
  libffi,
  rustPlatform,
  fetchFromGitHub,
  python3,
  versionCheckHook,
  nix-update-script,
}:

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "rustpython";
  version = "0.5.0";

  src = fetchFromGitHub {
    owner = "RustPython";
    repo = "RustPython";
    tag = finalAttrs.version;
    hash = "sha256-rjDJXXR1ByFubZtzy70DZKur6nqVmufd3TqwxN1s9kE=";
  };

  cargoHash = "sha256-I+yeaMN5wxt+l4I8qUPq2fk+OER8/QxeHAKtvvYIV9Y=";

  # freeze the stdlib into the rustpython binary
  cargoBuildFlags = [ "--features=freeze-stdlib" ];

  buildInputs = [ libffi ];

  nativeCheckInputs = [ python3 ];

  nativeInstallCheckInputs = [
    versionCheckHook
  ];
  doInstallCheck = true;

  passthru = {
    updateScript = nix-update-script { };
  };

  meta = {
    description = "Python 3 interpreter in written Rust";
    homepage = "https://rustpython.github.io";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      prusnak
      miniharinn
    ];
    mainProgram = "rustpython";
  };
})