2024-07-27 06:49:29 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, ninja, pkg-config
|
2024-06-05 15:53:02 +00:00
|
|
|
, boost, miniupnpc, openssl, unbound
|
2022-05-18 14:49:53 +00:00
|
|
|
, zeromq, pcsclite, readline, libsodium, hidapi
|
2024-06-05 15:53:02 +00:00
|
|
|
, randomx, rapidjson, easyloggingpp
|
2022-05-18 14:49:53 +00:00
|
|
|
, CoreData, IOKit, PCSC
|
|
|
|
, trezorSupport ? true, libusb1, protobuf, python3
|
2024-07-27 06:49:29 +00:00
|
|
|
, monero-cli
|
2022-05-18 14:49:53 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "haven-cli";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "4.0.2";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "haven-protocol-org";
|
|
|
|
repo = "haven-main";
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-XjRxpUW7NC12T5G7fol4avWLJDOOawxJbAHOp5eZ0Fk=";
|
2022-05-18 14:49:53 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit (monero-cli) patches;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# remove vendored libraries
|
2024-06-05 15:53:02 +00:00
|
|
|
rm -r external/{miniupnp,randomx,rapidjson}
|
2022-05-18 14:49:53 +00:00
|
|
|
# export patched source for haven-gui
|
|
|
|
cp -r . $source
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja pkg-config ];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2024-06-05 15:53:02 +00:00
|
|
|
boost miniupnpc openssl unbound
|
2022-05-18 14:49:53 +00:00
|
|
|
zeromq pcsclite readline
|
|
|
|
libsodium hidapi randomx rapidjson
|
2024-06-05 15:53:02 +00:00
|
|
|
protobuf readline easyloggingpp
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [ IOKit CoreData PCSC ]
|
2022-05-18 14:49:53 +00:00
|
|
|
++ lib.optionals trezorSupport [ libusb1 protobuf python3 ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_GUI_DEPS=ON"
|
|
|
|
"-DReadline_ROOT_DIR=${readline.dev}"
|
|
|
|
"-DReadline_INCLUDE_DIR=${readline.dev}/include/readline"
|
|
|
|
"-DRandomX_ROOT_DIR=${randomx}"
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF"
|
|
|
|
++ lib.optional (!trezorSupport) "-DUSE_DEVICE_TREZOR=OFF";
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "source" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-05 15:53:02 +00:00
|
|
|
description = "Haven Protocol is the world's only network of private stable asset";
|
|
|
|
homepage = "https://havenprotocol.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
badPlatforms = [ "x86_64-darwin" ];
|
|
|
|
maintainers = with maintainers; [ kim0 ];
|
|
|
|
mainProgram = "haven-wallet-cli";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
}
|