diff --git a/pkgs/tools/misc/libbitcoin/libbitcoin-client.nix b/pkgs/tools/misc/libbitcoin/libbitcoin-client.nix new file mode 100644 index 000000000000..1f45626855f5 --- /dev/null +++ b/pkgs/tools/misc/libbitcoin/libbitcoin-client.nix @@ -0,0 +1,36 @@ +{ stdenv, lib, fetchurl, pkgconfig, autoreconfHook +, boost, libsodium, czmqpp, libbitcoin }: + +let + pname = "libbitcoin-client"; + version = "2.2.0"; + +in stdenv.mkDerivation { + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://github.com/libbitcoin/libbitcoin-client/archive/v${version}.tar.gz"; + sha256 = "1g79hl6jmf5dam7vq19h4dgdj7gcn19fa7q78vn573mg2rdyal53"; + }; + + buildInputs = [ autoreconfHook pkgconfig ]; + + propagatedBuildInputs = [ libsodium czmqpp libbitcoin ]; + + configureFlags = [ + "--with-boost=${boost.dev}" + "--with-boost-libdir=${boost.out}/lib" + "--with-bash-completiondir=$out/share/bash-completion/completions" + ]; + + meta = with stdenv.lib; { + description = "Bitcoin client query library"; + homepage = https://github.com/libbitcoin/libbitcoin-client; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ chris-martin ]; + + # https://wiki.unsystem.net/en/index.php/Libbitcoin/License + # AGPL with an additional clause + license = licenses.agpl3; + }; +} diff --git a/pkgs/tools/misc/libbitcoin/libbitcoin-explorer.nix b/pkgs/tools/misc/libbitcoin/libbitcoin-explorer.nix new file mode 100644 index 000000000000..fbfa385fc7fc --- /dev/null +++ b/pkgs/tools/misc/libbitcoin/libbitcoin-explorer.nix @@ -0,0 +1,36 @@ +{ stdenv, lib, fetchurl, pkgconfig, autoreconfHook +, boost, libbitcoin-client }: + +let + pname = "libbitcoin-explorer"; + version = "2.2.0"; + +in stdenv.mkDerivation { + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://github.com/libbitcoin/libbitcoin-explorer/archive/v${version}.tar.gz"; + sha256 = "00123vw7rxk0ypdfzk0xwk8q55ll31000mkjqdzl915krsbkbfvp"; + }; + + buildInputs = [ autoreconfHook pkgconfig ]; + + propagatedBuildInputs = [ libbitcoin-client ]; + + configureFlags = [ + "--with-boost=${boost.dev}" + "--with-boost-libdir=${boost.out}/lib" + "--with-bash-completiondir=$out/share/bash-completion/completions" + ]; + + meta = with stdenv.lib; { + description = "Bitcoin command line tool"; + homepage = https://github.com/libbitcoin/libbitcoin-explorer; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ chris-martin ]; + + # https://wiki.unsystem.net/en/index.php/Libbitcoin/License + # AGPL with an additional clause + license = licenses.agpl3; + }; +} diff --git a/pkgs/tools/misc/libbitcoin/libbitcoin.nix b/pkgs/tools/misc/libbitcoin/libbitcoin.nix new file mode 100644 index 000000000000..61c462f7853f --- /dev/null +++ b/pkgs/tools/misc/libbitcoin/libbitcoin.nix @@ -0,0 +1,35 @@ +{ stdenv, lib, fetchurl, pkgconfig, autoreconfHook +, boost, libsodium, czmqpp, secp256k1 }: + +let + pname = "libbitcoin"; + version = "2.11.0"; + +in stdenv.mkDerivation { + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://github.com/libbitcoin/libbitcoin/archive/v${version}.tar.gz"; + sha256 = "1lpdjm13kgs4fbp579bwfvws8yf9mnr5dw3ph8zxg2gf110h85sy"; + }; + + buildInputs = [ autoreconfHook pkgconfig ]; + + propagatedBuildInputs = [ secp256k1 ]; + + configureFlags = [ + "--with-boost=${boost.dev}" + "--with-boost-libdir=${boost.out}/lib" + ]; + + meta = with stdenv.lib; { + description = "C++ library for building bitcoin applications"; + homepage = https://libbitcoin.org/; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ chris-martin ]; + + # https://wiki.unsystem.net/en/index.php/Libbitcoin/License + # AGPL with an additional clause + license = licenses.agpl3; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e5773c94bdbe..74b87a0d96fd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12337,6 +12337,14 @@ in bitcoin = altcoins.bitcoin; bitcoin-xt = altcoins.bitcoin-xt; + libbitcoin = callPackage ../tools/misc/libbitcoin/libbitcoin.nix { + secp256k1 = secp256k1.override { enableECDH = true; }; + }; + + libbitcoin-client = callPackage ../tools/misc/libbitcoin/libbitcoin-client.nix { }; + + libbitcoin-explorer = callPackage ../tools/misc/libbitcoin/libbitcoin-explorer.nix { }; + go-ethereum = self.altcoins.go-ethereum; ethabi = self.altcoins.ethabi;