@@ -0,0 +1,89 @@
1+{ stdenv, fetchFromGitHub
2+, makeWrapper, makeDesktopItem
3+, qtbase, qmake, qtmultimedia, qttools
4+, qtgraphicaleffects, qtdeclarative
5+, qtlocation, qtquickcontrols, qtwebchannel
6+, qtwebengine, qtx11extras, qtxmlpatterns
7+, monero, unbound, readline, boost, libunwind
8+}:
9+
10+with stdenv.lib;
11+
12+stdenv.mkDerivation rec {
13+ name = "monero-gui-${version}";
14+ version = "0.11.1.0";
15+
16+ src = fetchFromGitHub {
17+ owner = "monero-project";
18+ repo = "monero-gui";
19+ rev = "v${version}";
20+ sha256 = "01d7apwrv8j8bh7plvvhlnll3ransaha3n6rx19nkgvfn319hswq";
21+ };
22+
23+ nativeBuildInputs = [ qmake ];
24+
25+ buildInputs = [
26+ qtbase qtmultimedia qtgraphicaleffects
27+ qtdeclarative qtlocation qtquickcontrols
28+ qtwebchannel qtwebengine qtx11extras
29+ qtxmlpatterns monero unbound readline
30+ boost libunwind makeWrapper
31+ ];
32+
33+ patches = [
34+ ./move-log-file.patch
35+ ./move-translations-dir.patch
36+ ];
37+
38+ postPatch = ''
39+ echo '
40+ var GUI_VERSION = "${version}";
41+ var GUI_MONERO_VERSION = "${getVersion monero}";
42+ ' > version.js
43+ substituteInPlace monero-wallet-gui.pro \
44+ --replace '$$[QT_INSTALL_BINS]/lrelease' '${getDev qttools}/bin/lrelease'
45+ substituteInPlace src/daemon/DaemonManager.cpp \
46+ --replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
47+ '';
48+
49+ makeFlags = [ "INSTALL_ROOT=$(out)" ];
50+
51+ preBuild = ''
52+ sed -i s#/opt/monero-wallet-gui##g Makefile
53+ make -C src/zxcvbn-c
54+ '';
55+
56+ desktopItem = makeDesktopItem {
57+ name = "monero-wallet-gui";
58+ exec = "monero-wallet-gui";
59+ icon = "monero";
60+ desktopName = "Monero Wallet";
61+ genericName = "Wallet";
62+ categories = "Application;Network;Utility;";
63+ };
64+
65+ postInstall = ''
66+ # install desktop entry
67+ mkdir -p $out/share/applications
68+ cp ${desktopItem}/share/applications/* $out/share/applications
69+
70+ # install translations
71+ cp -r release/bin/translations $out/share/
72+
73+ # install icons
74+ for n in 16 24 32 48 64 96 128 256; do
75+ size=$n"x"$n
76+ mkdir -p $out/share/icons/hicolor/$size/apps
77+ cp $src/images/appicons/$size.png \
78+ $out/share/icons/hicolor/$size/apps/monero.png
79+ done;
80+ '';
81+
82+ meta = {
83+ description = "Private, secure, untraceable currency";
84+ homepage = https://getmonero.org/;
85+ license = licenses.bsd3;
86+ platforms = platforms.all;
87+ maintainers = with maintainers; [ rnhmjoj ];
88+ };
89+}