nixpkgs/pkgs/applications/blockchains/monero/default.nix

69 lines
1.7 KiB
Nix
Raw Normal View History

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