2022-10-21 18:38:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, 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
|
|
|
}:
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
let
|
|
|
|
# submodules
|
|
|
|
supercop = fetchFromGitHub {
|
|
|
|
owner = "monero-project";
|
|
|
|
repo = "supercop";
|
|
|
|
rev = "633500ad8c8759995049ccd022107d1fa8a1bbc9";
|
|
|
|
sha256 = "26UmESotSWnQ21VbAYEappLpkEMyl0jiuCaezRYd/sE=";
|
|
|
|
};
|
|
|
|
trezor-common = fetchFromGitHub {
|
|
|
|
owner = "trezor";
|
|
|
|
repo = "trezor-common";
|
|
|
|
rev = "bff7fdfe436c727982cc553bdfb29a9021b423b0";
|
|
|
|
sha256 = "VNypeEz9AV0ts8X3vINwYMOgO8VpNmyUPC4iY3OOuZI=";
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "monero-cli";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "0.18.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "monero-project";
|
|
|
|
repo = "monero";
|
|
|
|
rev = "v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
sha256 = "6VI5D3vP6NKdrEE5qOpKnv1wr6AWriixdOxkAa8HaCQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
patches = [
|
|
|
|
./use-system-libraries.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-03-08 16:32:21 +00:00
|
|
|
# manually install submodules
|
|
|
|
rmdir external/{supercop,trezor-common}
|
|
|
|
ln -sf ${supercop} external/supercop
|
|
|
|
ln -sf ${trezor-common} external/trezor-common
|
2020-10-11 12:50:04 +00:00
|
|
|
# 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
|
|
|
};
|
|
|
|
}
|