@@ -0,0 +1,69 @@
1+{ lib, fetchFromGitHub, python3Packages }:
2+
3+python3Packages.buildPythonApplication rec {
4+ pname = "chia";
5+ version = "1.1.5";
6+
7+ src = fetchFromGitHub {
8+ owner = "Chia-Network";
9+ repo = "chia-blockchain";
10+ rev = version;
11+ sha256 = "ZUxWOlJGQpeQCtWt0PSdcbMackHdeuNFkxHvYDPcU8Y=";
12+ };
13+
14+ patches = [
15+ # tweak version requirements to what's available in Nixpkgs
16+ ./dependencies.patch
17+ ];
18+
19+ nativeBuildInputs = [
20+ python3Packages.setuptools-scm
21+ ];
22+
23+ # give a hint to setuptools_scm on package version
24+ SETUPTOOLS_SCM_PRETEND_VERSION = "v${version}";
25+
26+ propagatedBuildInputs = with python3Packages; [
27+ aiohttp
28+ aiosqlite
29+ bitstring
30+ blspy
31+ chiapos
32+ chiavdf
33+ chiabip158
34+ click
35+ clvm
36+ clvm-rs
37+ clvm-tools
38+ colorlog
39+ concurrent-log-handler
40+ cryptography
41+ keyrings-cryptfile
42+ pyyaml
43+ setproctitle
44+ setuptools # needs pkg_resources at runtime
45+ sortedcontainers
46+ websockets
47+ ];
48+
49+ checkInputs = [
50+ python3Packages.pytestCheckHook
51+ ];
52+
53+ disabledTests = [
54+ "test_spend_through_n"
55+ "test_spend_zero_coin"
56+ ];
57+
58+ preCheck = ''
59+ export HOME=`mktemp -d`
60+ '';
61+
62+ meta = with lib; {
63+ homepage = "https://www.chia.net/";
64+ description = "Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure.";
65+ license = with licenses; [ asl20 ];
66+ maintainers = teams.chia.members;
67+ platforms = platforms.all;
68+ };
69+}