summaryrefslogtreecommitdiff
path: root/pkgs/zcash/default.nix
blob: 07528adcc49b7f78b062273d152cc302877fc37c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ stdenv, fetchurl, patchelf, gcc5 }:

stdenv.mkDerivation rec {
  version = "1.0.9";
  name = "zcash-${version}";

  src = fetchurl {
    url = "https://z.cash/downloads/zcash-1.0.9-linux64.tar.gz";
    sha256 = "74573fac7888ebe08056501da6934c1339b25957a872bbbaabfc074a472c66e1";
  };

  buildInputs = [ gcc5 ];

  buildPhase = ''
    set -x
    for b in bin/{zcash-cli,zcashd,zcash-tx}; do
      echo "patching $b"
      patchelf \
        --set-rpath "${stdenv.lib.makeLibraryPath [ gcc5.cc ]}" \
        --set-interpreter "$(cat ${stdenv.cc}/nix-support/dynamic-linker)" \
        "$b"
    done
    set +x
  '';

  installPhase = ''
    mkdir $out
    cp -r * $out/
  '';
}