diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2018-03-05 00:07:59 +0000 |
---|---|---|
committer | Bertrand Jacquin <bertrand@jacquin.bzh> | 2018-03-13 22:19:12 +0000 |
commit | c7300cc1d16aa87b03fe49d35eae212be6f52a4a (patch) | |
tree | 09a4dad6e79d8ffa5eb7e673ae359081ef713804 | |
parent | app-crypt/trezord: Version bump (diff) | |
download | portage-c7300cc1d16aa87b03fe49d35eae212be6f52a4a.tar.xz |
net-p2p/monero-gui: GUI for net-p2p/monero
Package-Manager: Portage-2.3.19, Repoman-2.3.6
-rw-r--r-- | net-p2p/monero-gui/Manifest | 1 | ||||
-rw-r--r-- | net-p2p/monero-gui/files/0.11.1.0-Embed-the-translation-files-in-the-monero-wallet-gui.patch | 149 | ||||
-rw-r--r-- | net-p2p/monero-gui/metadata.xml | 11 | ||||
-rw-r--r-- | net-p2p/monero-gui/monero-gui-0.11.1.0.ebuild | 74 | ||||
-rw-r--r-- | profiles/use.local.desc | 2 |
5 files changed, 236 insertions, 1 deletions
diff --git a/net-p2p/monero-gui/Manifest b/net-p2p/monero-gui/Manifest new file mode 100644 index 00000000..ee6cc7a2 --- /dev/null +++ b/net-p2p/monero-gui/Manifest @@ -0,0 +1 @@ +DIST monero-gui-0.11.1.0.tar.gz 2362961 BLAKE2B 195603312ef52e6c45e3bb21850b224278058b00ce756a2d0aa080d97cab26800c24473b7b141efa18e6c9250057eae4e8a92da941c8004413f077b9077eea45 SHA512 15a1fb663d2bc01e570a5c8e36b615595923ecc4ec1c93fe84dd446c68d435716f589de0de28a5cf79b3bc932f3f69bb97efc905d62f0677451d750cfb66b268 diff --git a/net-p2p/monero-gui/files/0.11.1.0-Embed-the-translation-files-in-the-monero-wallet-gui.patch b/net-p2p/monero-gui/files/0.11.1.0-Embed-the-translation-files-in-the-monero-wallet-gui.patch new file mode 100644 index 00000000..a836512a --- /dev/null +++ b/net-p2p/monero-gui/files/0.11.1.0-Embed-the-translation-files-in-the-monero-wallet-gui.patch @@ -0,0 +1,149 @@ +From ec27875488544c77a85a5fe9bc4da645c111dc9e Mon Sep 17 00:00:00 2001 +From: Guillaume LE VAILLANT <glv@posteo.net> +Date: Sun, 17 Dec 2017 22:47:26 +0100 +Subject: [PATCH] Embed the translation files in the monero-wallet-gui binary + +--- + TranslationManager.cpp | 30 +++++++++++++++----------- + monero-wallet-gui.pro | 57 +++++++++++++++++++------------------------------- + 2 files changed, 40 insertions(+), 47 deletions(-) + +diff --git a/TranslationManager.cpp b/TranslationManager.cpp +index fa39d35a3847..e7fc52aaac28 100644 +--- a/TranslationManager.cpp ++++ b/TranslationManager.cpp +@@ -25,19 +25,12 @@ bool TranslationManager::setLanguage(const QString &language) + return true; + } + +- // translations are compiled into app binary +-#ifdef Q_OS_MACX +- QString dir = qApp->applicationDirPath() + "/../Resources/translations"; +-#else + QString dir = qApp->applicationDirPath() + "/translations"; +-#endif +- + QString filename = "monero-core_" + language; + +- qDebug("%s: loading translation file '%s' from '%s", ++ qDebug("%s: loading translation file '%s' from '%s'", + __FUNCTION__, qPrintable(filename), qPrintable(dir)); + +- + if (m_translator->load(filename, dir)) { + qDebug("%s: translation for language '%s' loaded successfully", + __FUNCTION__, qPrintable(language)); +@@ -45,11 +38,24 @@ bool TranslationManager::setLanguage(const QString &language) + qApp->installTranslator(m_translator); + emit languageChanged(); + return true; +- } else { +- qCritical("%s: error loading translation for language '%s'", +- __FUNCTION__, qPrintable(language)); +- return false; + } ++ ++ qDebug("%s: couldn't load translation file '%s' from '%s'", ++ __FUNCTION__, qPrintable(filename), qPrintable(dir)); ++ qDebug("%s: loading embedded translation file '%s'", ++ __FUNCTION__, qPrintable(filename)); ++ ++ if (m_translator->load(filename, ":")) { ++ qDebug("%s: embedded translation for language '%s' loaded successfully", ++ __FUNCTION__, qPrintable(language)); ++ qApp->installTranslator(m_translator); ++ emit languageChanged(); ++ return true; ++ } ++ ++ qCritical("%s: error loading translation for language '%s'", ++ __FUNCTION__, qPrintable(language)); ++ return false; + } + + TranslationManager *TranslationManager::instance() +diff --git a/monero-wallet-gui.pro b/monero-wallet-gui.pro +index b6383d2b28c3..27e1c94bd3e5 100644 +--- a/monero-wallet-gui.pro ++++ b/monero-wallet-gui.pro +@@ -282,29 +282,7 @@ macx { + + + # translation stuff +-TRANSLATIONS = \ # English is default language, no explicit translation file +- $$PWD/translations/monero-core.ts \ # translation source (copy this file when creating a new translation) +- $$PWD/translations/monero-core_ar.ts \ # Arabic +- $$PWD/translations/monero-core_pt-br.ts \ # Portuguese (Brazil) +- $$PWD/translations/monero-core_de.ts \ # German +- $$PWD/translations/monero-core_eo.ts \ # Esperanto +- $$PWD/translations/monero-core_es.ts \ # Spanish +- $$PWD/translations/monero-core_fi.ts \ # Finnish +- $$PWD/translations/monero-core_fr.ts \ # French +- $$PWD/translations/monero-core_hr.ts \ # Croatian +- $$PWD/translations/monero-core_id.ts \ # Indonesian +- $$PWD/translations/monero-core_hi.ts \ # Hindi +- $$PWD/translations/monero-core_it.ts \ # Italian +- $$PWD/translations/monero-core_ja.ts \ # Japanese +- $$PWD/translations/monero-core_nl.ts \ # Dutch +- $$PWD/translations/monero-core_pl.ts \ # Polish +- $$PWD/translations/monero-core_ru.ts \ # Russian +- $$PWD/translations/monero-core_sv.ts \ # Swedish +- $$PWD/translations/monero-core_zh-cn.ts \ # Chinese (Simplified-China) +- $$PWD/translations/monero-core_zh-tw.ts \ # Chinese (Traditional-Taiwan) +- $$PWD/translations/monero-core_he.ts \ # Hebrew +- $$PWD/translations/monero-core_ko.ts \ # Korean +- $$PWD/translations/monero-core_ro.ts \ # Romanian ++TRANSLATIONS = $$files($$PWD/translations/monero-core_*.ts) + + CONFIG(release, debug|release) { + DESTDIR = release/bin +@@ -317,14 +295,7 @@ CONFIG(release, debug|release) { + # LANGREL_OPTIONS = -markuntranslated "MISS_TR " + } + +-TARGET_FULL_PATH = $$OUT_PWD/$$DESTDIR +-TRANSLATION_TARGET_DIR = $$TARGET_FULL_PATH/translations +- +-macx { +- TARGET_FULL_PATH = $$sprintf("%1/%2/%3.app", $$OUT_PWD, $$DESTDIR, $$TARGET) +- TRANSLATION_TARGET_DIR = $$TARGET_FULL_PATH/Contents/Resources/translations +-} +- ++TRANSLATION_TARGET_DIR = $$OUT_PWD/translations + + !ios { + isEmpty(QMAKE_LUPDATE) { +@@ -351,13 +322,29 @@ macx { + + QMAKE_EXTRA_TARGETS += langupd deploy deploy_win + QMAKE_EXTRA_COMPILERS += langrel ++ ++ # Compile an initial version of translation files when running qmake ++ # the first time and generate the resource file for translations. ++ !exists($$TRANSLATION_TARGET_DIR) { ++ mkpath($$TRANSLATION_TARGET_DIR) ++ } ++ qrc_entry = "<RCC>" ++ qrc_entry += ' <qresource prefix="/">' ++ write_file($$TRANSLATION_TARGET_DIR/translations.qrc, qrc_entry) ++ for(tsfile, TRANSLATIONS) { ++ qmfile = $$TRANSLATION_TARGET_DIR/$$basename(tsfile) ++ qmfile ~= s/.ts$/.qm/ ++ system($$LANGREL $$LANGREL_OPTIONS $$tsfile -qm $$qmfile) ++ qrc_entry = " <file>$$basename(qmfile)</file>" ++ write_file($$TRANSLATION_TARGET_DIR/translations.qrc, qrc_entry, append) ++ } ++ qrc_entry = " </qresource>" ++ qrc_entry += "</RCC>" ++ write_file($$TRANSLATION_TARGET_DIR/translations.qrc, qrc_entry, append) ++ RESOURCES += $$TRANSLATION_TARGET_DIR/translations.qrc + } + + +- +- +- +- + # Update: no issues with the "slow link process" anymore, + # for development, just build debug version of libwallet_merged lib + # by invoking 'get_libwallet_api.sh Debug' diff --git a/net-p2p/monero-gui/metadata.xml b/net-p2p/monero-gui/metadata.xml new file mode 100644 index 00000000..b6f20b92 --- /dev/null +++ b/net-p2p/monero-gui/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>bertrand@jacquin.bzh</email> + <name>Bertrand Jacquin</name> + </maintainer> + <use> + <flag name="qrcode">Enable QR code scanning with media-gfx/zbar</flag> + </use> +</pkgmetadata> diff --git a/net-p2p/monero-gui/monero-gui-0.11.1.0.ebuild b/net-p2p/monero-gui/monero-gui-0.11.1.0.ebuild new file mode 100644 index 00000000..595c105f --- /dev/null +++ b/net-p2p/monero-gui/monero-gui-0.11.1.0.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit qmake-utils toolchain-funcs + +DESCRIPTION="GUI for net-p2p/monero" +HOMEPAGE="https://getmonero.org" +SRC_URI="https://github.com/monero-project/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="NEWLIB" +SLOT="0" +KEYWORDS="~amd64" +IUSE="qrcode unwind" + +COMMOM_DEPEND="=net-p2p/monero-${PV}:=[qt5,unwind?] + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtdeclarative:5[xml] + dev-qt/qtwidgets:5 + sys-libs/readline:= + dev-libs/boost:= + dev-libs/openssl:0 + unwind? ( sys-libs/libunwind[lzma] ) + qrcode? ( + dev-qt/qtmultimedia:5 + media-gfx/zbar + )" +DEPEND="${COMMOM_DEPEND} + dev-qt/linguist-tools:5" +RDEPEND="${COMMOM_DEPEND} + dev-qt/qtquickcontrols:5 + dev-qt/qtgraphicaleffects:5" + +PATCHES=( "${FILESDIR}/${PV}-Embed-the-translation-files-in-the-monero-wallet-gui.patch" ) + +src_prepare () { + cat > version.js || die <<-EOF + var GUI_VERSION = "${PV}" + var GUI_MONERO_VERSION = "${PV}" + EOF + + export AR=$(tc-getAR) + export CC=$(tc-getCC) + export CXX=$(tc-getCXX) + + default +} + +src_configure () { + local myconf=( "release" ) + + if use qrcode ; then + myconf+=( "WITH_SCANNER" ) + fi + + if ! use unwind ; then + myconf+=( "libunwind_off" ) + fi + + # CONFIG is expected to be a single argument, + eqmake5 "CONFIG+=${myconf[*]}" +} + +src_compile () { + emake -C src/zxcvbn-c + + default +} + +src_install () { + dobin release/bin/monero-wallet-gui + dodoc README.md +} diff --git a/profiles/use.local.desc b/profiles/use.local.desc index 7d025076..691b8e0c 100644 --- a/profiles/use.local.desc +++ b/profiles/use.local.desc @@ -68,7 +68,7 @@ net-p2p/dogecoin:qrcode - Enable generation of QR Codes for receiving payments net-p2p/dogecoin:utils - Build the utils net-p2p/dogecoin:wallet - Enable wallet support net-p2p/monero:system-libs - Use system libraries instead of the ones included in the upstream distribution -net-p2p/monero-gui:system-libs - Use system libraries instead of the ones included in the upstream distribution +net-p2p/monero-gui:qrcode - Enable QR code scanning with media-gfx/zbar net-p2p/pesetacoin:qrcode - Enable generation of QR Codes for receiving payments net-p2p/pesetacoin:wallet - Enable wallet support sys-firmware/gnuk:tools - Install aditional tools |