2022-08-12 12:06:08 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pytestCheckHook
|
|
|
|
, rustPlatform
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "chia-rs";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "0.2.2";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chia-network";
|
|
|
|
repo = "chia_rs";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-mr5v68NP9+M4FlP/3Gv3GvZOWaCNjZDARKGANgDTs4E=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
patches = [
|
|
|
|
# undo a hack from upstream that confuses our build hook
|
|
|
|
./fix-build.patch
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
cargoDeps = rustPlatform.importCargoLock {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cp ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
maturinBuildHook
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
# avoid ENOENT in maturinBuildHook
|
|
|
|
touch wheel/Cargo.lock
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildAndTestSubdir = "wheel";
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Rust crate & wheel with consensus code";
|
|
|
|
homepage = "https://github.com/Chia-Network/chia_rs/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = teams.chia.members;
|
|
|
|
};
|
|
|
|
}
|