diff --git a/pkgs/applications/blockchains/zcash/default.nix b/pkgs/applications/blockchains/zcash/default.nix index 5a72462b1425..20520037a60c 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 000000000000..6850d78ef12b --- /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 + #include + #include + #include diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 480c5ab77043..f3511c612244 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31939,7 +31939,9 @@ with pkgs; boost = boost175; }; - zcash = callPackage ../applications/blockchains/zcash { }; + zcash = callPackage ../applications/blockchains/zcash { + stdenv = if stdenv.isDarwin then stdenv else llvmPackages_13.stdenv; + }; lightwalletd = callPackage ../applications/blockchains/lightwalletd { };