From 58c7f3149db499692a67acc26fa47390269b3bec Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 16 Jul 2021 11:32:48 +0200 Subject: [PATCH] elements: init at 0.18.1.12 --- pkgs/applications/blockchains/elements.nix | 86 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 + 2 files changed, 89 insertions(+) create mode 100644 pkgs/applications/blockchains/elements.nix diff --git a/pkgs/applications/blockchains/elements.nix b/pkgs/applications/blockchains/elements.nix new file mode 100644 index 000000000000..c44f2078dae3 --- /dev/null +++ b/pkgs/applications/blockchains/elements.nix @@ -0,0 +1,86 @@ +{ lib +, stdenv +, fetchurl +, autoreconfHook +, pkg-config +, util-linux +, hexdump +, wrapQtAppsHook ? null +, boost +, libevent +, miniupnpc +, zeromq +, zlib +, db48 +, sqlite +, qrencode +, qtbase ? null +, qttools ? null +, python3 +, openssl +, withGui +, withWallet ? true +}: + +with lib; +stdenv.mkDerivation rec { + pname = if withGui then "elements" else "elementsd"; + version = "0.18.1.12"; + + src = fetchurl { + url = "https://github.com/ElementsProject/elements/archive/elements-${version}.tar.gz"; + sha256 = "84a51013596b09c62913649ac90373622185f779446ee7e65b4b258a2876609f"; + }; + + nativeBuildInputs = + [ autoreconfHook pkg-config ] + ++ optionals stdenv.isLinux [ util-linux ] + ++ optionals stdenv.isDarwin [ hexdump ] + ++ optionals withGui [ wrapQtAppsHook ]; + + buildInputs = [ boost libevent miniupnpc zeromq zlib openssl ] + ++ 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 ]; + + doCheck = true; + + checkFlags = + [ "LC_ALL=C.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; + + meta = { + description = "Open Source implementation of advanced blockchain features extending the Bitcoin protocol"; + longDescription= '' + The Elements blockchain platform is a collection of feature experiments and extensions to the + Bitcoin protocol. This platform enables anyone to build their own businesses or networks + pegged to Bitcoin as a sidechain or run as a standalone blockchain with arbitrary asset + tokens. + ''; + homepage = "https://www.github.com/ElementsProject/elements"; + maintainers = with maintainers; [ prusnak ]; + license = licenses.mit; + platforms = platforms.unix; + # Qt GUI is currently broken in upstream + # No rule to make target 'qt/res/rendered_icons/about.png', needed by 'qt/qrc_bitcoin.cpp'. + broken = withGui; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 00d2c8f115e4..01284f66ba49 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28510,6 +28510,9 @@ in electrs = callPackage ../applications/blockchains/electrs.nix { }; + elements = libsForQt5.callPackage ../applications/blockchains/elements.nix { miniupnpc = miniupnpc_2; withGui = true; }; + elementsd = callPackage ../applications/blockchains/elements.nix { miniupnpc = miniupnpc_2; withGui = false; }; + ergo = callPackage ../applications/blockchains/ergo { }; exodus = callPackage ../applications/blockchains/exodus { };