nixpkgs-suyu/pkgs/applications/blockchains/elements/default.nix

83 lines
2.2 KiB
Nix
Raw Normal View History

2021-07-16 11:32:48 +02:00
{ lib
, stdenv
, fetchurl
, autoreconfHook
, pkg-config
, util-linux
, hexdump
, wrapQtAppsHook ? null
, boost
, libevent
, miniupnpc
, zeromq
, zlib
, db48
, sqlite
, qrencode
, qtbase ? null
, qttools ? null
, python3
, withGui
, withWallet ? true
}:
with lib;
stdenv.mkDerivation rec {
pname = if withGui then "elements" else "elementsd";
2021-10-25 23:09:52 +02:00
version = "0.21.0";
2021-07-16 11:32:48 +02:00
src = fetchurl {
url = "https://github.com/ElementsProject/elements/archive/elements-${version}.tar.gz";
2021-10-25 23:09:52 +02:00
sha256 = "0d9mcb0nw9qqhv0jhpddi9i4iry3w7b5jifsl5kpcw82qrkvgfgj";
2021-07-16 11:32:48 +02:00
};
nativeBuildInputs =
[ autoreconfHook pkg-config ]
++ optionals stdenv.isLinux [ util-linux ]
++ optionals stdenv.isDarwin [ hexdump ]
++ optionals withGui [ wrapQtAppsHook ];
2021-10-25 23:09:52 +02:00
buildInputs = [ boost libevent miniupnpc zeromq zlib ]
2021-07-16 11:32:48 +02:00
++ 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;
};
}