Skip to content

Instantly share code, notes, and snippets.

@delta1
Created March 28, 2023 14:06
Show Gist options
  • Save delta1/c783fa79f75ea7a874b434c1cba71108 to your computer and use it in GitHub Desktop.
Save delta1/c783fa79f75ea7a874b434c1cba71108 to your computer and use it in GitHub Desktop.
{ stdenv, fetchurl, pkgconfig, autoreconfHook, db48, boost, zeromq
, zlib, miniupnpc, qtbase ? null, qttools ? null, utillinux, protobuf, python3, qrencode, libevent
, lib
, withBench ? false
, withWallet ? true
, doCheck ? true
, doFunctionalTests ? true
}:
with lib;
stdenv.mkDerivation rec{
name = "elements-" + version;
version = "0.18.0";
src = sourceFilesBySuffices ./. [ ".ac" ".am" ".m4" ".in" ".include" ".h" ".hpp" ".c" ".cc" ".cpp" ".inc" ".py" ".json" ".raw" ".sh" ".1" ".hex" ".csv" ".html" "Makefile" ];
# src = cleanSource (cleanSourceWith { filter = name: type: let baseName = baseNameOf (toString name); in
# !(lib.hasSuffix ".cache" baseName || lib.hasSuffix ".Po" baseName); src = ./.;});
nativeBuildInputs = [ pkgconfig autoreconfHook ]
++ optionals doCheck [ python3 ];
buildInputs = [ db48 boost zlib zeromq
miniupnpc protobuf libevent]
++ optionals stdenv.isLinux [ utillinux ];
configureFlags = [ "--with-boost-libdir=${boost.out}/lib"
] ++ optionals (!withBench) [
"--disable-bench"
] ++ optionals (!withWallet) [
"--disable-wallet"
] ++ optionals (!doCheck) [
"--disable-tests"
"--disable-gui-tests"
];
inherit doCheck;
checkFlags = [ "LC_ALL=C.UTF-8" ];
testRunnerFlags = [ ]; # ++ optionals enableParallelBuilding [ "-j=$NIX_BUILD_CORES" ];
postCheck = if (doCheck && doFunctionalTests)
then ''
patchShebangs test/functional
(cd test/functional && python3 test_runner.py $testRunnerFlags)
''
else "";
makeFlags = [ "VERBOSE=true" ];
enableParallelBuilding = true;
meta = {
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;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment