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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

105 lines
2.9 KiB
Nix
Raw Normal View History

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