biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / blockchains / bitcoin-knots / default.nix
blobace8329bb876b90809b87a9a6f80934806b155cf
1 { lib
2 , stdenv
3 , fetchurl
4 , autoreconfHook
5 , pkg-config
6 , util-linux
7 , hexdump
8 , autoSignDarwinBinariesHook
9 , wrapQtAppsHook ? null
10 , boost
11 , libevent
12 , miniupnpc
13 , zeromq
14 , zlib
15 , db48
16 , sqlite
17 , qrencode
18 , qtbase ? null
19 , qttools ? null
20 , python3
21 , nixosTests
22 , withGui
23 , withWallet ? true
26 stdenv.mkDerivation rec {
27   pname = if withGui then "bitcoin-knots" else "bitcoind-knots";
28   version = "25.1.knots20231115";
30   src = fetchurl {
31     url = "https://bitcoinknots.org/files/25.x/${version}/bitcoin-${version}.tar.gz";
32     sha256 = "b6251beee95cf6701c6ebc443b47fb0e99884880f2661397f964a8828add4002";
33   };
35   nativeBuildInputs =
36     [ autoreconfHook pkg-config ]
37     ++ lib.optionals stdenv.isLinux [ util-linux ]
38     ++ lib.optionals stdenv.isDarwin [ hexdump ]
39     ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
40     ++ lib.optionals withGui [ wrapQtAppsHook ];
42   buildInputs = [ boost libevent miniupnpc zeromq zlib ]
43     ++ lib.optionals withWallet [ db48 sqlite ]
44     ++ lib.optionals withGui [ qrencode qtbase qttools ];
46   configureFlags = [
47     "--with-boost-libdir=${boost.out}/lib"
48     "--disable-bench"
49   ] ++ lib.optionals (!doCheck) [
50     "--disable-tests"
51     "--disable-gui-tests"
52   ] ++ lib.optionals (!withWallet) [
53     "--disable-wallet"
54   ] ++ lib.optionals withGui [
55     "--with-gui=qt5"
56     "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
57   ];
59   nativeCheckInputs = [ python3 ];
61   doCheck = true;
63   checkFlags =
64     [ "LC_ALL=en_US.UTF-8" ]
65     # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
66     # See also https://github.com/NixOS/nixpkgs/issues/24256
67     ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
69   enableParallelBuilding = true;
71   meta = with lib; {
72     description = "A derivative of Bitcoin Core with a collection of improvements";
73     homepage = "https://bitcoinknots.org/";
74     maintainers = with maintainers; [ prusnak mmahut ];
75     license = licenses.mit;
76     platforms = platforms.unix;
77   };