2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
2021-02-05 17:12:51 +00:00
|
|
|
, cmake, pkg-config
|
2020-06-15 15:56:04 +00:00
|
|
|
, boost, miniupnpc, openssl, unbound
|
2020-04-24 23:36:52 +00:00
|
|
|
, zeromq, pcsclite, readline, libsodium, hidapi
|
2020-10-11 12:50:04 +00:00
|
|
|
, randomx, rapidjson
|
2020-04-24 23:36:52 +00:00
|
|
|
, CoreData, IOKit, PCSC
|
2021-07-16 19:40:57 +00:00
|
|
|
, trezorSupport ? true, libusb1, protobuf, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "monero-cli";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "0.17.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "monero-project";
|
|
|
|
repo = "monero";
|
|
|
|
rev = "v${version}";
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "1spsf7m3x4psp9s7mivr6x4886jnbq4i8ll2dl8bv5bsdhcd3pjm";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
patches = [
|
|
|
|
./use-system-libraries.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# remove vendored libraries
|
|
|
|
rm -r external/{miniupnp,randomx,rapidjson,unbound}
|
|
|
|
# export patched source for monero-gui
|
|
|
|
cp -r . $source
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost miniupnpc openssl unbound
|
2020-06-15 15:56:04 +00:00
|
|
|
zeromq pcsclite readline
|
2020-04-24 23:36:52 +00:00
|
|
|
libsodium hidapi randomx rapidjson
|
2020-10-11 12:50:04 +00:00
|
|
|
protobuf
|
2021-07-16 19:40:57 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ IOKit CoreData PCSC ]
|
|
|
|
++ lib.optionals trezorSupport [ libusb1 protobuf python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2020-06-15 15:56:04 +00:00
|
|
|
"-DUSE_DEVICE_TREZOR=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DBUILD_GUI_DEPS=ON"
|
|
|
|
"-DReadline_ROOT_DIR=${readline.dev}"
|
2020-10-11 12:50:04 +00:00
|
|
|
"-DRandomX_ROOT_DIR=${randomx}"
|
2021-07-16 19:40:57 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF";
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "source" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Private, secure, untraceable currency";
|
|
|
|
homepage = "https://getmonero.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
2021-03-23 19:22:30 +00:00
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|