about summary refs log tree commit diff
path: root/pkgs/applications/altcoins
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2018-01-27 00:07:07 +0100
committerEmery Hemingway <ehmry@posteo.net>2018-01-28 10:17:36 -0500
commit05cb4dca11cd3971c0a2a33ac90fd0f871a24a39 (patch)
treea84c633436cfe6e4538fb8aaba86684f6c97b19f /pkgs/applications/altcoins
parent3979a20d7489efb7f12b2f477e92d4596b9bab31 (diff)
downloadnixlib-05cb4dca11cd3971c0a2a33ac90fd0f871a24a39.tar
nixlib-05cb4dca11cd3971c0a2a33ac90fd0f871a24a39.tar.gz
nixlib-05cb4dca11cd3971c0a2a33ac90fd0f871a24a39.tar.bz2
nixlib-05cb4dca11cd3971c0a2a33ac90fd0f871a24a39.tar.lz
nixlib-05cb4dca11cd3971c0a2a33ac90fd0f871a24a39.tar.xz
nixlib-05cb4dca11cd3971c0a2a33ac90fd0f871a24a39.tar.zst
nixlib-05cb4dca11cd3971c0a2a33ac90fd0f871a24a39.zip
monero-gui: init at 0.11.1.0
Diffstat (limited to 'pkgs/applications/altcoins')
-rw-r--r--pkgs/applications/altcoins/monero-gui/default.nix89
-rw-r--r--pkgs/applications/altcoins/monero-gui/move-log-file.patch42
-rw-r--r--pkgs/applications/altcoins/monero-gui/move-translations-dir.patch14
3 files changed, 145 insertions, 0 deletions
diff --git a/pkgs/applications/altcoins/monero-gui/default.nix b/pkgs/applications/altcoins/monero-gui/default.nix
new file mode 100644
index 000000000000..0d2899b2e649
--- /dev/null
+++ b/pkgs/applications/altcoins/monero-gui/default.nix
@@ -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 ];
+  };
+}
diff --git a/pkgs/applications/altcoins/monero-gui/move-log-file.patch b/pkgs/applications/altcoins/monero-gui/move-log-file.patch
new file mode 100644
index 000000000000..928fb32911f5
--- /dev/null
+++ b/pkgs/applications/altcoins/monero-gui/move-log-file.patch
@@ -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)
diff --git a/pkgs/applications/altcoins/monero-gui/move-translations-dir.patch b/pkgs/applications/altcoins/monero-gui/move-translations-dir.patch
new file mode 100644
index 000000000000..29bb56301547
--- /dev/null
+++ b/pkgs/applications/altcoins/monero-gui/move-translations-dir.patch
@@ -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;
+