bitcoin.nix 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {
  2. lib,
  3. stdenv,
  4. cmake,
  5. capnproto,
  6. pkg-config,
  7. darwin,
  8. boost,
  9. libevent,
  10. zeromq,
  11. zlib,
  12. sqlite,
  13. }:
  14. stdenv.mkDerivation (finalAttrs: {
  15. pname = "bitcoind";
  16. version = "30.0";
  17. src = fetchGit {
  18. url = "https://github.com/bitcoin/bitcoin.git";
  19. # url = /path/to/repo/bitcoin-30.0;
  20. ref = "refs/tags/v${finalAttrs.version}";
  21. shallow = true;
  22. };
  23. nativeBuildInputs = [
  24. cmake
  25. capnproto
  26. pkg-config
  27. ]
  28. ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
  29. darwin.autoSignDarwinBinariesHook
  30. ];
  31. buildInputs = [
  32. boost
  33. libevent
  34. zeromq
  35. zlib
  36. sqlite
  37. ];
  38. cmakeFlags = [
  39. (lib.cmakeBool "BUILD_BENCH" false)
  40. (lib.cmakeBool "WITH_ZMQ" true)
  41. (lib.cmakeBool "BUILD_TESTS" false)
  42. (lib.cmakeBool "BUILD_FUZZ_BINARY" false)
  43. ];
  44. NIX_LDFLAGS = lib.optionals (
  45. stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic
  46. ) "-levent_core";
  47. doCheck = false;
  48. enableParallelBuilding = true;
  49. __darwinAllowLocalNetworking = true;
  50. doInstallCheck = false;
  51. meta = {
  52. description = "Peer-to-peer electronic cash system";
  53. longDescription = ''
  54. Bitcoin is a free open source peer-to-peer electronic cash system that is
  55. completely decentralized, without the need for a central server or trusted
  56. parties. Users hold the crypto keys to their own money and transact directly
  57. with each other, with the help of a P2P network to check for double-spending.
  58. '';
  59. homepage = "https://bitcoin.org/en/";
  60. downloadPage = "https://bitcoincore.org/bin/bitcoin-core-${finalAttrs.version}/";
  61. changelog = "https://bitcoincore.org/en/releases/${finalAttrs.version}/";
  62. maintainers = with lib.maintainers; [
  63. prusnak
  64. roconnor
  65. ];
  66. license = lib.licenses.mit;
  67. platforms = lib.platforms.unix;
  68. };
  69. })