2020-10-11 12:50:04 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, cmake, pkgconfig
|
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
|
2020-10-11 12:50:04 +00:00
|
|
|
, trezorSupport ? true
|
|
|
|
, libusb1 ? null
|
|
|
|
, protobuf ? null
|
|
|
|
, python3 ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
assert stdenv.isDarwin -> IOKit != null;
|
2020-10-11 12:50:04 +00:00
|
|
|
assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "monero";
|
2020-10-19 00:13:06 +00:00
|
|
|
version = "0.17.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "monero-project";
|
|
|
|
repo = "monero";
|
|
|
|
rev = "v${version}";
|
2020-10-19 00:13:06 +00:00
|
|
|
sha256 = "1cngniv7sndy8r0fcfgk737640k53q3kwd36g891p5igcb985qdw";
|
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
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
|
|
|
|
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
|
|
|
|
] ++ optionals stdenv.isDarwin [ IOKit CoreData PCSC ]
|
|
|
|
++ 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}"
|
|
|
|
] ++ optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF";
|
|
|
|
|
|
|
|
outputs = [ "out" "source" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Private, secure, untraceable currency";
|
|
|
|
homepage = "https://getmonero.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ ehmry rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|