2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, wrapQtAppsHook, makeDesktopItem
|
2020-10-11 12:50:04 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake, qttools, pkgconfig
|
2020-04-24 23:36:52 +00:00
|
|
|
, qtbase, qtdeclarative, qtgraphicaleffects
|
|
|
|
, qtmultimedia, qtxmlpatterns
|
|
|
|
, qtquickcontrols, qtquickcontrols2
|
2020-10-11 12:50:04 +00:00
|
|
|
, monero, miniupnpc, unbound, readline
|
|
|
|
, boost, libunwind, libsodium, pcsclite
|
|
|
|
, randomx, zeromq, libgcrypt, libgpgerror
|
|
|
|
, hidapi, rapidjson
|
|
|
|
, trezorSupport ? true
|
|
|
|
, libusb1 ? null
|
|
|
|
, protobuf ? null
|
|
|
|
, python3 ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ];
|
|
|
|
|
|
|
|
let
|
|
|
|
arch = if stdenv.isx86_64 then "x86-64"
|
|
|
|
else if stdenv.isi686 then "i686"
|
|
|
|
else if stdenv.isAarch64 then "armv8-a"
|
|
|
|
else throw "unsupported architecture";
|
|
|
|
in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "monero-gui";
|
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-gui";
|
|
|
|
rev = "v${version}";
|
2020-10-19 00:13:06 +00:00
|
|
|
sha256 = "07r78ipv4g3i6z822kq380vi3qwlb958rccsy6lyybkhj9y0rx84";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake pkgconfig wrapQtAppsHook
|
|
|
|
(getDev qttools)
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qtbase qtdeclarative qtgraphicaleffects
|
|
|
|
qtmultimedia qtquickcontrols qtquickcontrols2
|
|
|
|
qtxmlpatterns
|
2020-10-11 12:50:04 +00:00
|
|
|
monero miniupnpc unbound readline
|
|
|
|
randomx libgcrypt libgpgerror
|
|
|
|
boost libunwind libsodium pcsclite
|
|
|
|
zeromq hidapi rapidjson
|
|
|
|
] ++ optionals trezorSupport [ libusb1 protobuf python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
postUnpack = ''
|
|
|
|
# copy monero sources here
|
|
|
|
# (needs to be writable)
|
|
|
|
cp -r ${monero.source}/* source/monero
|
|
|
|
chmod -R +w source/monero
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [ ./move-log-file.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-10-11 12:50:04 +00:00
|
|
|
# set monero-gui version
|
|
|
|
substituteInPlace src/version.js.in \
|
|
|
|
--replace '@VERSION_TAG_GUI@' '${version}'
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
# use monerod from the monero package
|
|
|
|
substituteInPlace src/daemon/DaemonManager.cpp \
|
|
|
|
--replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
# only build external deps, *not* the full monero
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace 'add_subdirectory(monero)' \
|
|
|
|
'add_subdirectory(monero EXCLUDE_FROM_ALL)'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-10-19 00:13:06 +00:00
|
|
|
preConfigure = ''
|
|
|
|
# because $out needs to be expanded
|
|
|
|
cmakeFlagsArray+=("-DCMAKE_INSTALL_PREFIX=$out/bin")
|
|
|
|
cmakeFlagsArray+=("-DARCH=${arch}")
|
|
|
|
'';
|
2020-10-11 12:50:04 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "monero-wallet-gui";
|
|
|
|
exec = "monero-wallet-gui";
|
|
|
|
icon = "monero";
|
|
|
|
desktopName = "Monero";
|
|
|
|
genericName = "Wallet";
|
2020-07-18 16:06:22 +00:00
|
|
|
categories = "Network;Utility;";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# install desktop entry
|
2020-10-11 12:50:04 +00:00
|
|
|
install -Dm644 -t $out/share/applications \
|
|
|
|
${desktopItem}/share/applications/*
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# install icons
|
|
|
|
for n in 16 24 32 48 64 96 128 256; do
|
|
|
|
size=$n"x"$n
|
2020-10-11 12:50:04 +00:00
|
|
|
install -Dm644 \
|
|
|
|
-t $out/share/icons/hicolor/$size/apps/monero.png \
|
|
|
|
$src/images/appicons/$size.png
|
2020-04-24 23:36:52 +00:00
|
|
|
done;
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Private, secure, untraceable currency";
|
|
|
|
homepage = "https://getmonero.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
badPlatforms = platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|