zcash-mini.nix 1023 B

12345678910111213141516171819202122232425262728293031
  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. # url = /path/to/repo/zcash-mini-a2b350;
  8. rev = "a2b35042ad3a3bc22b925ecfc45e768a376bd29a";
  9. shallow = true;
  10. };
  11. buildInputs = [ pkgs.go pkgs.binutils ];
  12. patchPhase = ''
  13. sed -e "s@github.com/FiloSottile/@@" -i main.go
  14. sed -e "s@github.com/FiloSottile/@@" -i zcash/address.go
  15. sed -e "s@github.com/btcsuite@zcash-mini@" -i zcash/address.go
  16. sed -e "s@golang.org/x@zcash-mini@" -i zcash/address.go
  17. mv vendor/github.com/btcsuite/btcutil .
  18. mv vendor/golang.org/x/crypto .
  19. '';
  20. dontConfigure = true;
  21. dontBuild = true;
  22. installPhase = ''
  23. export HOME=$TMPDIR
  24. go mod init zcash-mini
  25. go build -mod=mod
  26. mkdir --parents $out/bin
  27. install --strip --mode=755 zcash-mini $out/bin
  28. '';
  29. dontFixup = true;
  30. }