plebhash / nix-bitcoin-core-archive

An archive of Nix derivations for old bitcoin releases and custom forks.
GNU General Public License v3.0
4 stars 1 forks source link

Sharing my collection #1

Open 0xB10C opened 9 months ago

0xB10C commented 9 months ago

I just came across this and thought I share what I have locally. It takes a rev as input. Maybe this helps/inspires you.

{ stdenv
, fetchFromGitHub
, pkgconfig
, autoreconfHook
, boost
, libevent
, libsystemtap
, rev
}:

with stdenv.lib;

stdenv.mkDerivation rec {
  pname = "bitcoind-${rev}";
  name = "bitcoind-${rev}";

  src = fetchFromGitHub {
    owner = "bitcoin";
    repo = "bitcoin";
    inherit rev;
    sha256 = {
      "v23.0"     = "sha256-Wkme5fG0DVNXBTMc7erF4AnOPU/AQBS6U5x6vpUJ8zk=";
      "v24.0rc1"  = "sha256-blrrL7W/duN+1K1z+L+r9259vFq3CcngHX94AmEYz7c=";
      "v24.0rc3"  = "sha256-xXCailQ2ayWM5bwRlZvSfkUs+thIp8puRDCeTDq0ThM=";
      "v24.0rc4"  = "sha256-BnuG4l0a6C4Fdmd7ocGNWqRvdvMtQSDwpo/k6eky+SI=";
      "v25.0rc2"  = "sha256-/lYma1Sh7i5LxshDmkWwmhkFVX9+WBJBr4a/yBiSHsk=";
    }.${rev} or (builtins.trace "Bitcoin Core using dummy vendor SHA256" "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=");
  };

  nativeBuildInputs = [ pkgconfig autoreconfHook libsystemtap ];
  buildInputs = [ boost libevent libsystemtap ];
  configureFlags = [
    "--with-boost-libdir=${boost.out}/lib"
    "--disable-shared"
    "--disable-wallet"
    "--disable-bench"
    "--disable-tests"
  ];
  doCheck = false;
  enableParallelBuilding = true;

  postInstall = ''
    mv $out/bin/bitcoind $out/bin/bitcoind-${rev}
    mv $out/bin/bitcoin-tx $out/bin/bitcoin-tx-${rev}
    mv $out/bin/bitcoin-cli $out/bin/bitcoin-cli-${rev}
  '';
}
0xB10C commented 9 months ago

I've also been working on-and-off on https://github.com/0xB10C/bitcoind-gunix. My goal is to do a full dependencies-from-source build, similar to the current GUIX release builds, in Nix. Ideally, I can get close to the GUIX binary. I'm not sure if getting a hash-by-hash match is possible, though. See https://github.com/0xB10C/bitcoind-gunix/issues/1.

plebhash commented 7 months ago

thanks so much for this @0xB10C

here's a summary of where I am so far: