kanidm: 1.4.5 -> 1.4.6 (#376266)
[NixPkgs.git] / pkgs / applications / blockchains / bitcoin-knots / default.nix
blob984ba370893bcea19ace4d68b72e9a11ecf9d017
2   lib,
3   stdenv,
4   fetchurl,
5   fetchpatch2,
6   autoreconfHook,
7   pkg-config,
8   util-linux,
9   hexdump,
10   autoSignDarwinBinariesHook,
11   wrapQtAppsHook ? null,
12   boost,
13   libevent,
14   miniupnpc,
15   zeromq,
16   zlib,
17   db48,
18   sqlite,
19   qrencode,
20   qtbase ? null,
21   qttools ? null,
22   python3,
23   withGui,
24   withWallet ? true,
27 stdenv.mkDerivation rec {
28   pname = if withGui then "bitcoin-knots" else "bitcoind-knots";
29   version = "26.1.knots20240325";
31   src = fetchurl {
32     url = "https://bitcoinknots.org/files/26.x/${version}/bitcoin-${version}.tar.gz";
33     hash = "sha256-PqpePDna2gpCzF2K43N4h6cV5Y9w/e5ZcUvaNEaFaIk=";
34   };
36   patches = [
37     # upnp: add compatibility for miniupnpc 2.2.8
38     (fetchpatch2 {
39       url = "https://github.com/bitcoinknots/bitcoin/commit/643014424359a4783cf9c73bee3346ac2f04e713.patch?full_index=1";
40       hash = "sha256-FdLoNH3+ZZTbqrwRvhbAeJuGz4SgnIvoWUBzRxjfzs8=";
41     })
42   ];
44   nativeBuildInputs =
45     [
46       autoreconfHook
47       pkg-config
48     ]
49     ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ]
50     ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ]
51     ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
52       autoSignDarwinBinariesHook
53     ]
54     ++ lib.optionals withGui [ wrapQtAppsHook ];
56   buildInputs =
57     [
58       boost
59       libevent
60       miniupnpc
61       zeromq
62       zlib
63     ]
64     ++ lib.optionals withWallet [ sqlite ]
65     ++ lib.optionals (withWallet && !stdenv.hostPlatform.isDarwin) [ db48 ]
66     ++ lib.optionals withGui [
67       qrencode
68       qtbase
69       qttools
70     ];
72   configureFlags =
73     [
74       "--with-boost-libdir=${boost.out}/lib"
75       "--disable-bench"
76     ]
77     ++ lib.optionals (!doCheck) [
78       "--disable-tests"
79       "--disable-gui-tests"
80     ]
81     ++ lib.optionals (!withWallet) [
82       "--disable-wallet"
83     ]
84     ++ lib.optionals withGui [
85       "--with-gui=qt5"
86       "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
87     ];
89   nativeCheckInputs = [ python3 ];
91   doCheck = true;
93   checkFlags =
94     [ "LC_ALL=en_US.UTF-8" ]
95     # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
96     # See also https://github.com/NixOS/nixpkgs/issues/24256
97     ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
99   enableParallelBuilding = true;
101   meta = with lib; {
102     description = "Derivative of Bitcoin Core with a collection of improvements";
103     homepage = "https://bitcoinknots.org/";
104     changelog = "https://github.com/bitcoinknots/bitcoin/blob/v${version}/doc/release-notes.md";
105     maintainers = with maintainers; [
106       prusnak
107       mmahut
108     ];
109     license = licenses.mit;
110     platforms = platforms.unix;
111   };