2020-03-22 03:35:31 +01:00
|
|
|
{ stdenv, wrapQtAppsHook, makeDesktopItem
|
2020-10-06 21:14:52 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake, qttools, pkgconfig
|
2020-03-22 03:35:31 +01:00
|
|
|
, qtbase, qtdeclarative, qtgraphicaleffects
|
|
|
|
, qtmultimedia, qtxmlpatterns
|
|
|
|
, qtquickcontrols, qtquickcontrols2
|
2020-10-06 21:14:52 +02:00
|
|
|
, monero, miniupnpc, unbound, readline
|
|
|
|
, boost, libunwind, libsodium, pcsclite
|
|
|
|
, randomx, zeromq, libgcrypt, libgpgerror
|
|
|
|
, hidapi, rapidjson
|
|
|
|
, trezorSupport ? true
|
|
|
|
, libusb1 ? null
|
|
|
|
, protobuf ? null
|
|
|
|
, python3 ? null
|
2018-01-27 00:07:07 +01:00
|
|
|
}:
|
|
|
|
|
2019-11-10 15:46:49 +01:00
|
|
|
with stdenv.lib;
|
2018-01-27 00:07:07 +01:00
|
|
|
|
2020-10-06 21:14:52 +02:00
|
|
|
assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ];
|
|
|
|
|
2019-11-10 15:46:49 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-31 01:39:25 +02:00
|
|
|
pname = "monero-gui";
|
2020-10-05 23:12:18 +02:00
|
|
|
version = "0.17.0.1";
|
2018-01-27 00:07:07 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "monero-project";
|
|
|
|
repo = "monero-gui";
|
2018-04-03 22:35:44 +02:00
|
|
|
rev = "v${version}";
|
2020-10-05 23:12:18 +02:00
|
|
|
sha256 = "1i9a3ampppyzsl4sllbqlr3w43sjpb3fdfxhb1j4n49p8g0jzmf3";
|
2018-01-27 00:07:07 +01:00
|
|
|
};
|
|
|
|
|
2020-10-06 21:14:52 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake pkgconfig wrapQtAppsHook
|
|
|
|
(getDev qttools)
|
|
|
|
];
|
2018-01-27 00:07:07 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-03-22 03:35:31 +01:00
|
|
|
qtbase qtdeclarative qtgraphicaleffects
|
|
|
|
qtmultimedia qtquickcontrols qtquickcontrols2
|
|
|
|
qtxmlpatterns
|
2020-10-06 21:14:52 +02:00
|
|
|
monero miniupnpc unbound readline
|
|
|
|
randomx libgcrypt libgpgerror
|
|
|
|
boost libunwind libsodium pcsclite
|
|
|
|
zeromq hidapi rapidjson
|
|
|
|
] ++ optionals trezorSupport [ libusb1 protobuf python3 ];
|
2018-01-27 00:07:07 +01:00
|
|
|
|
2020-10-06 21:14:52 +02:00
|
|
|
postUnpack = ''
|
|
|
|
# copy monero sources here
|
|
|
|
# (needs to be writable)
|
|
|
|
cp -r ${monero.source}/* source/monero
|
|
|
|
chmod -R +w source/monero
|
|
|
|
'';
|
2019-11-03 13:34:06 +01:00
|
|
|
|
2019-08-31 01:39:25 +02:00
|
|
|
patches = [ ./move-log-file.patch ];
|
2018-01-27 00:07:07 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
2020-10-06 21:14:52 +02:00
|
|
|
# set monero-gui version
|
|
|
|
substituteInPlace src/version.js.in \
|
|
|
|
--replace '@VERSION_TAG_GUI@' '${version}'
|
|
|
|
substituteInPlace monero/src/version.cpp.in \
|
|
|
|
--replace '@VERSION_IS_RELEASE@' 'true'
|
|
|
|
|
|
|
|
# use monerod from the monero package
|
2018-01-27 00:07:07 +01:00
|
|
|
substituteInPlace src/daemon/DaemonManager.cpp \
|
|
|
|
--replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
|
|
|
|
|
2020-10-06 21:14:52 +02:00
|
|
|
# only build external deps, *not* the full monero
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace 'add_subdirectory(monero)' \
|
|
|
|
'add_subdirectory(monero EXCLUDE_FROM_ALL)'
|
2018-01-27 00:07:07 +01:00
|
|
|
'';
|
|
|
|
|
2020-10-06 21:14:52 +02:00
|
|
|
cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$out/bin" ];
|
|
|
|
|
2018-01-27 00:07:07 +01:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "monero-wallet-gui";
|
|
|
|
exec = "monero-wallet-gui";
|
|
|
|
icon = "monero";
|
2018-12-08 05:56:26 +01:00
|
|
|
desktopName = "Monero";
|
2018-01-27 00:07:07 +01:00
|
|
|
genericName = "Wallet";
|
2020-06-25 04:18:37 +02:00
|
|
|
categories = "Network;Utility;";
|
2018-01-27 00:07:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# install desktop entry
|
2020-10-06 21:14:52 +02:00
|
|
|
install -Dm644 -t $out/share/applications \
|
|
|
|
${desktopItem}/share/applications/*
|
2018-01-27 00:07:07 +01:00
|
|
|
|
|
|
|
# install icons
|
|
|
|
for n in 16 24 32 48 64 96 128 256; do
|
|
|
|
size=$n"x"$n
|
2020-10-06 21:14:52 +02:00
|
|
|
install -Dm644 \
|
|
|
|
-t $out/share/icons/hicolor/$size/apps/monero.png \
|
|
|
|
$src/images/appicons/$size.png
|
2018-01-27 00:07:07 +01:00
|
|
|
done;
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2019-07-04 17:16:10 +02:00
|
|
|
description = "Private, secure, untraceable currency";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://getmonero.org/";
|
2019-07-04 17:16:10 +02:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
badPlatforms = platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
2018-01-27 00:07:07 +01:00
|
|
|
};
|
|
|
|
}
|