2024-07-27 06:49:29 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch2, cmake, ninja, 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";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-26UmESotSWnQ21VbAYEappLpkEMyl0jiuCaezRYd/sE=";
|
2023-03-08 16:32:21 +00:00
|
|
|
};
|
|
|
|
trezor-common = fetchFromGitHub {
|
|
|
|
owner = "trezor";
|
|
|
|
repo = "trezor-common";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "bc28c316d05bf1e9ebfe3d7df1ab25831d98d168";
|
|
|
|
hash = "sha256-F1Hf1WwHqXMd/5OWrdkpomszACTozDuC7DQXW3p6248=";
|
2023-03-08 16:32:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "monero-cli";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.18.3.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "monero-project";
|
|
|
|
repo = "monero";
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-1LkKIrud317BEE+713t5wiJV6FcDlJdj4ypXPR0bKTs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
patches = [
|
2024-07-27 06:49:29 +00:00
|
|
|
# cmake: remove unused/extera cmake/FindMiniupnpc.cmake and only rely on external/miniupnpc
|
|
|
|
# https://github.com/monero-project/monero/pull/9366
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/monero-project/monero/commit/5074a543a49f7e23fb39b6462fd4c4c9741c3693.patch?full_index=1";
|
|
|
|
hash = "sha256-dS2hhEU6m2of0ULlsf+/tZMHUmq3vGGXJPGHvtnpQnY=";
|
|
|
|
})
|
|
|
|
|
|
|
|
# cmake: add different parameters to add_monero_library.
|
|
|
|
# https://github.com/monero-project/monero/pull/9367
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/monero-project/monero/commit/b91ead90254ac6d6daf908f689c38e372a44c615.patch?full_index=1";
|
|
|
|
hash = "sha256-DL2YqkvEONbeEDqLOAo2eSF5JF5gOzKcLKeNlUXBY1w=";
|
|
|
|
})
|
|
|
|
|
|
|
|
# external: update miniupnpc to 2.2.8
|
|
|
|
# https://github.com/monero-project/monero/pull/9367
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/monero-project/monero/commit/d81da086ec5088a04b3f7b34831e72910300e2f7.patch?full_index=1";
|
|
|
|
hash = "sha256-ZJGiDMk5DMmEXwzoUYPC+DIoebluFh54kMQtQU78ckI=";
|
|
|
|
excludes = [ "external/miniupnp" ];
|
|
|
|
})
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
./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
|
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja 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 = [
|
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 ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "monero-wallet-cli";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|