Merge pull request #172778 from centromere/zcash-5.0.0

zcash: 4.7.0 -> 5.0.0
main
tomberek 2 years ago committed by GitHub
commit 2f5d6f31f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      pkgs/applications/blockchains/zcash/default.nix

@ -1,18 +1,19 @@
{ rust, rustPlatform, stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook { rust, rustPlatform, stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook
, makeWrapper, cargo, pkg-config, curl, coreutils, boost178, db62, hexdump , makeWrapper, cargo, pkg-config, curl, coreutils, boost179, db62, hexdump
, libsodium, libevent, utf8cpp, util-linux, withDaemon ? true, withMining ? true , libsodium, libevent, testers, utf8cpp, util-linux, withDaemon ? true
, withUtils ? true, withWallet ? true, withZmq ? true, zeromq , withMining ? true, withUtils ? true, withWallet ? true, withZmq ? true, zcash
, zeromq
}: }:
rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec { rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
pname = "zcash"; pname = "zcash";
version = "4.7.0"; version = "5.0.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "zcash"; owner = "zcash";
repo = "zcash"; repo = "zcash";
rev = "v${version}"; rev = "v${version}";
sha256 = "sha256-yF+/QepSiZwsdZydWjvxDIFeFyJbJyqZmCdMyQHmrzI="; sha256 = "sha256-5PlqFs2njqNeZgmNz0VKMWcRY5lPaF9oTsoh/uLEWi8=";
}; };
prePatch = lib.optionalString stdenv.isAarch64 '' prePatch = lib.optionalString stdenv.isAarch64 ''
@ -21,17 +22,10 @@ rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
--replace "linker = \"aarch64-linux-gnu-gcc\"" "" --replace "linker = \"aarch64-linux-gnu-gcc\"" ""
''; '';
cargoPatches = [ cargoSha256 = "sha256-eRRRjUbOieRC88wf+f1jAYvqGFmogBEla67NnImicEc=";
(fetchpatch {
url = "https://github.com/zcash/zcash/commit/61cd19a52d41d60c1987ecf269f7aa8e4d527310.diff";
sha256 = "sha256-/7T2yCSVlRN7qfFjrZlfBNMlbVHb/KRjtUBY2xFr0mo=";
})
];
cargoSha256 = "sha256-+BLfO5OnCBqQTIqMXKJdoPCRgtENa+m0WOHKG9gkdMk=";
nativeBuildInputs = [ autoreconfHook cargo hexdump makeWrapper pkg-config ]; nativeBuildInputs = [ autoreconfHook cargo hexdump makeWrapper pkg-config ];
buildInputs = [ boost178 libevent libsodium utf8cpp ] buildInputs = [ boost179 libevent libsodium utf8cpp ]
++ lib.optional withWallet db62 ++ lib.optional withWallet db62
++ lib.optional withZmq zeromq; ++ lib.optional withZmq zeromq;
@ -50,7 +44,7 @@ rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
configureFlags = [ configureFlags = [
"--disable-tests" "--disable-tests"
"--with-boost-libdir=${lib.getLib boost178}/lib" "--with-boost-libdir=${lib.getLib boost179}/lib"
"CXXFLAGS=-I${lib.getDev utf8cpp}/include/utf8cpp" "CXXFLAGS=-I${lib.getDev utf8cpp}/include/utf8cpp"
"RUST_TARGET=${rust.toRustTargetSpec stdenv.hostPlatform}" "RUST_TARGET=${rust.toRustTargetSpec stdenv.hostPlatform}"
] ++ lib.optional (!withWallet) "--disable-wallet" ] ++ lib.optional (!withWallet) "--disable-wallet"
@ -63,6 +57,12 @@ rustPlatform.buildRustPackage.override { stdenv = stdenv; } rec {
# Requires hundreds of megabytes of zkSNARK parameters. # Requires hundreds of megabytes of zkSNARK parameters.
doCheck = false; doCheck = false;
passthru.tests.version = testers.testVersion {
package = zcash;
command = "zcashd --version";
version = "v${zcash.version}";
};
postInstall = '' postInstall = ''
wrapProgram $out/bin/zcash-fetch-params \ wrapProgram $out/bin/zcash-fetch-params \
--set PATH ${lib.makeBinPath [ coreutils curl util-linux ]} --set PATH ${lib.makeBinPath [ coreutils curl util-linux ]}

Loading…
Cancel
Save