2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2020-06-15 15:56:04 +00:00
|
|
|
, autoreconfHook
|
2021-12-06 16:07:01 +00:00
|
|
|
, pkg-config
|
|
|
|
, util-linux
|
|
|
|
, hexdump
|
|
|
|
, autoSignDarwinBinariesHook
|
|
|
|
, wrapQtAppsHook ? null
|
2020-06-15 15:56:04 +00:00
|
|
|
, boost
|
|
|
|
, libevent
|
2021-12-06 16:07:01 +00:00
|
|
|
, miniupnpc
|
|
|
|
, zeromq
|
|
|
|
, zlib
|
|
|
|
, db48
|
|
|
|
, sqlite
|
|
|
|
, qrencode
|
|
|
|
, qtbase ? null
|
|
|
|
, qttools ? null
|
|
|
|
, python3
|
|
|
|
, nixosTests
|
|
|
|
, withGui
|
|
|
|
, withWallet ? true
|
2020-06-15 15:56:04 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
with lib;
|
2020-06-15 15:56:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = if withGui then "bitcoin-knots" else "bitcoind-knots";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "23.0.knots20220529";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-10-30 15:09:59 +00:00
|
|
|
url = "https://bitcoinknots.org/files/23.x/${version}/bitcoin-${version}.tar.gz";
|
|
|
|
sha256 = "0c6l4bvj4ck8gp5vm4dla3l32swsp6ijk12fyf330wgry4mhqxyi";
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
[ autoreconfHook pkg-config ]
|
|
|
|
++ optionals stdenv.isLinux [ util-linux ]
|
|
|
|
++ optionals stdenv.isDarwin [ hexdump ]
|
|
|
|
++ optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
|
|
|
|
++ optionals withGui [ wrapQtAppsHook ];
|
|
|
|
|
|
|
|
buildInputs = [ boost libevent miniupnpc zeromq zlib ]
|
|
|
|
++ optionals withWallet [ db48 sqlite ]
|
|
|
|
++ optionals withGui [ qrencode qtbase qttools ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-boost-libdir=${boost.out}/lib"
|
|
|
|
"--disable-bench"
|
|
|
|
] ++ optionals (!doCheck) [
|
|
|
|
"--disable-tests"
|
|
|
|
"--disable-gui-tests"
|
|
|
|
] ++ optionals (!withWallet) [
|
|
|
|
"--disable-wallet"
|
|
|
|
] ++ optionals withGui [
|
|
|
|
"--with-gui=qt5"
|
|
|
|
"--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [ python3 ];
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkFlags =
|
|
|
|
[ "LC_ALL=en_US.UTF-8" ]
|
|
|
|
# QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
|
|
|
|
# See also https://github.com/NixOS/nixpkgs/issues/24256
|
|
|
|
++ optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.bitcoind-knots;
|
|
|
|
};
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
meta = {
|
|
|
|
description = "A derivative of Bitcoin Core with a collection of improvements";
|
2020-06-15 15:56:04 +00:00
|
|
|
homepage = "https://bitcoinknots.org/";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ prusnak mmahut ];
|
2020-06-15 15:56:04 +00:00
|
|
|
license = licenses.mit;
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = platforms.unix;
|
2020-06-15 15:56:04 +00:00
|
|
|
};
|
|
|
|
}
|