nixpkgs/pkgs/applications/blockchains/zcash/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

89 lines
2.4 KiB
Nix
Raw Normal View History

2022-10-21 06:35:58 +00:00
{ autoreconfHook, boost180, cargo, coreutils, curl, cxx-rs, db62, fetchFromGitHub
, git, hexdump, lib, libevent, libsodium, makeWrapper, rustPlatform
, pkg-config, Security, stdenv, testers, tl-expected, utf8cpp, util-linux, zcash, zeromq
}:
2017-03-17 09:53:11 +00:00
2022-07-13 09:16:05 +00:00
rustPlatform.buildRustPackage.override { inherit stdenv; } rec {
2019-11-13 14:40:36 +00:00
pname = "zcash";
version = "5.4.2";
2017-03-17 09:53:11 +00:00
src = fetchFromGitHub {
owner = "zcash";
repo = "zcash";
2017-08-22 03:29:17 +00:00
rev = "v${version}";
hash = "sha256-XGq/cYUo43FcpmRDO2YiNLCuEQLsTFLBFC4M1wM29l8=";
2017-03-17 09:53:11 +00:00
};
2022-04-26 23:22:12 +00:00
prePatch = lib.optionalString stdenv.isAarch64 ''
substituteInPlace .cargo/config.offline \
--replace "[target.aarch64-unknown-linux-gnu]" "" \
--replace "linker = \"aarch64-linux-gnu-gcc\"" ""
'';
cargoHash = "sha256-Mz8mr/RDcOfwJvXhY19rZmWHP8mUeEf9GYD+3JAPNOw=";
2022-07-13 09:16:05 +00:00
nativeBuildInputs = [ autoreconfHook cargo cxx-rs git hexdump makeWrapper pkg-config ];
2022-07-13 09:16:05 +00:00
2022-10-21 06:35:58 +00:00
buildInputs = [
boost180
db62
libevent
libsodium
tl-expected
2022-10-21 06:35:58 +00:00
utf8cpp
zeromq
] ++ lib.optionals stdenv.isDarwin [
Security
];
2017-03-17 09:53:11 +00:00
# Use the stdenv default phases (./configure; make) instead of the
# ones from buildRustPackage.
configurePhase = "configurePhase";
buildPhase = "buildPhase";
checkPhase = "checkPhase";
installPhase = "installPhase";
2017-03-17 09:53:11 +00:00
postPatch = ''
# Have to do this here instead of in preConfigure because
# cargoDepsCopy gets unset after postPatch.
configureFlagsArray+=("RUST_VENDORED_SOURCES=$cargoDepsCopy")
2017-03-17 09:53:11 +00:00
'';
2022-07-13 09:16:05 +00:00
CXXFLAGS = [
"-I${lib.getDev utf8cpp}/include/utf8cpp"
"-I${lib.getDev cxx-rs}/include"
];
configureFlags = [
"--disable-tests"
2022-10-21 06:35:58 +00:00
"--with-boost-libdir=${lib.getLib boost180}/lib"
"RUST_TARGET=${stdenv.hostPlatform.rust.rustcTargetSpec}"
2022-07-13 09:16:05 +00:00
];
enableParallelBuilding = true;
# Requires hundreds of megabytes of zkSNARK parameters.
doCheck = false;
2022-05-12 23:07:15 +00:00
passthru.tests.version = testers.testVersion {
package = zcash;
command = "zcashd --version";
version = "v${zcash.version}";
};
postInstall = ''
wrapProgram $out/bin/zcash-fetch-params \
--set PATH ${lib.makeBinPath [ coreutils curl util-linux ]}
'';
meta = with lib; {
2017-03-17 09:53:11 +00:00
description = "Peer-to-peer, anonymous electronic cash system";
homepage = "https://z.cash/";
2022-04-26 23:22:12 +00:00
maintainers = with maintainers; [ rht tkerber centromere ];
2017-03-17 09:53:11 +00:00
license = licenses.mit;
2022-10-21 06:35:58 +00:00
# https://github.com/zcash/zcash/issues/4405
broken = stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin;
2017-03-17 09:53:11 +00:00
};
}