monero-gui: init at 0.11.1.0

This commit is contained in:
rnhmjoj 2018-01-27 00:07:07 +01:00 committed by Emery Hemingway
parent 3979a20d74
commit 05cb4dca11
4 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,89 @@
{ stdenv, fetchFromGitHub
, makeWrapper, makeDesktopItem
, qtbase, qmake, qtmultimedia, qttools
, qtgraphicaleffects, qtdeclarative
, qtlocation, qtquickcontrols, qtwebchannel
, qtwebengine, qtx11extras, qtxmlpatterns
, monero, unbound, readline, boost, libunwind
}:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "monero-gui-${version}";
version = "0.11.1.0";
src = fetchFromGitHub {
owner = "monero-project";
repo = "monero-gui";
rev = "v${version}";
sha256 = "01d7apwrv8j8bh7plvvhlnll3ransaha3n6rx19nkgvfn319hswq";
};
nativeBuildInputs = [ qmake ];
buildInputs = [
qtbase qtmultimedia qtgraphicaleffects
qtdeclarative qtlocation qtquickcontrols
qtwebchannel qtwebengine qtx11extras
qtxmlpatterns monero unbound readline
boost libunwind makeWrapper
];
patches = [
./move-log-file.patch
./move-translations-dir.patch
];
postPatch = ''
echo '
var GUI_VERSION = "${version}";
var GUI_MONERO_VERSION = "${getVersion monero}";
' > version.js
substituteInPlace monero-wallet-gui.pro \
--replace '$$[QT_INSTALL_BINS]/lrelease' '${getDev qttools}/bin/lrelease'
substituteInPlace src/daemon/DaemonManager.cpp \
--replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
'';
makeFlags = [ "INSTALL_ROOT=$(out)" ];
preBuild = ''
sed -i s#/opt/monero-wallet-gui##g Makefile
make -C src/zxcvbn-c
'';
desktopItem = makeDesktopItem {
name = "monero-wallet-gui";
exec = "monero-wallet-gui";
icon = "monero";
desktopName = "Monero Wallet";
genericName = "Wallet";
categories = "Application;Network;Utility;";
};
postInstall = ''
# install desktop entry
mkdir -p $out/share/applications
cp ${desktopItem}/share/applications/* $out/share/applications
# install translations
cp -r release/bin/translations $out/share/
# install icons
for n in 16 24 32 48 64 96 128 256; do
size=$n"x"$n
mkdir -p $out/share/icons/hicolor/$size/apps
cp $src/images/appicons/$size.png \
$out/share/icons/hicolor/$size/apps/monero.png
done;
'';
meta = {
description = "Private, secure, untraceable currency";
homepage = https://getmonero.org/;
license = licenses.bsd3;
platforms = platforms.all;
maintainers = with maintainers; [ rnhmjoj ];
};
}

View File

@ -0,0 +1,42 @@
diff --git a/main.cpp b/main.cpp
index 1a9a979..2316929 100644
--- a/main.cpp
+++ b/main.cpp
@@ -74,10 +74,6 @@ int main(int argc, char *argv[])
// qDebug() << "High DPI auto scaling - enabled";
//#endif
- // Log settings
- Monero::Wallet::init(argv[0], "monero-wallet-gui");
-// qInstallMessageHandler(messageHandler);
-
MainApp app(argc, argv);
qDebug() << "app startd";
@@ -86,6 +82,13 @@ int main(int argc, char *argv[])
app.setOrganizationDomain("getmonero.org");
app.setOrganizationName("monero-project");
+ // Log settings
+ QString logfile =
+ QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
+ + "/monero-wallet-gui.log";
+ Monero::Wallet::init(argv[0], logfile.toUtf8().constData());
+
+
filter *eventFilter = new filter;
app.installEventFilter(eventFilter);
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp
index 8525bf3..6967b24 100644
--- a/src/libwalletqt/Wallet.cpp
+++ b/src/libwalletqt/Wallet.cpp
@@ -613,7 +613,7 @@ QString Wallet::getDaemonLogPath() const
QString Wallet::getWalletLogPath() const
{
- return QCoreApplication::applicationDirPath() + "/monero-wallet-gui.log";
+ return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/monero-wallet-gui.log";
}
Wallet::Wallet(Monero::Wallet *w, QObject *parent)

View File

@ -0,0 +1,14 @@
diff --git a/TranslationManager.cpp b/TranslationManager.cpp
index fa39d35..5a410f7 100644
--- a/TranslationManager.cpp
+++ b/TranslationManager.cpp
@@ -29,7 +29,7 @@ bool TranslationManager::setLanguage(const QString &language)
#ifdef Q_OS_MACX
QString dir = qApp->applicationDirPath() + "/../Resources/translations";
#else
- QString dir = qApp->applicationDirPath() + "/translations";
+ QString dir = qApp->applicationDirPath() + "/../share/translations";
#endif
QString filename = "monero-core_" + language;

View File

@ -16120,6 +16120,8 @@ with pkgs;
monero = callPackage ../applications/altcoins/monero { };
monero-gui = libsForQt5.callPackage ../applications/altcoins/monero-gui { };
xmr-stak = callPackage ../applications/misc/xmr-stak {
hwloc = hwloc-nox;
};