1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, rustPlatform
5, pythonOlder
6, openssl
7, perl
8}:
9
10buildPythonPackage rec {
11 pname = "clvm_rs";
12 version = "0.1.15";
13 disabled = pythonOlder "3.7";
14
15 src = fetchFromGitHub {
16 owner = "Chia-Network";
17 repo = "clvm_rs";
18 rev = version;
19 sha256 = "sha256-4QFreQlRjKqGhPvuXU/pZpxMfF8LkIf6X7C3K2q77MI=";
20 };
21
22 patches = [
23 # upstream forgot to refresh the lock file
24 ./bump-cargo-lock.patch
25 ];
26
27 cargoDeps = rustPlatform.fetchCargoTarball {
28 inherit src patches;
29 name = "${pname}-${version}";
30 sha256 = "sha256-jPNU+P6JgxTPL1GYUBE4VPU3p6cgL8u/+AIELr7r5Mk=";
31 };
32
33 format = "pyproject";
34
35 nativeBuildInputs = [
36 perl # used by openssl-sys to configure
37 ] ++ (with rustPlatform; [
38 cargoSetupHook
39 maturinBuildHook
40 ]);
41
42 buildInputs = [ openssl ];
43
44 pythonImportsCheck = [ "clvm_rs" ];
45
46 meta = with lib; {
47 homepage = "https://chialisp.com/";
48 description = "Rust implementation of clvm";
49 license = licenses.asl20;
50 maintainers = teams.chia.members;
51 };
52}