1{ buildPythonPackage
2, lib
3, fetchFromGitHub
4, pytestCheckHook
5, rustPlatform
6}:
7
8buildPythonPackage rec {
9 pname = "chia-rs";
10 version = "0.1.5";
11
12 src = fetchFromGitHub {
13 owner = "chia-network";
14 repo = "chia_rs";
15 rev = version;
16 sha256 = "sha256-4TIRj7FMIArI/EvDARReC4MqDG44zjn/MKoUHAVqq5s=";
17 };
18
19 cargoDeps = rustPlatform.importCargoLock {
20 lockFile = ./Cargo.lock;
21 };
22
23 postPatch = ''
24 cp ${./Cargo.lock} Cargo.lock
25 '';
26
27 nativeBuildInputs = with rustPlatform; [
28 cargoSetupHook
29 maturinBuildHook
30 ];
31
32 preBuild = ''
33 # avoid ENOENT in maturinBuildHook
34 touch wheel/Cargo.lock
35 '';
36
37 checkInputs = [
38 pytestCheckHook
39 ];
40
41 buildAndTestSubdir = "wheel";
42
43 meta = with lib; {
44 description = "Rust crate & wheel with consensus code";
45 homepage = "https://github.com/Chia-Network/chia_rs/";
46 license = licenses.asl20;
47 maintainers = teams.chia.members;
48 };
49}