Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

82 linhas
3.0 KiB

  1. { stdenv, fetchurl, pkgconfig, autoreconfHook, openssl, db48, boost, zeromq, rapidcheck, hexdump
  2. , zlib, miniupnpc, qtbase ? null, qttools ? null, wrapQtAppsHook ? null, utillinux, python3, qrencode, libevent
  3. , withGui }:
  4. with stdenv.lib;
  5. let
  6. version = "0.19.1";
  7. majorMinorVersion = versions.majorMinor version;
  8. desktop = fetchurl {
  9. url = "https://raw.githubusercontent.com/bitcoin-core/packaging/${majorMinorVersion}/debian/bitcoin-qt.desktop";
  10. sha256 = "0cpna0nxcd1dw3nnzli36nf9zj28d2g9jf5y0zl9j18lvanvniha";
  11. };
  12. pixmap = fetchurl {
  13. url = "https://raw.githubusercontent.com/bitcoin/bitcoin/v${version}/share/pixmaps/bitcoin128.png";
  14. sha256 = "08p7j7dg50jlj783kkgdw037klmx0spqjikaprmbkzgcb620r25d";
  15. };
  16. in stdenv.mkDerivation rec {
  17. pname = if withGui then "bitcoin" else "bitcoind";
  18. inherit version;
  19. src = fetchurl {
  20. urls = [ "https://bitcoincore.org/bin/bitcoin-core-${version}/bitcoin-${version}.tar.gz"
  21. "https://bitcoin.org/bin/bitcoin-core-${version}/bitcoin-${version}.tar.gz"
  22. ];
  23. sha256 = "f2591d555b8e8c2e1bd780e40d53a91e165d8b3c7e0391ae2d24a0c0f23a7cc0";
  24. };
  25. nativeBuildInputs =
  26. [ pkgconfig autoreconfHook ]
  27. ++ optional stdenv.isDarwin hexdump
  28. ++ optional withGui wrapQtAppsHook;
  29. buildInputs = [ openssl db48 boost zlib zeromq
  30. miniupnpc libevent]
  31. ++ optionals stdenv.isLinux [ utillinux ]
  32. ++ optionals withGui [ qtbase qttools qrencode ];
  33. postInstall = optional withGui ''
  34. install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
  35. install -Dm644 ${pixmap} $out/share/pixmaps/bitcoin128.png
  36. '';
  37. configureFlags = [ "--with-boost-libdir=${boost.out}/lib"
  38. "--disable-bench"
  39. ] ++ optionals (!doCheck) [
  40. "--disable-tests"
  41. "--disable-gui-tests"
  42. ]
  43. ++ optionals withGui [ "--with-gui=qt5"
  44. "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
  45. ];
  46. checkInputs = [ rapidcheck python3 ];
  47. doCheck = true;
  48. checkFlags =
  49. [ "LC_ALL=C.UTF-8" ]
  50. # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
  51. # See also https://github.com/NixOS/nixpkgs/issues/24256
  52. ++ optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
  53. enableParallelBuilding = true;
  54. meta = {
  55. description = "Peer-to-peer electronic cash system";
  56. longDescription= ''
  57. Bitcoin is a free open source peer-to-peer electronic cash system that is
  58. completely decentralized, without the need for a central server or trusted
  59. parties. Users hold the crypto keys to their own money and transact directly
  60. with each other, with the help of a P2P network to check for double-spending.
  61. '';
  62. homepage = "https://bitcoin.org/";
  63. maintainers = with maintainers; [ roconnor AndersonTorres ];
  64. license = licenses.mit;
  65. platforms = platforms.unix;
  66. };
  67. }