9 , autoSignDarwinBinariesHook
10 , wrapQtAppsHook ? null
26 stdenv.mkDerivation rec {
27 pname = if withGui then "bitcoin-knots" else "bitcoind-knots";
28 version = "26.1.knots20240325";
31 url = "https://bitcoinknots.org/files/26.x/${version}/bitcoin-${version}.tar.gz";
32 hash = "sha256-PqpePDna2gpCzF2K43N4h6cV5Y9w/e5ZcUvaNEaFaIk=";
36 # upnp: add compatibility for miniupnpc 2.2.8
38 url = "https://github.com/bitcoinknots/bitcoin/commit/643014424359a4783cf9c73bee3346ac2f04e713.patch?full_index=1";
39 hash = "sha256-FdLoNH3+ZZTbqrwRvhbAeJuGz4SgnIvoWUBzRxjfzs8=";
44 [ autoreconfHook pkg-config ]
45 ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ]
46 ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ]
47 ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ autoSignDarwinBinariesHook ]
48 ++ lib.optionals withGui [ wrapQtAppsHook ];
50 buildInputs = [ boost libevent miniupnpc zeromq zlib ]
51 ++ lib.optionals withWallet [ sqlite ]
52 ++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ]
53 ++ lib.optionals withGui [ qrencode qtbase qttools ];
56 "--with-boost-libdir=${boost.out}/lib"
58 ] ++ lib.optionals (!doCheck) [
61 ] ++ lib.optionals (!withWallet) [
63 ] ++ lib.optionals withGui [
65 "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
68 nativeCheckInputs = [ python3 ];
73 [ "LC_ALL=en_US.UTF-8" ]
74 # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
75 # See also https://github.com/NixOS/nixpkgs/issues/24256
76 ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
78 enableParallelBuilding = true;
81 description = "Derivative of Bitcoin Core with a collection of improvements";
82 homepage = "https://bitcoinknots.org/";
83 changelog = "https://github.com/bitcoinknots/bitcoin/blob/v${version}/doc/release-notes.md";
84 maintainers = with maintainers; [ prusnak mmahut ];
85 license = licenses.mit;
86 platforms = platforms.unix;