monero: force use of system libraries

This commit is contained in:
rnhmjoj
2020-10-08 00:07:24 +02:00
parent e40ede1821
commit cc90474581
2 changed files with 89 additions and 4 deletions
@@ -2,11 +2,18 @@
, cmake, pkgconfig
, boost, miniupnpc, openssl, unbound
, zeromq, pcsclite, readline, libsodium, hidapi
, protobuf, randomx, rapidjson, libusb-compat-0_1
, randomx, rapidjson
, CoreData, IOKit, PCSC
, trezorSupport ? true
, libusb1 ? null
, protobuf ? null
, python3 ? null
}:
with stdenv.lib;
assert stdenv.isDarwin -> IOKit != null;
assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ];
stdenv.mkDerivation rec {
pname = "monero";
@@ -20,21 +27,30 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [ ./use-system-libraries.patch ];
postPatch = ''
# remove vendored libraries
rm -r external/{miniupnp,randomx,rapidjson,unbound}
'';
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [
boost miniupnpc openssl unbound
zeromq pcsclite readline
libsodium hidapi randomx rapidjson
protobuf libusb-compat-0_1
] ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit CoreData PCSC ];
protobuf
] ++ optionals stdenv.isDarwin [ IOKit CoreData PCSC ]
++ optionals trezorSupport [ libusb1 protobuf python3 ];
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DUSE_DEVICE_TREZOR=ON"
"-DBUILD_GUI_DEPS=ON"
"-DReadline_ROOT_DIR=${readline.dev}"
] ++ stdenv.lib.optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF";
"-DRandomX_ROOT_DIR=${randomx}"
] ++ optional stdenv.isDarwin "-DBoost_USE_MULTITHREADED=OFF";
meta = with stdenv.lib; {
description = "Private, secure, untraceable currency";