zcash-mini.nix 950 B

1234567891011121314151617181920212223242526272829
  1. { pkgs }:
  2. pkgs.stdenvNoCC.mkDerivation {
  3. pname = "zcash-mini";
  4. version = "a2b35042";
  5. src = fetchGit {
  6. url = "https://github.com/FiloSottile/zcash-mini";
  7. rev = "a2b35042ad3a3bc22b925ecfc45e768a376bd29a";
  8. };
  9. buildInputs = [ pkgs.go pkgs.binutils ];
  10. patchPhase = ''
  11. sed -e "s@github.com/FiloSottile/@@" -i main.go
  12. sed -e "s@github.com/FiloSottile/@@" -i zcash/address.go
  13. sed -e "s@github.com/btcsuite@zcash-mini@" -i zcash/address.go
  14. sed -e "s@golang.org/x@zcash-mini@" -i zcash/address.go
  15. mv vendor/github.com/btcsuite/btcutil .
  16. mv vendor/golang.org/x/crypto .
  17. '';
  18. dontConfigure = true;
  19. dontBuild = true;
  20. installPhase = ''
  21. export HOME=$TMPDIR
  22. go mod init zcash-mini
  23. go build -mod=mod
  24. mkdir --parents $out/bin
  25. install --strip --mode=755 zcash-mini $out/bin
  26. '';
  27. dontFixup = true;
  28. }