2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, python3Packages
|
|
|
|
}:
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "chia";
|
2021-07-17 21:14:59 +00:00
|
|
|
version = "1.2.2";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Chia-Network";
|
|
|
|
repo = "chia-blockchain";
|
|
|
|
rev = version;
|
2021-07-17 21:14:59 +00:00
|
|
|
sha256 = "sha256-ZYncyaX9gqBhDKiC87A2xI7VeU0zGsmm3Sx45lwgnrg=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-06-28 23:13:55 +00:00
|
|
|
# Allow later websockets release, https://github.com/Chia-Network/chia-blockchain/pull/6304
|
|
|
|
(fetchpatch {
|
|
|
|
name = "later-websockets.patch";
|
|
|
|
url = "https://github.com/Chia-Network/chia-blockchain/commit/a188f161bf15a30e8e2efc5eec824e53e2a98a5b.patch";
|
|
|
|
sha256 = "1s5qjhd4kmi28z6ni7pc5n09czxvh8qnbwmnqsmms7cpw700g78s";
|
|
|
|
})
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
python3Packages.setuptools-scm
|
|
|
|
];
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
# give a hint to setuptools-scm on package version
|
2021-05-20 23:08:51 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = "v${version}";
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
aiohttp
|
|
|
|
aiosqlite
|
|
|
|
bitstring
|
|
|
|
blspy
|
|
|
|
chiapos
|
|
|
|
chiavdf
|
|
|
|
chiabip158
|
|
|
|
click
|
|
|
|
clvm
|
|
|
|
clvm-rs
|
|
|
|
clvm-tools
|
|
|
|
colorlog
|
|
|
|
concurrent-log-handler
|
|
|
|
cryptography
|
2021-06-28 23:13:55 +00:00
|
|
|
dnspython
|
2021-05-20 23:08:51 +00:00
|
|
|
keyrings-cryptfile
|
|
|
|
pyyaml
|
|
|
|
setproctitle
|
|
|
|
setuptools # needs pkg_resources at runtime
|
|
|
|
sortedcontainers
|
|
|
|
websockets
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
checkInputs = with python3Packages; [
|
|
|
|
pytestCheckHook
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_spend_through_n"
|
|
|
|
"test_spend_zero_coin"
|
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postPatch = ''
|
|
|
|
# tweak version requirements to what's available in Nixpkgs
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "aiohttp==3.7.4" "aiohttp>=3.7.4" \
|
|
|
|
--replace "sortedcontainers==2.3.0" "sortedcontainers>=2.3.0" \
|
|
|
|
--replace "click==7.1.2" "click>=7.1.2" \
|
|
|
|
--replace "clvm_rs==0.1.8" "clvm_rs>=0.1.8" \
|
|
|
|
--replace "clvm==0.9.7" "clvm>=0.9.7" \
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=`mktemp -d`
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://www.chia.net/";
|
|
|
|
description = "Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure.";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = teams.chia.members;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|