depot/third_party/nixpkgs/pkgs/development/python-modules/chia-rs/default.nix
Default email 83405b6dd2 Project import generated by Copybara.
GitOrigin-RevId: ac718d02867a84b42522a0ece52d841188208f2c
2023-03-15 17:39:30 +01:00

54 lines
1 KiB
Nix

{ buildPythonPackage
, lib
, fetchFromGitHub
, pytestCheckHook
, rustPlatform
}:
buildPythonPackage rec {
pname = "chia-rs";
version = "0.2.2";
src = fetchFromGitHub {
owner = "chia-network";
repo = "chia_rs";
rev = "refs/tags/${version}";
hash = "sha256-mr5v68NP9+M4FlP/3Gv3GvZOWaCNjZDARKGANgDTs4E=";
};
patches = [
# undo a hack from upstream that confuses our build hook
./fix-build.patch
];
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
'';
nativeCheckInputs = [
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;
};
}