Unverified Commit 71175d0b authored by 0xb10c's avatar 0xb10c
Browse files

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
parent 7df90d8a
Loading
Loading
Loading
Loading
+12 −18
Original line number Diff line number Diff line
@@ -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 ];