From 71175d0b540d049fd7279770ff6c3b5d91b0bf52 Mon Sep 17 00:00:00 2001 From: 0xb10c Date: Tue, 18 Mar 2025 19:24:27 +0100 Subject: [PATCH] bitcoind: 28.1 -> 29.0 With cmake, $PWD ends up being the "build" directory and to access the source dir (e.g. to access the shell completions), we need to use the parent dir. The cmake flags were mapped from the autotools configure flags as per https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Autotools-to-CMake-Options-Mapping The `miniupnpc` dependency has been dropped in Bitcoin Core v29.0. See https://github.com/bitcoin-core/bitcoin-devwiki/wiki/29.0-Release-Notes-draft#p2p-and-network-changes --- .../blockchains/bitcoin/default.nix | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/blockchains/bitcoin/default.nix b/pkgs/applications/blockchains/bitcoin/default.nix index f5c3683dcbc7..0e3e7dc21855 100644 --- a/pkgs/applications/blockchains/bitcoin/default.nix +++ b/pkgs/applications/blockchains/bitcoin/default.nix @@ -2,16 +2,13 @@ lib, stdenv, fetchurl, - autoreconfHook, + cmake, pkg-config, installShellFiles, - util-linux, - hexdump, autoSignDarwinBinariesHook, wrapQtAppsHook ? null, boost, libevent, - miniupnpc, zeromq, zlib, db48, @@ -35,24 +32,22 @@ let in stdenv.mkDerivation (finalAttrs: { pname = if withGui then "bitcoin" else "bitcoind"; - version = "28.1"; + version = "29.0"; src = fetchurl { urls = [ "https://bitcoincore.org/bin/bitcoin-core-${finalAttrs.version}/bitcoin-${finalAttrs.version}.tar.gz" ]; # hash retrieved from signed SHA256SUMS - sha256 = "c5ae2dd041c7f9d9b7c722490ba5a9d624f7e9a089c67090615e1ba4ad0883ba"; + sha256 = "882c782c34a3bf2eacd1fae5cdc58b35b869883512f197f7d6dc8f195decfdaa"; }; nativeBuildInputs = [ - autoreconfHook + cmake pkg-config installShellFiles ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ hexdump ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ autoSignDarwinBinariesHook ] @@ -62,7 +57,6 @@ stdenv.mkDerivation (finalAttrs: { [ boost libevent - miniupnpc zeromq zlib ] @@ -77,6 +71,7 @@ stdenv.mkDerivation (finalAttrs: { postInstall = '' + cd .. installShellCompletion --bash contrib/completions/bash/bitcoin-cli.bash installShellCompletion --bash contrib/completions/bash/bitcoind.bash installShellCompletion --bash contrib/completions/bash/bitcoin-tx.bash @@ -95,21 +90,20 @@ stdenv.mkDerivation (finalAttrs: { install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png ''; - configureFlags = + cmakeFlags = [ - "--with-boost-libdir=${boost.out}/lib" - "--disable-bench" + (lib.cmakeBool "BUILD_BENCH" false) ] ++ lib.optionals (!finalAttrs.doCheck) [ - "--disable-tests" - "--disable-gui-tests" + (lib.cmakeBool "BUILD_TESTS" false) + (lib.cmakeBool "BUILD_FUZZ_BINARY" false) + (lib.cmakeBool "BUILD_GUI_TESTS" false) ] ++ lib.optionals (!withWallet) [ - "--disable-wallet" + (lib.cmakeBool "ENABLE_WALLET" false) ] ++ lib.optionals withGui [ - "--with-gui=qt5" - "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" + (lib.cmakeBool "BUILD_GUI" true) ]; nativeCheckInputs = [ python3 ];