2021-01-17 00:15:33 +00:00
|
|
|
{ lib, stdenv, wrapQtAppsHook, makeDesktopItem
|
2020-10-11 12:50:04 +00:00
|
|
|
, fetchFromGitHub
|
2021-02-05 17:12:51 +00:00
|
|
|
, cmake, qttools, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, qtbase, qtdeclarative, qtgraphicaleffects
|
|
|
|
, qtmultimedia, qtxmlpatterns
|
|
|
|
, qtquickcontrols, qtquickcontrols2
|
2020-12-25 13:55:36 +00:00
|
|
|
, qtmacextras
|
2021-12-06 16:07:01 +00:00
|
|
|
, monero-cli, miniupnpc, unbound, readline
|
2020-10-11 12:50:04 +00:00
|
|
|
, boost, libunwind, libsodium, pcsclite
|
2021-10-08 15:17:17 +00:00
|
|
|
, randomx, zeromq, libgcrypt, libgpg-error
|
2021-01-15 22:18:51 +00:00
|
|
|
, hidapi, rapidjson, quirc
|
2021-07-16 19:40:57 +00:00
|
|
|
, trezorSupport ? true, libusb1, protobuf, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "monero-gui";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "0.18.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-08-21 13:32:41 +00:00
|
|
|
owner = "monero-project";
|
|
|
|
repo = "monero-gui";
|
|
|
|
rev = "v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
sha256 = "c5+bgu+hF3mOwF3ZxksPMiYUFyDRMFLA3f5FWeLsSBU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
cmake pkg-config wrapQtAppsHook
|
2021-07-16 19:40:57 +00:00
|
|
|
(lib.getDev qttools)
|
2020-10-11 12:50:04 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qtbase qtdeclarative qtgraphicaleffects
|
|
|
|
qtmultimedia qtquickcontrols qtquickcontrols2
|
|
|
|
qtxmlpatterns
|
2021-12-06 16:07:01 +00:00
|
|
|
monero-cli miniupnpc unbound readline
|
2021-10-08 15:17:17 +00:00
|
|
|
randomx libgcrypt libgpg-error
|
2020-10-11 12:50:04 +00:00
|
|
|
boost libunwind libsodium pcsclite
|
2021-01-15 22:18:51 +00:00
|
|
|
zeromq hidapi rapidjson quirc
|
2021-07-16 19:40:57 +00:00
|
|
|
] ++ lib.optionals trezorSupport [ libusb1 protobuf python3 ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ qtmacextras ];
|
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)
|
2021-12-06 16:07:01 +00:00
|
|
|
cp -r ${monero-cli.source}/* source/monero
|
2020-10-11 12:50:04 +00:00
|
|
|
chmod -R +w source/monero
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
patches = [
|
|
|
|
./move-log-file.patch
|
|
|
|
./use-system-libquirc.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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 \
|
2021-12-06 16:07:01 +00:00
|
|
|
--replace 'QApplication::applicationDirPath() + "' '"${monero-cli}/bin'
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
# 1: only build external deps, *not* the full monero
|
|
|
|
# 2: use nixpkgs libraries
|
2020-10-11 12:50:04 +00:00
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace 'add_subdirectory(monero)' \
|
2021-05-03 20:48:10 +00:00
|
|
|
'add_subdirectory(monero EXCLUDE_FROM_ALL)' \
|
2021-01-15 22:18:51 +00:00
|
|
|
--replace 'add_subdirectory(external)' ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
cmakeFlags = [ "-DARCH=default" ];
|
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";
|
2022-03-05 16:20:37 +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;
|
|
|
|
'';
|
|
|
|
|
2021-07-16 19:40:57 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Private, secure, untraceable currency";
|
|
|
|
homepage = "https://getmonero.org/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|