2019-10-02 02:23:06 -07:00
|
|
|
{ stdenv, fetchurl, pkgconfig, autoreconfHook, openssl, db48, boost, zeromq, rapidcheck
|
|
|
|
, zlib, miniupnpc, qtbase ? null, qttools ? null, wrapQtAppsHook ? null, utillinux, protobuf, python3, qrencode, libevent
|
|
|
|
, withGui }:
|
2019-08-01 08:05:07 -07:00
|
|
|
|
|
|
|
with stdenv.lib;
|
2021-02-01 13:53:02 -08:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "elements${optionalString (!withGui) "d"}";
|
2020-10-16 06:41:50 -07:00
|
|
|
version = "0.18.1.9";
|
2019-08-01 08:05:07 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-01 13:53:02 -08:00
|
|
|
url = "https://github.com/ElementsProject/elements/archive/elements-${version}.tar.gz";
|
|
|
|
# Use ./get-sha256.sh to fetch latest (verified) sha256
|
2020-10-16 06:41:50 -07:00
|
|
|
sha256 = "c6f1b040a896a1aaa7340f5cd48e119c84fef88df5d4c17d5ad5c13783f5b6c7";
|
2021-02-01 13:53:02 -08:00
|
|
|
};
|
2019-08-01 08:05:07 -07:00
|
|
|
|
2019-10-02 02:23:06 -07:00
|
|
|
nativeBuildInputs =
|
|
|
|
[ pkgconfig autoreconfHook ]
|
|
|
|
++ optional withGui wrapQtAppsHook;
|
2021-02-01 13:53:02 -08:00
|
|
|
|
2019-08-01 08:05:07 -07:00
|
|
|
buildInputs = [ openssl db48 boost zlib zeromq
|
2019-10-02 02:23:06 -07:00
|
|
|
miniupnpc protobuf libevent]
|
|
|
|
++ optionals stdenv.isLinux [ utillinux ]
|
|
|
|
++ optionals withGui [ qtbase qttools qrencode ];
|
2019-08-01 08:05:07 -07:00
|
|
|
|
|
|
|
configureFlags = [ "--with-boost-libdir=${boost.out}/lib"
|
|
|
|
"--disable-bench"
|
|
|
|
] ++ optionals (!doCheck) [
|
|
|
|
"--disable-tests"
|
|
|
|
"--disable-gui-tests"
|
2021-02-01 13:53:02 -08:00
|
|
|
] ++ optionals withGui [
|
|
|
|
"--with-gui=qt5"
|
|
|
|
"--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
|
|
|
|
];
|
2019-10-02 02:23:06 -07:00
|
|
|
|
|
|
|
checkInputs = [ rapidcheck python3 ];
|
|
|
|
|
2019-08-01 08:05:07 -07:00
|
|
|
doCheck = true;
|
|
|
|
|
2019-10-02 02:23:06 -07:00
|
|
|
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}";
|
|
|
|
|
2019-08-01 08:05:07 -07:00
|
|
|
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 = http://www.github.com/ElementsProject/elements;
|
|
|
|
license = licenses.mit;
|
|
|
|
# elements needs hexdump to build, which doesn't seem to build on darwin at the moment.
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|