bitcoin-cash-node.nix 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. { pkgs }:
  2. pkgs.stdenv.mkDerivation rec {
  3. pname = "bitcoin-cash-node";
  4. version = "v28.0.0";
  5. src = fetchGit {
  6. url = "https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node";
  7. ref = "refs/tags/${version}";
  8. };
  9. nativeBuildInputs = [
  10. pkgs.cmake
  11. pkgs.ninja
  12. pkgs.help2man
  13. pkgs.python3
  14. ];
  15. buildInputs = [
  16. pkgs.boost
  17. pkgs.libevent
  18. pkgs.db
  19. pkgs.gmp
  20. pkgs.openssl
  21. pkgs.miniupnpc
  22. pkgs.libnatpmp
  23. pkgs.zeromq
  24. pkgs.zlib
  25. ];
  26. cmakeFlags = [
  27. "-GNinja"
  28. "-DBUILD_BITCOIN_QT=OFF"
  29. "-DVERBOSE_CONFIGURE=ON"
  30. ];
  31. doCheck = false;
  32. postConfigure = ''
  33. chmod ug+x config/run_native_cmake.sh
  34. chmod ug+x src/secp256k1/build_native_gen_context.sh
  35. sed -e 's@/usr/bin/env python3@${pkgs.python3}/bin/python3@' -i ../cmake/utils/gen-ninja-deps.py
  36. sed -e 's@/usr/bin/env bash@${pkgs.bash}/bin/bash@' -i doc/man/gen-doc-man-footer.sh
  37. sed -e 's@/usr/bin/env bash@${pkgs.bash}/bin/bash@' -i doc/man/gen-doc-man.sh
  38. '';
  39. postInstall= ''
  40. rm -f $out/bin/*
  41. install -v --mode=755 src/bitcoind $out/bin/bitcoind-bchn
  42. install -v --mode=755 src/bitcoin-cli $out/bin/bitcoin-cli-bchn
  43. rm -f $out/share/man/man1/bitcoin-{tx,seeder}*
  44. mv $out/share/man/man1/bitcoind.1 $out/share/man/man1/bitcoind-bchn.1
  45. mv $out/share/man/man1/bitcoin-cli.1 $out/share/man/man1/bitcoin-cli-bchn.1
  46. '';
  47. }