monero-gui: init at 0.11.1.0

authored by rnhmjoj and committed by Emery Hemingway 05cb4dca 3979a20d

+147
+89
pkgs/applications/altcoins/monero-gui/default.nix
··· 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 + }
+42
pkgs/applications/altcoins/monero-gui/move-log-file.patch
··· 1 + diff --git a/main.cpp b/main.cpp 2 + index 1a9a979..2316929 100644 3 + --- a/main.cpp 4 + +++ b/main.cpp 5 + @@ -74,10 +74,6 @@ int main(int argc, char *argv[]) 6 + // qDebug() << "High DPI auto scaling - enabled"; 7 + //#endif 8 + 9 + - // Log settings 10 + - Monero::Wallet::init(argv[0], "monero-wallet-gui"); 11 + -// qInstallMessageHandler(messageHandler); 12 + - 13 + MainApp app(argc, argv); 14 + 15 + qDebug() << "app startd"; 16 + @@ -86,6 +82,13 @@ int main(int argc, char *argv[]) 17 + app.setOrganizationDomain("getmonero.org"); 18 + app.setOrganizationName("monero-project"); 19 + 20 + + // Log settings 21 + + QString logfile = 22 + + QStandardPaths::writableLocation(QStandardPaths::CacheLocation) 23 + + + "/monero-wallet-gui.log"; 24 + + Monero::Wallet::init(argv[0], logfile.toUtf8().constData()); 25 + + 26 + + 27 + filter *eventFilter = new filter; 28 + app.installEventFilter(eventFilter); 29 + 30 + diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp 31 + index 8525bf3..6967b24 100644 32 + --- a/src/libwalletqt/Wallet.cpp 33 + +++ b/src/libwalletqt/Wallet.cpp 34 + @@ -613,7 +613,7 @@ QString Wallet::getDaemonLogPath() const 35 + 36 + QString Wallet::getWalletLogPath() const 37 + { 38 + - return QCoreApplication::applicationDirPath() + "/monero-wallet-gui.log"; 39 + + return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/monero-wallet-gui.log"; 40 + } 41 + 42 + Wallet::Wallet(Monero::Wallet *w, QObject *parent)
+14
pkgs/applications/altcoins/monero-gui/move-translations-dir.patch
··· 1 + diff --git a/TranslationManager.cpp b/TranslationManager.cpp 2 + index fa39d35..5a410f7 100644 3 + --- a/TranslationManager.cpp 4 + +++ b/TranslationManager.cpp 5 + @@ -29,7 +29,7 @@ bool TranslationManager::setLanguage(const QString &language) 6 + #ifdef Q_OS_MACX 7 + QString dir = qApp->applicationDirPath() + "/../Resources/translations"; 8 + #else 9 + - QString dir = qApp->applicationDirPath() + "/translations"; 10 + + QString dir = qApp->applicationDirPath() + "/../share/translations"; 11 + #endif 12 + 13 + QString filename = "monero-core_" + language; 14 +
+2
pkgs/top-level/all-packages.nix
··· 16120 16120 16121 16121 monero = callPackage ../applications/altcoins/monero { }; 16122 16122 16123 + monero-gui = libsForQt5.callPackage ../applications/altcoins/monero-gui { }; 16124 + 16123 16125 xmr-stak = callPackage ../applications/misc/xmr-stak { 16124 16126 hwloc = hwloc-nox; 16125 16127 };