2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch
|
2021-01-19 06:50:56 +00:00
|
|
|
, cmake, pkg-config
|
2020-06-18 21:41:04 +00:00
|
|
|
, boost, miniupnpc, openssl, unbound
|
2018-12-09 14:48:55 +00:00
|
|
|
, zeromq, pcsclite, readline, libsodium, hidapi
|
2020-10-07 15:32:44 +00:00
|
|
|
, randomx, rapidjson
|
2018-04-04 19:33:45 +00:00
|
|
|
, CoreData, IOKit, PCSC
|
2021-07-15 22:13:16 +00:00
|
|
|
, trezorSupport ? true, libusb1, protobuf, python3
|
2018-01-26 22:17:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "monero";
|
2021-09-09 00:11:49 +00:00
|
|
|
version = "0.17.2.3";
|
2019-11-09 17:47:33 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "monero-project";
|
|
|
|
repo = "monero";
|
|
|
|
rev = "v${version}";
|
2021-09-09 00:11:49 +00:00
|
|
|
sha256 = "0nax991fshfh51grhh2ryfrwwws35k16gzl1l3niva28zff2xmq6";
|
2019-11-09 17:47:33 +00:00
|
|
|
fetchSubmodules = true;
|
2018-01-26 22:17:38 +00:00
|
|
|
};
|
|
|
|
|
2020-10-07 23:12:31 +00:00
|
|
|
patches = [
|
|
|
|
./use-system-libraries.patch
|
|
|
|
];
|
2020-10-07 15:32:44 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# remove vendored libraries
|
|
|
|
rm -r external/{miniupnp,randomx,rapidjson,unbound}
|
2020-10-07 22:03:11 +00:00
|
|
|
# export patched source for monero-gui
|
|
|
|
cp -r . $source
|
2020-10-07 15:32:44 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2018-01-26 22:17:38 +00:00
|
|
|
|
2018-03-31 02:07:28 +00:00
|
|
|
buildInputs = [
|
|
|
|
boost miniupnpc openssl unbound
|
2020-06-18 21:41:04 +00:00
|
|
|
zeromq pcsclite readline
|
2019-11-10 14:44:56 +00:00
|
|
|
libsodium hidapi randomx rapidjson
|
2020-10-07 15:32:44 +00:00
|
|
|
protobuf
|
2021-07-15 22:13:16 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ IOKit CoreData PCSC ]
|
|
|
|
++ lib.optionals trezorSupport [ libusb1 protobuf python3 ];
|
2018-01-26 22:17:38 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
2020-06-18 21:41:04 +00:00
|
|
|
"-DUSE_DEVICE_TREZOR=ON"
|
2018-01-26 22:17:38 +00:00
|
|
|
"-DBUILD_GUI_DEPS=ON"
|
2018-03-28 04:53:07 +00:00
|
|
|
"-DReadline_ROOT_DIR=${readline.dev}"
|
2020-10-07 15:32:44 +00:00
|
|
|
"-DRandomX_ROOT_DIR=${randomx}"
|
2021-07-15 22:13:16 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF";
|
2018-01-26 22:17:38 +00:00
|
|
|
|
2020-10-07 22:03:11 +00:00
|
|
|
outputs = [ "out" "source" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-01-26 22:17:38 +00:00
|
|
|
description = "Private, secure, untraceable currency";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://getmonero.org/";
|
2018-01-26 22:17:38 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
2021-03-23 09:20:20 +00:00
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
2018-01-26 22:17:38 +00:00
|
|
|
};
|
|
|
|
}
|