about summary refs log tree commit diff
path: root/pkgs/applications/blockchains/zcash
diff options
context:
space:
mode:
authorAlex Wied <centromere@users.noreply.github.com>2022-07-13 05:16:05 -0400
committerAlex Wied <centromere@users.noreply.github.com>2022-07-22 19:45:44 -0400
commit5f564536bb640b24c9e7aa39ac75cf1d20aacd7a (patch)
tree6a7aea1f6eeee247359a7f3222e72d855f7e6ae5 /pkgs/applications/blockchains/zcash
parentaeed5a4f931232d7ef4c05ab8b3c1c81b9af26b5 (diff)
zcash: 5.0.0 -> 5.1.0
Diffstat (limited to 'pkgs/applications/blockchains/zcash')
-rw-r--r--pkgs/applications/blockchains/zcash/default.nix39
-rw-r--r--pkgs/applications/blockchains/zcash/patches/fix-missing-header.patch10
2 files changed, 30 insertions, 19 deletions
diff --git a/pkgs/applications/blockchains/zcash/default.nix b/pkgs/applications/blockchains/zcash/default.nix
index 5a72462b14252..20520037a60c1 100644
--- a/pkgs/applications/blockchains/zcash/default.nix
+++ b/pkgs/applications/blockchains/zcash/default.nix
@@ -1,19 +1,17 @@
-{ rust, rustPlatform, stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook
-, makeWrapper, cargo, pkg-config, curl, coreutils, boost179, db62, hexdump
-, libsodium, libevent, testers, utf8cpp, util-linux, withDaemon ? true
-, withMining ? true, withUtils ? true, withWallet ? true, withZmq ? true, zcash
-, zeromq
+{ autoreconfHook, boost179, cargo, coreutils, curl, cxx-rs, db62, fetchFromGitHub
+, hexdump, lib, libevent, libsodium, makeWrapper, rust, rustPlatform, pkg-config
+, stdenv, testers, utf8cpp, util-linux, zcash, zeromq
 }:
 
-rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
+rustPlatform.buildRustPackage.override { inherit stdenv; } rec {
   pname = "zcash";
-  version = "5.0.0";
+  version = "5.1.0";
 
   src = fetchFromGitHub {
     owner = "zcash";
     repo  = "zcash";
     rev = "v${version}";
-    sha256 = "sha256-5PlqFs2njqNeZgmNz0VKMWcRY5lPaF9oTsoh/uLEWi8=";
+    sha256 = "sha256-tU6DuWpe8Vlx0qIilAKWuO7WFp1ucbxtvOxoWLA0gdc=";
   };
 
   prePatch = lib.optionalString stdenv.isAarch64 ''
@@ -22,12 +20,15 @@ rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
       --replace "linker = \"aarch64-linux-gnu-gcc\"" ""
   '';
 
-  cargoSha256 = "sha256-eRRRjUbOieRC88wf+f1jAYvqGFmogBEla67NnImicEc=";
+  patches = [
+    ./patches/fix-missing-header.patch
+  ];
 
-  nativeBuildInputs = [ autoreconfHook cargo hexdump makeWrapper pkg-config ];
-  buildInputs = [ boost179 libevent libsodium utf8cpp ]
-    ++ lib.optional withWallet db62
-    ++ lib.optional withZmq zeromq;
+  cargoSha256 = "sha256-ZWmkveDEENdXRirGmnUWSjtPNJvX0Jpgfxhzk44F7Q0=";
+
+  nativeBuildInputs = [ autoreconfHook cargo cxx-rs hexdump makeWrapper pkg-config ];
+
+  buildInputs = [ boost179 db62 libevent libsodium utf8cpp zeromq ];
 
   # Use the stdenv default phases (./configure; make) instead of the
   # ones from buildRustPackage.
@@ -42,15 +43,16 @@ rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
     configureFlagsArray+=("RUST_VENDORED_SOURCES=$NIX_BUILD_TOP/$cargoDepsCopy")
   '';
 
+  CXXFLAGS = [
+    "-I${lib.getDev utf8cpp}/include/utf8cpp"
+    "-I${lib.getDev cxx-rs}/include"
+  ];
+
   configureFlags = [
     "--disable-tests"
     "--with-boost-libdir=${lib.getLib boost179}/lib"
-    "CXXFLAGS=-I${lib.getDev utf8cpp}/include/utf8cpp"
     "RUST_TARGET=${rust.toRustTargetSpec stdenv.hostPlatform}"
-  ] ++ lib.optional (!withWallet) "--disable-wallet"
-    ++ lib.optional (!withDaemon) "--without-daemon"
-    ++ lib.optional (!withUtils) "--without-utils"
-    ++ lib.optional (!withMining) "--disable-mining";
+  ];
 
   enableParallelBuilding = true;
 
@@ -73,6 +75,5 @@ rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
     homepage = "https://z.cash/";
     maintainers = with maintainers; [ rht tkerber centromere ];
     license = licenses.mit;
-    platforms = platforms.linux ++ platforms.darwin;
   };
 }
diff --git a/pkgs/applications/blockchains/zcash/patches/fix-missing-header.patch b/pkgs/applications/blockchains/zcash/patches/fix-missing-header.patch
new file mode 100644
index 0000000000000..6850d78ef12bf
--- /dev/null
+++ b/pkgs/applications/blockchains/zcash/patches/fix-missing-header.patch
@@ -0,0 +1,10 @@
+--- a/src/uint256.h	2022-07-20 10:07:39.191319302 +0000
++++ b/src/uint256.h	2022-07-20 10:07:11.809632293 +0000
+@@ -7,6 +7,7 @@
+ #ifndef BITCOIN_UINT256_H
+ #define BITCOIN_UINT256_H
+
++#include <array>
+ #include <assert.h>
+ #include <cstring>
+ #include <stdexcept>