From d5f46832de900cee0801ca40bba743c9564cccb8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 9 Dec 2015 10:53:12 +0000 Subject: Unify package name to as few places as possible without major changes --- build-aux/m4/bitcoin_find_bdb48.m4 | 4 ++-- build-aux/m4/bitcoin_qt.m4 | 2 +- libbitcoinconsensus.pc.in | 2 +- share/qt/Info.plist.in | 2 +- share/qt/extract_strings_qt.py | 1 + share/setup.nsi.in | 4 ++-- src/Makefile.am | 3 ++- src/Makefile.qt.include | 2 +- src/bitcoin-cli-res.rc | 2 +- src/bitcoin-cli.cpp | 8 ++++++-- src/bitcoin-tx.cpp | 6 +++++- src/bitcoind.cpp | 8 ++++++-- src/clientversion.h | 2 +- src/init.cpp | 12 ++++++------ src/net.cpp | 2 +- src/qt/askpassphrasedialog.cpp | 8 ++++++-- src/qt/bitcoin.cpp | 8 ++++---- src/qt/bitcoingui.cpp | 16 ++++++++++------ src/qt/forms/debugwindow.ui | 2 +- src/qt/forms/helpmessagedialog.ui | 3 --- src/qt/forms/intro.ui | 10 +++++----- src/qt/forms/optionsdialog.ui | 6 +++--- src/qt/intro.cpp | 10 ++++++++-- src/qt/optionsdialog.cpp | 5 +++++ src/qt/res/bitcoin-qt-res.rc | 4 ++-- src/qt/rpcconsole.cpp | 8 +++++++- src/qt/splashscreen.cpp | 8 ++++++-- src/qt/utilitydialog.cpp | 10 +++++++--- src/timedata.cpp | 6 +++++- 29 files changed, 106 insertions(+), 58 deletions(-) diff --git a/build-aux/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4 index 0bf558d25b..2aa493a6af 100644 --- a/build-aux/m4/bitcoin_find_bdb48.m4 +++ b/build-aux/m4/bitcoin_find_bdb48.m4 @@ -38,7 +38,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ done if test "x$bdbpath" = "xX"; then AC_MSG_RESULT([no]) - AC_MSG_ERROR([libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) + AC_MSG_ERROR([libdb_cxx headers missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) elif test "x$bdb48path" = "xX"; then BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdbpath}],db_cxx) AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[ @@ -60,7 +60,7 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[ ]) done if test "x$BDB_LIBS" = "x"; then - AC_MSG_ERROR([libdb_cxx missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) + AC_MSG_ERROR([libdb_cxx missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)]) fi AC_SUBST(BDB_LIBS) ]) diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 index 2480267dc1..5fe12fda9b 100644 --- a/build-aux/m4/bitcoin_qt.m4 +++ b/build-aux/m4/bitcoin_qt.m4 @@ -220,7 +220,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ dnl enable qt support - AC_MSG_CHECKING(whether to build Bitcoin Core GUI) + AC_MSG_CHECKING(whether to build ]AC_PACKAGE_NAME[ GUI) BITCOIN_QT_CHECK([ bitcoin_enable_qt=yes bitcoin_enable_qt_test=yes diff --git a/libbitcoinconsensus.pc.in b/libbitcoinconsensus.pc.in index 3ca1696a31..eb920c47eb 100644 --- a/libbitcoinconsensus.pc.in +++ b/libbitcoinconsensus.pc.in @@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -Name: Bitcoin Core consensus library +Name: @PACKAGE_NAME@ consensus library Description: Library for the Bitcoin consensus protocol. Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lbitcoinconsensus diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index a389332a52..d1a9ed7040 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -17,7 +17,7 @@ APPL CFBundleGetInfoString - @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ The Bitcoin Core developers + @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ The @PACKAGE_NAME@ developers CFBundleShortVersionString @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index d4bd585138..045eb27f47 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -70,6 +70,7 @@ f.write(""" #endif """) f.write('static const char UNUSED *bitcoin_strings[] = {\n') +f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),)) messages.sort(key=operator.itemgetter(0)) for (msgid, msgstr) in messages: if msgid != EMPTY: diff --git a/share/setup.nsi.in b/share/setup.nsi.in index 6c0e895bb1..26d3822747 100644 --- a/share/setup.nsi.in +++ b/share/setup.nsi.in @@ -6,7 +6,7 @@ SetCompressor /SOLID lzma # General Symbol Definitions !define REGKEY "SOFTWARE\$(^Name)" !define VERSION @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ -!define COMPANY "Bitcoin Core project" +!define COMPANY "@PACKAGE_NAME@ project" !define URL http://www.bitcoin.org/ # MUI Symbol Definitions @@ -59,7 +59,7 @@ XPStyle on BrandingText " " ShowInstDetails show VIProductVersion ${VERSION}.@CLIENT_VERSION_BUILD@ -VIAddVersionKey ProductName "Bitcoin Core" +VIAddVersionKey ProductName "@PACKAGE_NAME@" VIAddVersionKey ProductVersion "${VERSION}" VIAddVersionKey CompanyName "${COMPANY}" VIAddVersionKey CompanyWebsite "${URL}" diff --git a/src/Makefile.am b/src/Makefile.am index f1e98dabde..959eef8a23 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -448,7 +448,8 @@ clean-local: .rc.o: @test -f $(WINDRES) - $(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@ + ## FIXME: How to get the appropriate modulename_CPPFLAGS in here? + $(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@ .mm.o: $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index e62003a513..c93667038f 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -382,7 +382,7 @@ SECONDARY: $(QT_QM) qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" - $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) ../share/qt/extract_strings_qt.py $^ + $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" ../share/qt/extract_strings_qt.py $^ translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) @test -n $(LUPDATE) || echo "lupdate is required for updating translations" diff --git a/src/bitcoin-cli-res.rc b/src/bitcoin-cli-res.rc index 1e4aa609bb..58f8f1e8a2 100644 --- a/src/bitcoin-cli-res.rc +++ b/src/bitcoin-cli-res.rc @@ -17,7 +17,7 @@ BEGIN BLOCK "040904E4" // U.S. English - multilingual (hex) BEGIN VALUE "CompanyName", "Bitcoin" - VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for Bitcoin Core)" + VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " PACKAGE_NAME ")" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "bitcoin-cli" VALUE "LegalCopyright", COPYRIGHT_STR diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 9564573657..f8e3880ea2 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -3,6 +3,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "chainparamsbase.h" #include "clientversion.h" #include "rpcclient.h" @@ -68,10 +72,10 @@ static bool AppInitRPC(int argc, char* argv[]) // ParseParameters(argc, argv); if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { - std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n"; + std::string strUsage = strprintf(_("%s RPC client version"), _(PACKAGE_NAME)) + " " + FormatFullVersion() + "\n"; if (!mapArgs.count("-version")) { strUsage += "\n" + _("Usage:") + "\n" + - " bitcoin-cli [options] [params] " + _("Send command to Bitcoin Core") + "\n" + + " bitcoin-cli [options] [params] " + strprintf(_("Send command to %s"), _(PACKAGE_NAME)) + "\n" + " bitcoin-cli [options] help " + _("List commands") + "\n" + " bitcoin-cli [options] help " + _("Get help for a command") + "\n"; diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 9f8b2b98af..aaa2ef128f 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "base58.h" #include "clientversion.h" #include "coins.h" @@ -47,7 +51,7 @@ static bool AppInitRawTx(int argc, char* argv[]) if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help")) { // First part of help message is specific to this utility - std::string strUsage = _("Bitcoin Core bitcoin-tx utility version") + " " + FormatFullVersion() + "\n\n" + + std::string strUsage = strprintf(_("%s bitcoin-tx utility version"), _(PACKAGE_NAME)) + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + " bitcoin-tx [options] [commands] " + _("Update hex-encoded bitcoin transaction") + "\n" + " bitcoin-tx [options] -create [commands] " + _("Create hex-encoded bitcoin transaction") + "\n" + diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index addf0e6a26..440356aa80 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -3,6 +3,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "chainparams.h" #include "clientversion.h" #include "rpcserver.h" @@ -74,7 +78,7 @@ bool AppInit(int argc, char* argv[]) // Process help and version before taking care about datadir if (mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { - std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; + std::string strUsage = strprintf(_("%s Daemon"), _(PACKAGE_NAME)) + " " + _("version") + " " + FormatFullVersion() + "\n"; if (mapArgs.count("-version")) { @@ -83,7 +87,7 @@ bool AppInit(int argc, char* argv[]) else { strUsage += "\n" + _("Usage:") + "\n" + - " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n"; + " bitcoind [options] " + strprintf(_("Start %s Daemon"), _(PACKAGE_NAME)) + "\n"; strUsage += "\n" + HelpMessage(HMM_BITCOIND); } diff --git a/src/clientversion.h b/src/clientversion.h index 5a06b310a3..ba15ebf3bd 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -38,7 +38,7 @@ #define DO_STRINGIZE(X) #X //! Copyright string used in Windows .rc files -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The " PACKAGE_NAME " Developers" /** * bitcoind-res.rc includes this file, but it cannot cope with real c++ code. diff --git a/src/init.cpp b/src/init.cpp index 162b18186c..8d44f833a2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -513,7 +513,7 @@ std::string HelpMessage(HelpMessageMode mode) std::string LicenseInfo() { // todo: remove urls from translations on next change - return FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" + + return FormatParagraph(strprintf(_("Copyright (C) 2009-%i The %s Developers"), COPYRIGHT_YEAR, _(PACKAGE_NAME))) + "\n" + "\n" + FormatParagraph(_("This is experimental software.")) + "\n" + "\n" + @@ -997,7 +997,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) // Sanity check if (!InitSanityCheck()) - return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down.")); + return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), _(PACKAGE_NAME))); std::string strDataDir = GetDataDir().string(); #ifdef ENABLE_WALLET @@ -1013,9 +1013,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) try { static boost::interprocess::file_lock lock(pathLockFile.string().c_str()); if (!lock.try_lock()) - return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running."), strDataDir)); + return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), strDataDir, _(PACKAGE_NAME))); } catch(const boost::interprocess::interprocess_exception& e) { - return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running.") + " %s.", strDataDir, e.what())); + return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running.") + " %s.", strDataDir, _(PACKAGE_NAME), e.what())); } #ifndef WIN32 @@ -1423,10 +1423,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) " or address book entries might be missing or incorrect.")); } else if (nLoadWalletRet == DB_TOO_NEW) - strErrors << _("Error loading wallet.dat: Wallet requires newer version of Bitcoin Core") << "\n"; + strErrors << strprintf(_("Error loading wallet.dat: Wallet requires newer version of %s"), _(PACKAGE_NAME)) << "\n"; else if (nLoadWalletRet == DB_NEED_REWRITE) { - strErrors << _("Wallet needed to be rewritten: restart Bitcoin Core to complete") << "\n"; + strErrors << strprintf(_("Wallet needed to be rewritten: restart %s to complete"), _(PACKAGE_NAME)) << "\n"; LogPrintf("%s", strErrors.str()); return InitError(strErrors.str()); } diff --git a/src/net.cpp b/src/net.cpp index cff4c54505..2b804b0b44 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1849,7 +1849,7 @@ bool BindListenPort(const CService &addrBind, string& strError, bool fWhiteliste { int nErr = WSAGetLastError(); if (nErr == WSAEADDRINUSE) - strError = strprintf(_("Unable to bind to %s on this computer. Bitcoin Core is probably already running."), addrBind.ToString()); + strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToString(), _(PACKAGE_NAME)); else strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToString(), NetworkErrorString(nErr)); LogPrintf("%s\n", strError); diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 441814ff07..e8e5825d1a 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "askpassphrasedialog.h" #include "ui_askpassphrasedialog.h" @@ -119,9 +123,9 @@ void AskPassphraseDialog::accept() { QMessageBox::warning(this, tr("Wallet encrypted"), "" + - tr("Bitcoin Core will close now to finish the encryption process. " + tr("%1 will close now to finish the encryption process. " "Remember that encrypting your wallet cannot fully protect " - "your bitcoins from being stolen by malware infecting your computer.") + + "your bitcoins from being stolen by malware infecting your computer.").arg(tr(PACKAGE_NAME)) + "

" + tr("IMPORTANT: Any previous backups you have made of your wallet file " "should be replaced with the newly generated, encrypted wallet file. " diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 06a6c239ef..e108c84e39 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -578,14 +578,14 @@ int main(int argc, char *argv[]) /// - Do not call GetDataDir(true) before this step finishes if (!boost::filesystem::is_directory(GetDataDir(false))) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"]))); return 1; } try { ReadConfigFile(mapArgs, mapMultiArgs); } catch (const std::exception& e) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what())); return false; } @@ -600,7 +600,7 @@ int main(int argc, char *argv[]) try { SelectParams(ChainNameFromCommandLine()); } catch(std::exception &e) { - QMessageBox::critical(0, QObject::tr("Bitcoin Core"), QObject::tr("Error: %1").arg(e.what())); + QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what())); return 1; } #ifdef ENABLE_WALLET @@ -658,7 +658,7 @@ int main(int argc, char *argv[]) app.createWindow(networkStyle.data()); app.requestInitialize(); #if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 - WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("Bitcoin Core didn't yet exit safely..."), (HWND)app.getMainWinId()); + WinShutdownMonitor::registerShutdownBlockReason(QObject::tr("%1 didn't yet exit safely...").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId()); #endif app.exec(); app.requestShutdown(); diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 6f9f6e90d6..811f27f97b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "bitcoingui.h" #include "bitcoinunits.h" @@ -105,7 +109,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n { GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); - QString windowTitle = tr("Bitcoin Core") + " - "; + QString windowTitle = tr(PACKAGE_NAME) + " - "; #ifdef ENABLE_WALLET /* if compiled with wallet support, -disablewallet can still disable the wallet */ enableWallet = !GetBoolArg("-disablewallet", false); @@ -303,14 +307,14 @@ void BitcoinGUI::createActions() quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); - aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About Bitcoin Core"), this); - aboutAction->setStatusTip(tr("Show information about Bitcoin Core")); + aboutAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&About %1").arg(tr(PACKAGE_NAME)), this); + aboutAction->setStatusTip(tr("Show information about %1").arg(tr(PACKAGE_NAME))); aboutAction->setMenuRole(QAction::AboutRole); aboutQtAction = new QAction(platformStyle->TextColorIcon(":/icons/about_qt"), tr("About &Qt"), this); aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(platformStyle->TextColorIcon(":/icons/options"), tr("&Options..."), this); - optionsAction->setStatusTip(tr("Modify configuration options for Bitcoin Core")); + optionsAction->setStatusTip(tr("Modify configuration options for %1").arg(tr(PACKAGE_NAME))); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(platformStyle->TextColorIcon(":/icons/about"), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); @@ -340,7 +344,7 @@ void BitcoinGUI::createActions() showHelpMessageAction = new QAction(platformStyle->TextColorIcon(":/icons/info"), tr("&Command-line options"), this); showHelpMessageAction->setMenuRole(QAction::NoRole); - showHelpMessageAction->setStatusTip(tr("Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options")); + showHelpMessageAction->setStatusTip(tr("Show the %1 help message to get a list with possible Bitcoin command-line options").arg(tr(PACKAGE_NAME))); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); @@ -518,7 +522,7 @@ void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle) { #ifndef Q_OS_MAC trayIcon = new QSystemTrayIcon(this); - QString toolTip = tr("Bitcoin Core client") + " " + networkStyle->getTitleAddText(); + QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + networkStyle->getTitleAddText(); trayIcon->setToolTip(toolTip); trayIcon->setIcon(networkStyle->getTrayAndWindowIcon()); trayIcon->show(); diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 2471470363..7a3d29417e 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -415,7 +415,7 @@ - Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. + Open the %1 debug log file from the current data directory. This can take a few seconds for large log files. &Open diff --git a/src/qt/forms/helpmessagedialog.ui b/src/qt/forms/helpmessagedialog.ui index dc7df9d6c8..b7f941f70b 100644 --- a/src/qt/forms/helpmessagedialog.ui +++ b/src/qt/forms/helpmessagedialog.ui @@ -10,9 +10,6 @@ 400 - - Bitcoin Core - Command-line options - 0 diff --git a/src/qt/forms/intro.ui b/src/qt/forms/intro.ui index 09e7bdb024..e4ff3da1ab 100644 --- a/src/qt/forms/intro.ui +++ b/src/qt/forms/intro.ui @@ -15,12 +15,12 @@ - + QLabel { font-style:italic; } - Welcome to Bitcoin Core. + Welcome to %1. true @@ -44,9 +44,9 @@ - + - As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. + As this is the first time the program is launched, you can choose where %1 will store its data. true @@ -56,7 +56,7 @@ - Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + %1 will download and store a copy of the Bitcoin block chain. At least %2GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. true diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 22c67b8040..c712e6ea01 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -30,10 +30,10 @@ - Automatically start Bitcoin Core after logging in to the system. + Automatically start %1 after logging in to the system. - &Start Bitcoin Core on system login + &Start %1 on system login @@ -562,7 +562,7 @@ - The user interface language can be set here. This setting will take effect after restarting Bitcoin Core. + The user interface language can be set here. This setting will take effect after restarting %1. diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index 4ab87e0f32..8d1dc349db 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "intro.h" #include "ui_intro.h" @@ -112,7 +116,9 @@ Intro::Intro(QWidget *parent) : signalled(false) { ui->setupUi(this); - ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(BLOCK_CHAIN_SIZE/GB_BYTES)); + ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME))); + ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME))); + ui->sizeWarningLabel->setText(ui->sizeWarningLabel->text().arg(tr(PACKAGE_NAME)).arg(BLOCK_CHAIN_SIZE/GB_BYTES)); startThread(); } @@ -181,7 +187,7 @@ void Intro::pickDataDirectory() TryCreateDirectory(GUIUtil::qstringToBoostPath(dataDir)); break; } catch (const fs::filesystem_error&) { - QMessageBox::critical(0, tr("Bitcoin Core"), + QMessageBox::critical(0, tr(PACKAGE_NAME), tr("Error: Specified data directory \"%1\" cannot be created.").arg(dataDir)); /* fall through, back to choosing screen */ } diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index d0191fa6d8..79a7406129 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -80,6 +80,11 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) : /* Display elements init */ QDir translations(":translations"); + + ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(tr(PACKAGE_NAME))); + ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(tr(PACKAGE_NAME))); + + ui->lang->setToolTip(ui->lang->toolTip().arg(tr(PACKAGE_NAME))); ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant("")); Q_FOREACH(const QString &langStr, translations.entryList()) { diff --git a/src/qt/res/bitcoin-qt-res.rc b/src/qt/res/bitcoin-qt-res.rc index 9f66d0af79..19c3d5d97d 100644 --- a/src/qt/res/bitcoin-qt-res.rc +++ b/src/qt/res/bitcoin-qt-res.rc @@ -19,13 +19,13 @@ BEGIN BLOCK "040904E4" // U.S. English - multilingual (hex) BEGIN VALUE "CompanyName", "Bitcoin" - VALUE "FileDescription", "Bitcoin Core (GUI node for Bitcoin)" + VALUE "FileDescription", PACKAGE_NAME " (GUI node for Bitcoin)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "bitcoin-qt" VALUE "LegalCopyright", COPYRIGHT_STR VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." VALUE "OriginalFilename", "bitcoin-qt.exe" - VALUE "ProductName", "Bitcoin Core" + VALUE "ProductName", PACKAGE_NAME VALUE "ProductVersion", VER_PRODUCTVERSION_STR END END diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 619c8631ae..b60aa00f13 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "rpcconsole.h" #include "ui_debugwindow.h" @@ -250,6 +254,8 @@ RPCConsole::RPCConsole(const PlatformStyle *platformStyle, QWidget *parent) : ui->setupUi(this); GUIUtil::restoreWindowGeometry("nRPCConsoleWindow", this->size(), this); + ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME))); + if (platformStyle->getImagesOnButtons()) { ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); } @@ -478,7 +484,7 @@ void RPCConsole::clear() ).arg(fixedFontInfo.family(), ptSize) ); - message(CMD_REPLY, (tr("Welcome to the Bitcoin Core RPC console.") + "
" + + message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(tr(PACKAGE_NAME)) + "
" + tr("Use up and down arrows to navigate history, and Ctrl-L to clear screen.") + "
" + tr("Type help for an overview of available commands.")), true); } diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index c15b64c327..339b684426 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "splashscreen.h" #include "networkstyle.h" @@ -38,9 +42,9 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) #endif // define text to place - QString titleText = tr("Bitcoin Core"); + QString titleText = tr(PACKAGE_NAME); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); + QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The %1 developers").arg(tr(PACKAGE_NAME))); QString titleAddText = networkStyle->getTitleAddText(); QString font = QApplication::font().toString(); diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 5e26f3e01b..3e96f26b3a 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "utilitydialog.h" #include "ui_helpmessagedialog.h" @@ -30,7 +34,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : { ui->setupUi(this); - QString version = tr("Bitcoin Core") + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); + QString version = tr(PACKAGE_NAME) + " " + tr("version") + " " + QString::fromStdString(FormatFullVersion()); /* On x86 add a bit specifier to the version so that users can distinguish between * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambigious. */ @@ -42,7 +46,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : if (about) { - setWindowTitle(tr("About Bitcoin Core")); + setWindowTitle(tr("About %1").arg(tr(PACKAGE_NAME))); /// HTML-format the license message from the core QString licenseInfo = QString::fromStdString(LicenseInfo()); @@ -144,7 +148,7 @@ ShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f): { QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(new QLabel( - tr("Bitcoin Core is shutting down...") + "

" + + tr("%1 is shutting down...").arg(tr(PACKAGE_NAME)) + "

" + tr("Do not shut down the computer until this window disappears."))); setLayout(layout); } diff --git a/src/timedata.cpp b/src/timedata.cpp index 861c375989..2eaa9e4c81 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "timedata.h" #include "netbase.h" @@ -99,7 +103,7 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample) if (!fMatch) { fDone = true; - string strMessage = _("Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly."); + string strMessage = strprintf(_("Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly."), _(PACKAGE_NAME)); strMiscWarning = strMessage; uiInterface.ThreadSafeMessageBox(strMessage, "", CClientUIInterface::MSG_WARNING); } -- cgit v1.2.3 From 1a6c67c8f507ad6918b6a27cab9eb734cc1d4bd4 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 13 Dec 2015 05:54:21 +0000 Subject: Parameterise 2009 in translatable copyright strings --- src/init.cpp | 2 +- src/qt/splashscreen.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 8d44f833a2..4bcf8ec78b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -513,7 +513,7 @@ std::string HelpMessage(HelpMessageMode mode) std::string LicenseInfo() { // todo: remove urls from translations on next change - return FormatParagraph(strprintf(_("Copyright (C) 2009-%i The %s Developers"), COPYRIGHT_YEAR, _(PACKAGE_NAME))) + "\n" + + return FormatParagraph(strprintf(_("Copyright (C) %i-%i The %s Developers"), 2009, COPYRIGHT_YEAR, _(PACKAGE_NAME))) + "\n" + "\n" + FormatParagraph(_("This is experimental software.")) + "\n" + "\n" + diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 339b684426..ad8d7b3f23 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -44,7 +44,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) // define text to place QString titleText = tr(PACKAGE_NAME); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The %1 developers").arg(tr(PACKAGE_NAME))); + QString copyrightText = QChar(0xA9)+QString(" %1-%2 ").arg(2009).arg(COPYRIGHT_YEAR) + QString(tr("The %1 developers").arg(tr(PACKAGE_NAME))); QString titleAddText = networkStyle->getTitleAddText(); QString font = QApplication::font().toString(); -- cgit v1.2.3 From 63bcdc5227578015870c1eedc8c59861e9734971 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 10 Dec 2015 21:49:27 +0000 Subject: More complicated package name substitution for Mac deployment --- .travis.yml | 3 +- Makefile.am | 39 ++++++++++----- configure.ac | 3 ++ contrib/gitian-descriptors/gitian-osx-signer.yml | 3 +- contrib/gitian-descriptors/gitian-osx.yml | 17 ++++++- contrib/macdeploy/Base.lproj/InfoPlist.strings | 1 - contrib/macdeploy/DS_Store | Bin 10244 -> 0 bytes contrib/macdeploy/background.png | Bin 48690 -> 0 bytes contrib/macdeploy/background.psd | Bin 982442 -> 0 bytes contrib/macdeploy/background.svg | 34 +++++++++++++ contrib/macdeploy/background.tiff | Bin 202136 -> 0 bytes contrib/macdeploy/background@2x.png | Bin 138890 -> 0 bytes contrib/macdeploy/custom_dsstore.py | 60 +++++++++++++++++++++++ contrib/macdeploy/macdeployqtplus | 14 ++++-- doc/README_osx.txt | 5 +- 15 files changed, 156 insertions(+), 23 deletions(-) delete mode 100644 contrib/macdeploy/Base.lproj/InfoPlist.strings delete mode 100644 contrib/macdeploy/DS_Store delete mode 100644 contrib/macdeploy/background.png delete mode 100644 contrib/macdeploy/background.psd create mode 100644 contrib/macdeploy/background.svg delete mode 100644 contrib/macdeploy/background.tiff delete mode 100644 contrib/macdeploy/background@2x.png create mode 100755 contrib/macdeploy/custom_dsstore.py diff --git a/.travis.yml b/.travis.yml index d2fbfee6f2..673a0d0a59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ matrix: - compiler: ": No wallet" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - compiler: ": Cross-Mac" - env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" + env: HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev libz-dev libbz2-dev libffi-dev libtiff-tools python-dev python-pip" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" exclude: - compiler: gcc install: @@ -49,6 +49,7 @@ install: - if [ -n "$PPA" ]; then travis_retry sudo add-apt-repository "$PPA" -y; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi + - if [[ "$HOST" =~ apple ]]; then pip install --user cairosvg mac_alias ds_store; export PATH="$HOME/.local/bin:$PATH"; ( wget 'https://bitbucket.org/al45tair/ds_store/get/c80c23706eae.tar.gz' && tar -xzvpf c80c23706eae.tar.gz && cd al45tair-ds_store-c80c23706eae/ && python setup.py install --user; ) fi before_script: - unset CC; unset CXX - mkdir -p depends/SDKs depends/sdk-sources diff --git a/Makefile.am b/Makefile.am index b2b7811729..f9fca357c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,12 +14,18 @@ BITCOIN_QT_BIN=$(top_builddir)/src/qt/bitcoin-qt$(EXEEXT) BITCOIN_CLI_BIN=$(top_builddir)/src/bitcoin-cli$(EXEEXT) BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT) +empty := +space := $(empty) $(empty) + OSX_APP=Bitcoin-Qt.app -OSX_DMG=Bitcoin-Core.dmg +OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)) +OSX_DMG = $(OSX_VOLNAME).dmg +OSX_BACKGROUND_SVG=background.svg OSX_BACKGROUND_IMAGE=background.tiff +OSX_BACKGROUND_IMAGE_DPIS=36 72 +OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist -OSX_BASE_LPROJ_DIR=$(top_srcdir)/contrib/macdeploy/Base.lproj/InfoPlist.strings OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW @@ -31,9 +37,9 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \ $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \ $(top_srcdir)/doc/README_windows.txt -OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $(OSX_BASE_LPROJ_DIR) \ - $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \ - $(top_srcdir)/contrib/macdeploy/DS_Store \ +OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \ + $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \ + $(OSX_DSSTORE_GEN) \ $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \ $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh @@ -87,17 +93,20 @@ $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN) $(MKDIR_P) $(@D) STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@ -$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(OSX_BASE_LPROJ_DIR) +$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(MKDIR_P) $(@D) - $(INSTALL_DATA) $< $@ + echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \ $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \ $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings +osx_volname: + echo $(OSX_VOLNAME) >$@ + if BUILD_DARWIN $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 + $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME) deploydir: $(OSX_DMG) else @@ -111,13 +120,17 @@ $(APP_DIST_DIR)/Applications: $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_DMG): $(APP_DIST_EXTRAS) - $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -dir-mode 0755 -apple -o $@ dist + $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist -$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) +dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG) + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(CAIROSVG) -fpng -d$* - | $(IMAGEMAGICK_CONVERT) - $@ +OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE)) +$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES) $(MKDIR_P) $(@D) - $(INSTALL) $< $@ -$(APP_DIST_DIR)/.DS_Store: contrib/macdeploy/DS_Store - $(INSTALL) $< $@ + $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@ + +$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN) + $< "$@" "$(OSX_VOLNAME)" $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2 diff --git a/configure.ac b/configure.ac index 63a745393e..732f550be2 100644 --- a/configure.ac +++ b/configure.ac @@ -314,6 +314,9 @@ case $host in AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) AC_PATH_TOOL([OTOOL], [otool], otool) AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) + AC_PATH_PROGS([CAIROSVG], [cairosvg cairosvg-py3 cairosvg-py2],cairosvg) + AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert) + AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp) dnl libtool will try to strip the static lib, which is a problem for dnl cross-builds because strip attempts to call a hard-coded ld, diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml index aa9494b7ed..d349a13dd2 100644 --- a/contrib/gitian-descriptors/gitian-osx-signer.yml +++ b/contrib/gitian-descriptors/gitian-osx-signer.yml @@ -33,6 +33,7 @@ script: | SIGNED=bitcoin-osx-signed.dmg tar -xf ${UNSIGNED} + OSX_VOLNAME="$(cat osx_volname)" ./detached-sig-apply.sh ${UNSIGNED} signature/osx - ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -apple -o uncompressed.dmg signed-app + ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "${OSX_VOLNAME}" -no-pad -r -apple -o uncompressed.dmg signed-app ${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED} diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 9ac774c8a0..13dbe890c9 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -10,14 +10,22 @@ packages: - "git-core" - "pkg-config" - "autoconf" +- "libffi-dev" +- "libtiff-tools" - "libtool" - "automake" - "faketime" - "bsdmainutils" - "cmake" +- "imagemagick" - "libcap-dev" +- "libxslt-dev" - "libz-dev" - "libbz2-dev" +- "python-cairo" +- "python-dev" +- "python-pip" +- "fonts-tuffy" reference_datetime: "2015-06-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" @@ -25,6 +33,10 @@ remotes: files: - "MacOSX10.9.sdk.tar.gz" script: | + # FIXME: We should probably install these in some other (cachable) way, but the depends system doesn't appear to make native packages available to Core's build system itself? + pip install --user mac_alias ds_store cairosvg cssselect tinycss lxml + export PATH="$HOME/.local/bin:$PATH" + WRAP_DIR=$HOME/wrapped HOSTS="x86_64-apple-darwin11" CONFIGFLAGS="--enable-reduce-exports GENISOIMAGE=$WRAP_DIR/genisoimage" @@ -107,8 +119,11 @@ script: | make ${MAKEOPTS} make install-strip + make osx_volname make deploydir + OSX_VOLNAME="$(cat osx_volname)" mkdir -p unsigned-app-${i} + cp osx_volname unsigned-app-${i}/ cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i} cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i} cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i} @@ -120,7 +135,7 @@ script: | popd make deploy - ${WRAP_DIR}/dmg dmg Bitcoin-Core.dmg ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg + ${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg cd installed find . -name "lib*.la" -delete diff --git a/contrib/macdeploy/Base.lproj/InfoPlist.strings b/contrib/macdeploy/Base.lproj/InfoPlist.strings deleted file mode 100644 index b259ea141c..0000000000 --- a/contrib/macdeploy/Base.lproj/InfoPlist.strings +++ /dev/null @@ -1 +0,0 @@ -{ CFBundleDisplayName = "Bitcoin Core"; CFBundleName = "Bitcoin Core"; } diff --git a/contrib/macdeploy/DS_Store b/contrib/macdeploy/DS_Store deleted file mode 100644 index db9d16f1d7..0000000000 Binary files a/contrib/macdeploy/DS_Store and /dev/null differ diff --git a/contrib/macdeploy/background.png b/contrib/macdeploy/background.png deleted file mode 100644 index f88a2ae74b..0000000000 Binary files a/contrib/macdeploy/background.png and /dev/null differ diff --git a/contrib/macdeploy/background.psd b/contrib/macdeploy/background.psd deleted file mode 100644 index fdc4f4ca4a..0000000000 Binary files a/contrib/macdeploy/background.psd and /dev/null differ diff --git a/contrib/macdeploy/background.svg b/contrib/macdeploy/background.svg new file mode 100644 index 0000000000..6ab6a23e63 --- /dev/null +++ b/contrib/macdeploy/background.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + PACKAGE_NAME + + + + + diff --git a/contrib/macdeploy/background.tiff b/contrib/macdeploy/background.tiff deleted file mode 100644 index 4b44ac672e..0000000000 Binary files a/contrib/macdeploy/background.tiff and /dev/null differ diff --git a/contrib/macdeploy/background@2x.png b/contrib/macdeploy/background@2x.png deleted file mode 100644 index 4858183f75..0000000000 Binary files a/contrib/macdeploy/background@2x.png and /dev/null differ diff --git a/contrib/macdeploy/custom_dsstore.py b/contrib/macdeploy/custom_dsstore.py new file mode 100755 index 0000000000..8481e903a0 --- /dev/null +++ b/contrib/macdeploy/custom_dsstore.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# Copyright (c) 2013-2015 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +import biplist +from ds_store import DSStore +from mac_alias import Alias +import sys + +output_file = sys.argv[1] +package_name_ns = sys.argv[2] + +ds = DSStore.open(output_file, 'w+') +ds['.']['bwsp'] = { + 'ShowStatusBar': False, + 'WindowBounds': '{{300, 280}, {500, 343}}', + 'ContainerShowSidebar': False, + 'SidebarWidth': 0, + 'ShowTabView': False, + 'PreviewPaneVisibility': False, + 'ShowToolbar': False, + 'ShowSidebar': False, + 'ShowPathbar': True +} + +icvp = { + 'gridOffsetX': 0.0, + 'textSize': 12.0, + 'viewOptionsVersion': 1, + 'backgroundImageAlias': '\x00\x00\x00\x00\x02\x1e\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x94\\\xb0H+\x00\x05\x00\x00\x00\x98\x0fbackground.tiff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\xd19\xb0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\r\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b.background\x00\x00\x10\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x11\x00\x08\x00\x00\xd19\xb0\xf8\x00\x00\x00\x01\x00\x04\x00\x00\x00\x98\x00\x0e\x00 \x00\x0f\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\x00.\x00t\x00i\x00f\x00f\x00\x0f\x00\x02\x00\x00\x00\x12\x00\x1c/.background/background.tiff\x00\x14\x01\x06\x00\x00\x00\x00\x01\x06\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x97\xab\xc3H+\x00\x00\x01\x88[\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02u\xab\x8d\xd1\x94\\\xb0devrddsk\xff\xff\xff\xff\x00\x00\t \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07bitcoin\x00\x00\x10\x00\x08\x00\x00\xce\x97\xab\xc3\x00\x00\x00\x11\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x01\x00\x14\x01\x88[\x88\x00\x16\xa9\t\x00\x08\xfaR\x00\x08\xfaQ\x00\x02d\x8e\x00\x0e\x00\x02\x00\x00\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x14\xff\xff\x00\x00\xff\xff\x00\x00', + 'backgroundColorBlue': 1.0, + 'iconSize': 96.0, + 'backgroundColorGreen': 1.0, + 'arrangeBy': 'none', + 'showIconPreview': True, + 'gridSpacing': 100.0, + 'gridOffsetY': 0.0, + 'showItemInfo': False, + 'labelOnBottom': True, + 'backgroundType': 2, + 'backgroundColorRed': 1.0 +} +alias = Alias.from_bytes(icvp['backgroundImageAlias']) +alias.volume.name = package_name_ns +alias.volume.posix_path = '/Volumes/' + package_name_ns +alias.volume.disk_image_alias.target.filename = package_name_ns + '.temp.dmg' +alias.volume.disk_image_alias.target.carbon_path = 'Macintosh HD:Users:\x00bitcoinuser:\x00Documents:\x00bitcoin:\x00bitcoin:\x00' + package_name_ns + '.temp.dmg' +alias.volume.disk_image_alias.target.posix_path = 'Users/bitcoinuser/Documents/bitcoin/bitcoin/' + package_name_ns + '.temp.dmg' +alias.target.carbon_path = package_name_ns + ':.background:\x00background.tiff' +icvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes()) +ds['.']['icvp'] = icvp + +ds['.']['vSrn'] = ('long', 1) + +ds['Applications']['Iloc'] = (370, 156) +ds['Bitcoin-Qt.app']['Iloc'] = (128, 156) + +ds.flush() +ds.close() diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index 2253c40af1..7e6270c743 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -495,6 +495,7 @@ ap.add_argument("-fancy", nargs=1, metavar="plist", default=[], help="make a fan ap.add_argument("-add-qt-tr", nargs=1, metavar="languages", default=[], help="add Qt translation files to the bundle's ressources; the language list must be separated with commas, not with whitespace") ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translation files") ap.add_argument("-add-resources", nargs="+", metavar="path", default=[], help="list of additional files or folders to be copied into the bundle's resources; must be the last argument") +ap.add_argument("-volname", nargs=1, metavar="volname", default=[], help="custom volume name for dmg") config = ap.parse_args() @@ -596,6 +597,13 @@ if os.path.exists("dist"): # ------------------------------------------------ +if len(config.volname) == 1: + volname = config.volname[0] +else: + volname = app_bundle_name + +# ------------------------------------------------ + target = os.path.join("dist", "Bitcoin-Qt.app") if verbose >= 2: @@ -757,7 +765,7 @@ if config.dmg is not None: if fancy is None: try: - runHDIUtil("create", dmg_name, srcfolder="dist", format="UDBZ", volname="Bitcoin-Core", ov=True) + runHDIUtil("create", dmg_name, srcfolder="dist", format="UDBZ", volname=volname, ov=True) except subprocess.CalledProcessError as e: sys.exit(e.returncode) else: @@ -772,7 +780,7 @@ if config.dmg is not None: if verbose >= 3: print "Creating temp image for modification..." try: - runHDIUtil("create", dmg_name + ".temp", srcfolder="dist", format="UDRW", size=size, volname="Bitcoin-Core", ov=True) + runHDIUtil("create", dmg_name + ".temp", srcfolder="dist", format="UDRW", size=size, volname=volname, ov=True) except subprocess.CalledProcessError as e: sys.exit(e.returncode) @@ -837,7 +845,7 @@ if config.dmg is not None: items_positions.append(itemscript.substitute(params)) params = { - "disk" : "Bitcoin-Core", + "disk" : volname, "window_bounds" : "300,300,800,620", "icon_size" : "96", "background_commands" : "", diff --git a/doc/README_osx.txt b/doc/README_osx.txt index f589bfc676..c13efaa145 100644 --- a/doc/README_osx.txt +++ b/doc/README_osx.txt @@ -63,9 +63,8 @@ functionality is broken. Only the compression feature is currently used. Ideally, the creation could be fixed and genisoimage would no longer be necessary. Background images and other features can be added to DMG files by inserting a -.DS_Store before creation. The easiest way to create this file is to build a -DMG without one, move it to a device running OS X, customize the layout, then -grab the .DS_Store file for later use. That is the approach taken here. +.DS_Store before creation. This is generated by the script +contrib/macdeploy/custom_dsstore.py. As of OS X Mavericks (10.9), using an Apple-blessed key to sign binaries is a requirement in order to satisfy the new Gatekeeper requirements. Because this -- cgit v1.2.3 From e611b6e3290ee08b5c77b6d68f906ce48cc5731d Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 17 Dec 2015 20:40:05 +0000 Subject: macdeploy: Use rsvg-convert rather than cairosvg --- .travis.yml | 4 ++-- Makefile.am | 2 +- configure.ac | 2 +- contrib/gitian-descriptors/gitian-osx.yml | 6 ++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 673a0d0a59..28dcfad0b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ matrix: - compiler: ": No wallet" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - compiler: ": Cross-Mac" - env: HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev libz-dev libbz2-dev libffi-dev libtiff-tools python-dev python-pip" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" + env: HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python-pip" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" exclude: - compiler: gcc install: @@ -49,7 +49,7 @@ install: - if [ -n "$PPA" ]; then travis_retry sudo add-apt-repository "$PPA" -y; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi - - if [[ "$HOST" =~ apple ]]; then pip install --user cairosvg mac_alias ds_store; export PATH="$HOME/.local/bin:$PATH"; ( wget 'https://bitbucket.org/al45tair/ds_store/get/c80c23706eae.tar.gz' && tar -xzvpf c80c23706eae.tar.gz && cd al45tair-ds_store-c80c23706eae/ && python setup.py install --user; ) fi + - if [[ "$HOST" =~ apple ]]; then pip install --user mac_alias ds_store; export PATH="$HOME/.local/bin:$PATH"; ( wget 'https://bitbucket.org/al45tair/ds_store/get/c80c23706eae.tar.gz' && tar -xzvpf c80c23706eae.tar.gz && cd al45tair-ds_store-c80c23706eae/ && python setup.py install --user; ) fi before_script: - unset CC; unset CXX - mkdir -p depends/SDKs depends/sdk-sources diff --git a/Makefile.am b/Makefile.am index f9fca357c5..4522784971 100644 --- a/Makefile.am +++ b/Makefile.am @@ -123,7 +123,7 @@ $(OSX_DMG): $(APP_DIST_EXTRAS) $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG) - sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(CAIROSVG) -fpng -d$* - | $(IMAGEMAGICK_CONVERT) - $@ + sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@ OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE)) $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES) $(MKDIR_P) $(@D) diff --git a/configure.ac b/configure.ac index 732f550be2..b555b11ff9 100644 --- a/configure.ac +++ b/configure.ac @@ -314,7 +314,7 @@ case $host in AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool) AC_PATH_TOOL([OTOOL], [otool], otool) AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage) - AC_PATH_PROGS([CAIROSVG], [cairosvg cairosvg-py3 cairosvg-py2],cairosvg) + AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert) AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert) AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp) diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 13dbe890c9..f7b68739e7 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -10,7 +10,7 @@ packages: - "git-core" - "pkg-config" - "autoconf" -- "libffi-dev" +- "librsvg2-bin" - "libtiff-tools" - "libtool" - "automake" @@ -19,10 +19,8 @@ packages: - "cmake" - "imagemagick" - "libcap-dev" -- "libxslt-dev" - "libz-dev" - "libbz2-dev" -- "python-cairo" - "python-dev" - "python-pip" - "fonts-tuffy" @@ -34,7 +32,7 @@ files: - "MacOSX10.9.sdk.tar.gz" script: | # FIXME: We should probably install these in some other (cachable) way, but the depends system doesn't appear to make native packages available to Core's build system itself? - pip install --user mac_alias ds_store cairosvg cssselect tinycss lxml + pip install --user mac_alias ds_store export PATH="$HOME/.local/bin:$PATH" WRAP_DIR=$HOME/wrapped -- cgit v1.2.3 From de619a37fd18a17225c8a10b828fc61958abe4cf Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 17 Dec 2015 16:43:56 -0500 Subject: depends: Pass PYTHONPATH along to configure --- Makefile.am | 1 + configure.ac | 2 ++ depends/config.site.in | 1 + 3 files changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index 4522784971..e293e4fc34 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = src .PHONY: deploy FORCE GZIP_ENV="-9n" +export PYTHONPATH if BUILD_BITCOIN_LIBS pkgconfigdir = $(libdir)/pkgconfig diff --git a/configure.ac b/configure.ac index b555b11ff9..1aa6aac4bf 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,8 @@ AC_PATH_PROG(CCACHE,ccache) AC_PATH_PROG(XGETTEXT,xgettext) AC_PATH_PROG(HEXDUMP,hexdump) +AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files) + dnl pkg-config check. PKG_PROG_PKG_CONFIG diff --git a/depends/config.site.in b/depends/config.site.in index 873f66018d..984ddb1e62 100644 --- a/depends/config.site.in +++ b/depends/config.site.in @@ -66,6 +66,7 @@ CXX="@CXX@" OBJC="${CC}" OBJCXX="${CXX}" CCACHE=$prefix/native/bin/ccache +PYTHONPATH=$prefix/native/lib/python/dist-packages:$PYTHONPATH if test -n "@AR@"; then AR=@AR@ -- cgit v1.2.3 From 82a2d98d9a824242197fbd9ceca4bc66b487a457 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 17 Dec 2015 16:43:56 -0500 Subject: depends: Add ds_store to depends --- depends/packages/native_biplist.mk | 15 +++++++++++++++ depends/packages/native_ds_store.mk | 17 +++++++++++++++++ depends/packages/packages.mk | 4 +++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 depends/packages/native_biplist.mk create mode 100644 depends/packages/native_ds_store.mk diff --git a/depends/packages/native_biplist.mk b/depends/packages/native_biplist.mk new file mode 100644 index 0000000000..eb8672d556 --- /dev/null +++ b/depends/packages/native_biplist.mk @@ -0,0 +1,15 @@ +package=native_biplist +$(package)_version=0.9 +$(package)_download_path=https://pypi.python.org/packages/source/b/biplist +$(package)_file_name=biplist-$($(package)_version).tar.gz +$(package)_sha256_hash=b57cadfd26e4754efdf89e9e37de87885f9b5c847b2615688ca04adfaf6ca604 +$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages + +define $(package)_build_cmds + python setup.py build +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_install_libdir) && \ + python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) +endef diff --git a/depends/packages/native_ds_store.mk b/depends/packages/native_ds_store.mk new file mode 100644 index 0000000000..8e902af1b6 --- /dev/null +++ b/depends/packages/native_ds_store.mk @@ -0,0 +1,17 @@ +package=native_ds_store +$(package)_version=c80c23706eae +$(package)_download_path=https://bitbucket.org/al45tair/ds_store/get +$(package)_download_file=$($(package)_version).tar.bz2 +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=ce1aa412211610c63d567bbe3e06213006a2d5ba5d76d89399c151b5472cb0da +$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages +$(package)_dependencies=native_biplist + +define $(package)_build_cmds + python setup.py build +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_install_libdir) && \ + python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 02cc188420..d2b09ef0a4 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -15,6 +15,8 @@ wallet_packages=bdb upnp_packages=miniupnpc +darwin_native_packages = native_biplist native_ds_store + ifneq ($(build_os),darwin) -darwin_native_packages=native_cctools native_cdrkit native_libdmg-hfsplus +darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus endif -- cgit v1.2.3 From 902ccde85e7464363a94d8492b3e6c49ab755058 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 18 Dec 2015 12:27:26 +0000 Subject: depends: Add mac_alias to depends --- depends/packages/native_mac_alias.mk | 16 ++++++++++++++++ depends/packages/packages.mk | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 depends/packages/native_mac_alias.mk diff --git a/depends/packages/native_mac_alias.mk b/depends/packages/native_mac_alias.mk new file mode 100644 index 0000000000..d117c1c9a3 --- /dev/null +++ b/depends/packages/native_mac_alias.mk @@ -0,0 +1,16 @@ +package=native_mac_alias +$(package)_version=1.1.0 +$(package)_download_path=https://bitbucket.org/al45tair/mac_alias/get +$(package)_download_file=v$($(package)_version).tar.bz2 +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=87ad827e66790028361e43fc754f68ed041a9bdb214cca03c853f079b04fb120 +$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages + +define $(package)_build_cmds + python setup.py build +endef + +define $(package)_stage_cmds + mkdir -p $($(package)_install_libdir) && \ + python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index d2b09ef0a4..59b009b66a 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -15,7 +15,7 @@ wallet_packages=bdb upnp_packages=miniupnpc -darwin_native_packages = native_biplist native_ds_store +darwin_native_packages = native_biplist native_ds_store native_mac_alias ifneq ($(build_os),darwin) darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus -- cgit v1.2.3 From c39a6fffd789cb3591ae859c1464703c5fa7f668 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 18 Dec 2015 12:27:49 +0000 Subject: Travis & gitian-osx: Use depends for ds_store and mac_alias modules --- .travis.yml | 3 +-- contrib/gitian-descriptors/gitian-osx.yml | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28dcfad0b8..cedd8bdf95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ matrix: - compiler: ": No wallet" env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - compiler: ": Cross-Mac" - env: HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python-pip" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" + env: HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" exclude: - compiler: gcc install: @@ -49,7 +49,6 @@ install: - if [ -n "$PPA" ]; then travis_retry sudo add-apt-repository "$PPA" -y; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi - - if [[ "$HOST" =~ apple ]]; then pip install --user mac_alias ds_store; export PATH="$HOME/.local/bin:$PATH"; ( wget 'https://bitbucket.org/al45tair/ds_store/get/c80c23706eae.tar.gz' && tar -xzvpf c80c23706eae.tar.gz && cd al45tair-ds_store-c80c23706eae/ && python setup.py install --user; ) fi before_script: - unset CC; unset CXX - mkdir -p depends/SDKs depends/sdk-sources diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index f7b68739e7..50b914ab6f 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -22,7 +22,6 @@ packages: - "libz-dev" - "libbz2-dev" - "python-dev" -- "python-pip" - "fonts-tuffy" reference_datetime: "2015-06-01 00:00:00" remotes: @@ -31,10 +30,6 @@ remotes: files: - "MacOSX10.9.sdk.tar.gz" script: | - # FIXME: We should probably install these in some other (cachable) way, but the depends system doesn't appear to make native packages available to Core's build system itself? - pip install --user mac_alias ds_store - export PATH="$HOME/.local/bin:$PATH" - WRAP_DIR=$HOME/wrapped HOSTS="x86_64-apple-darwin11" CONFIGFLAGS="--enable-reduce-exports GENISOIMAGE=$WRAP_DIR/genisoimage" -- cgit v1.2.3 From 917b1d03cf3afa6939113e2fb0bf89dbfd9db2d7 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 22 Dec 2015 12:29:13 +0000 Subject: Set copyright holders displayed in notices separately from the package name This helps avoid accidental removal of upstream copyright names --- configure.ac | 7 +++++++ share/qt/Info.plist.in | 2 +- share/qt/extract_strings_qt.py | 1 + src/Makefile.qt.include | 2 +- src/clientversion.h | 2 +- src/init.cpp | 2 +- src/qt/splashscreen.cpp | 2 +- src/util.cpp | 7 +++++++ src/util.h | 2 ++ 9 files changed, 22 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 1aa6aac4bf..5d4468e51b 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,8 @@ define(_CLIENT_VERSION_REVISION, 99) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, false) define(_COPYRIGHT_YEAR, 2015) +define(_COPYRIGHT_HOLDERS,[The %s developers]) +define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[Bitcoin Core]) AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) @@ -912,12 +914,17 @@ AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision]) AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build]) AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release]) AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release]) +AC_DEFINE(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS", [Copyright holder(s) before %s replacement]) +define(_COPYRIGHT_HOLDERS_FINAL, patsubst(_COPYRIGHT_HOLDERS, [%s], [AC_PACKAGE_NAME])) +AC_DEFINE(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL", [Copyright holder(s)]) AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR) AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR) AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION) AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD) AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) +AC_SUBST(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS") +AC_SUBST(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL") AC_SUBST(RELDFLAGS) AC_SUBST(HARDENED_CXXFLAGS) diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index d1a9ed7040..6a34d64cd5 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -17,7 +17,7 @@ APPL CFBundleGetInfoString - @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ The @PACKAGE_NAME@ developers + @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@ CFBundleShortVersionString @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 045eb27f47..470d1f2b49 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -71,6 +71,7 @@ f.write(""" """) f.write('static const char UNUSED *bitcoin_strings[] = {\n') f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),)) +f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),)) messages.sort(key=operator.itemgetter(0)) for (msgid, msgstr) in messages: if msgid != EMPTY: diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index c93667038f..2d5e715ee5 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -382,7 +382,7 @@ SECONDARY: $(QT_QM) qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" - $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" ../share/qt/extract_strings_qt.py $^ + $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" ../share/qt/extract_strings_qt.py $^ translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) @test -n $(LUPDATE) || echo "lupdate is required for updating translations" diff --git a/src/clientversion.h b/src/clientversion.h index ba15ebf3bd..6157423f06 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -38,7 +38,7 @@ #define DO_STRINGIZE(X) #X //! Copyright string used in Windows .rc files -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The " PACKAGE_NAME " Developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " " COPYRIGHT_HOLDERS_FINAL /** * bitcoind-res.rc includes this file, but it cannot cope with real c++ code. diff --git a/src/init.cpp b/src/init.cpp index 4bcf8ec78b..8a9cc6d960 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -513,7 +513,7 @@ std::string HelpMessage(HelpMessageMode mode) std::string LicenseInfo() { // todo: remove urls from translations on next change - return FormatParagraph(strprintf(_("Copyright (C) %i-%i The %s Developers"), 2009, COPYRIGHT_YEAR, _(PACKAGE_NAME))) + "\n" + + return FormatParagraph(strprintf(_("Copyright (C) %i-%i %s"), 2009, COPYRIGHT_YEAR, CopyrightHolders())) + "\n" + "\n" + FormatParagraph(_("This is experimental software.")) + "\n" + "\n" + diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index ad8d7b3f23..facee62ea1 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -44,7 +44,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) // define text to place QString titleText = tr(PACKAGE_NAME); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText = QChar(0xA9)+QString(" %1-%2 ").arg(2009).arg(COPYRIGHT_YEAR) + QString(tr("The %1 developers").arg(tr(PACKAGE_NAME))); + QString copyrightText = QChar(0xA9)+QString(" %1-%2 ").arg(2009).arg(COPYRIGHT_YEAR) + QString::fromStdString(CopyrightHolders()); QString titleAddText = networkStyle->getTitleAddText(); QString font = QApplication::font().toString(); diff --git a/src/util.cpp b/src/util.cpp index e8514a2ef0..66dd45dc8c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -834,3 +834,10 @@ int GetNumCores() #endif } +std::string CopyrightHolders() +{ + std::string strCopyrightHolders = _(COPYRIGHT_HOLDERS); + if (strCopyrightHolders.find("%s") == strCopyrightHolders.npos) + return strCopyrightHolders; + return strprintf(strCopyrightHolders, _(PACKAGE_NAME)); +} diff --git a/src/util.h b/src/util.h index b2779fe782..88e1fe9fb3 100644 --- a/src/util.h +++ b/src/util.h @@ -242,4 +242,6 @@ template void TraceThread(const char* name, Callable func) } } +std::string CopyrightHolders(); + #endif // BITCOIN_UTIL_H -- cgit v1.2.3 From e4ab5e5f432c11101ff6ef5a54180781222b75a5 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 22 Dec 2015 12:31:33 +0000 Subject: Bugfix: Correct copyright year in Mac DMG background image --- contrib/macdeploy/background.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/macdeploy/background.svg b/contrib/macdeploy/background.svg index 6ab6a23e63..9c330af451 100644 --- a/contrib/macdeploy/background.svg +++ b/contrib/macdeploy/background.svg @@ -3,7 +3,7 @@ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> -- cgit v1.2.3 From 4d5a3df9d4ea920bb2c63e17a044d14f3eb0fe90 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 22 Dec 2015 13:27:22 +0000 Subject: Bugfix: gitian-descriptors: Add missing python-setuptools requirement for OS X (biplist module) --- contrib/gitian-descriptors/gitian-osx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 50b914ab6f..0eb97d6a76 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -22,6 +22,7 @@ packages: - "libz-dev" - "libbz2-dev" - "python-dev" +- "python-setuptools" - "fonts-tuffy" reference_datetime: "2015-06-01 00:00:00" remotes: -- cgit v1.2.3 From 3cae14056a1cd8f01dc4943fa0b78315734d741a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 19 Jan 2016 08:42:05 +0000 Subject: Bugfix: Actually use _COPYRIGHT_HOLDERS_SUBSTITUTION everywhere --- configure.ac | 3 ++- share/qt/extract_strings_qt.py | 2 ++ src/Makefile.qt.include | 2 +- src/util.cpp | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 5d4468e51b..c90187845c 100644 --- a/configure.ac +++ b/configure.ac @@ -915,7 +915,8 @@ AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build]) AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release]) AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release]) AC_DEFINE(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS", [Copyright holder(s) before %s replacement]) -define(_COPYRIGHT_HOLDERS_FINAL, patsubst(_COPYRIGHT_HOLDERS, [%s], [AC_PACKAGE_NAME])) +AC_DEFINE(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION", [Replacement for %s in copyright holders string]) +define(_COPYRIGHT_HOLDERS_FINAL, patsubst(_COPYRIGHT_HOLDERS, [%s], [_COPYRIGHT_HOLDERS_SUBSTITUTION])) AC_DEFINE(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL", [Copyright holder(s)]) AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR) AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR) diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 470d1f2b49..2a6e4b930c 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -72,6 +72,8 @@ f.write(""" f.write('static const char UNUSED *bitcoin_strings[] = {\n') f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('PACKAGE_NAME'),)) f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS'),)) +if os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'): + f.write('QT_TRANSLATE_NOOP("bitcoin-core", "%s"),\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),)) messages.sort(key=operator.itemgetter(0)) for (msgid, msgstr) in messages: if msgid != EMPTY: diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 2d5e715ee5..c2ecaa7876 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -382,7 +382,7 @@ SECONDARY: $(QT_QM) qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" - $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" ../share/qt/extract_strings_qt.py $^ + $(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME="$(PACKAGE_NAME)" COPYRIGHT_HOLDERS="$(COPYRIGHT_HOLDERS)" COPYRIGHT_HOLDERS_SUBSTITUTION="$(COPYRIGHT_HOLDERS_SUBSTITUTION)" ../share/qt/extract_strings_qt.py $^ translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) @test -n $(LUPDATE) || echo "lupdate is required for updating translations" diff --git a/src/util.cpp b/src/util.cpp index 66dd45dc8c..0439ead476 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -839,5 +839,5 @@ std::string CopyrightHolders() std::string strCopyrightHolders = _(COPYRIGHT_HOLDERS); if (strCopyrightHolders.find("%s") == strCopyrightHolders.npos) return strCopyrightHolders; - return strprintf(strCopyrightHolders, _(PACKAGE_NAME)); + return strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION)); } -- cgit v1.2.3 From 78ec83ddfe0e49d18c572b37681e60b9435b2ab4 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 27 Jan 2016 20:28:04 +0000 Subject: splashscreen: Resize text to fit exactly --- src/qt/splashscreen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index facee62ea1..4d745088ac 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -79,10 +79,9 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) // check font size and drawing with pixPaint.setFont(QFont(font, 33*fontFactor)); QFontMetrics fm = pixPaint.fontMetrics(); - int titleTextWidth = fm.width(titleText); - if(titleTextWidth > 160) { - // strange font rendering, Arial probably not found - fontFactor = 0.75; + int titleTextWidth = fm.width(titleText); + if (titleTextWidth > 176) { + fontFactor = fontFactor * 176 / titleTextWidth; } pixPaint.setFont(QFont(font, 33*fontFactor)); -- cgit v1.2.3 From 29598e41a51ab7c5c98aa8b9af7941e8ceaaf644 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 28 Jan 2016 04:37:34 +0000 Subject: Move PACKAGE_URL to configure.ac --- configure.ac | 2 +- share/setup.nsi.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c90187845c..9cd5ff5f30 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ define(_CLIENT_VERSION_IS_RELEASE, false) define(_COPYRIGHT_YEAR, 2015) define(_COPYRIGHT_HOLDERS,[The %s developers]) define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[Bitcoin Core]) -AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin]) +AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[http://bitcoin.org/]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) AC_CONFIG_AUX_DIR([build-aux]) diff --git a/share/setup.nsi.in b/share/setup.nsi.in index 26d3822747..e553a5ae88 100644 --- a/share/setup.nsi.in +++ b/share/setup.nsi.in @@ -7,7 +7,7 @@ SetCompressor /SOLID lzma !define REGKEY "SOFTWARE\$(^Name)" !define VERSION @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@ !define COMPANY "@PACKAGE_NAME@ project" -!define URL http://www.bitcoin.org/ +!define URL @PACKAGE_URL@ # MUI Symbol Definitions !define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico" -- cgit v1.2.3 From cddffaf5e60f638b2acf4d33a4eb43c984825bba Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 28 Jan 2016 04:52:52 +0000 Subject: Bugfix: Include COPYRIGHT_HOLDERS_SUBSTITUTION in Makefile substitutions so it gets passed to extract-strings correctly --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 9cd5ff5f30..1ddb1f4a84 100644 --- a/configure.ac +++ b/configure.ac @@ -925,6 +925,7 @@ AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD) AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) AC_SUBST(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS") +AC_SUBST(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION") AC_SUBST(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL") AC_SUBST(RELDFLAGS) -- cgit v1.2.3 From cc2095ecae3f4ff57d3981b5992e032e564ba65d Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 3 Feb 2016 05:16:49 +0000 Subject: Rewrite FormatParagraph to handle newlines within input strings correctly --- src/test/util_tests.cpp | 21 +++++++++++++++--- src/utilstrencodings.cpp | 56 +++++++++++++++++++++++++++--------------------- 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 997dc31931..1bbd497f78 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -399,12 +399,27 @@ BOOST_AUTO_TEST_CASE(test_FormatParagraph) { BOOST_CHECK_EQUAL(FormatParagraph("", 79, 0), ""); BOOST_CHECK_EQUAL(FormatParagraph("test", 79, 0), "test"); - BOOST_CHECK_EQUAL(FormatParagraph(" test", 79, 0), "test"); + BOOST_CHECK_EQUAL(FormatParagraph(" test", 79, 0), " test"); BOOST_CHECK_EQUAL(FormatParagraph("test test", 79, 0), "test test"); BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 0), "test\ntest"); - BOOST_CHECK_EQUAL(FormatParagraph("testerde test ", 4, 0), "testerde\ntest"); + BOOST_CHECK_EQUAL(FormatParagraph("testerde test", 4, 0), "testerde\ntest"); BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n test"); - BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string. This is a second sentence in the very long test string."), "This is a very long test string. This is a second sentence in the very long\ntest string."); + + // Make sure we don't indent a fully-new line following a too-long line ending + BOOST_CHECK_EQUAL(FormatParagraph("test test\nabc", 4, 4), "test\n test\nabc"); + + BOOST_CHECK_EQUAL(FormatParagraph("This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_returned_as_is_despite_the_length until it gets here", 79), "This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_returned_as_is_despite_the_length\nuntil it gets here"); + + // Test wrap length is exact + BOOST_CHECK_EQUAL(FormatParagraph("a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p", 79), "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\nf g h i j k l m n o p"); + BOOST_CHECK_EQUAL(FormatParagraph("x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p", 79), "x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\nf g h i j k l m n o p"); + // Indent should be included in length of lines + BOOST_CHECK_EQUAL(FormatParagraph("x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg h i j k", 79, 4), "x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\n f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg\n h i j k"); + + BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string. This is a second sentence in the very long test string.", 79), "This is a very long test string. This is a second sentence in the very long\ntest string."); + BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string.\nThis is a second sentence in the very long test string. This is a third sentence in the very long test string.", 79), "This is a very long test string.\nThis is a second sentence in the very long test string. This is a third\nsentence in the very long test string."); + BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string.\n\nThis is a second sentence in the very long test string. This is a third sentence in the very long test string.", 79), "This is a very long test string.\n\nThis is a second sentence in the very long test string. This is a third\nsentence in the very long test string."); + BOOST_CHECK_EQUAL(FormatParagraph("Testing that normal newlines do not get indented.\nLike here.", 79), "Testing that normal newlines do not get indented.\nLike here."); } BOOST_AUTO_TEST_CASE(test_FormatSubVersion) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index c5a2b5cdbb..a098c3e0a6 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -478,34 +478,40 @@ bool ParseDouble(const std::string& str, double *out) std::string FormatParagraph(const std::string& in, size_t width, size_t indent) { std::stringstream out; - size_t col = 0; size_t ptr = 0; - while(ptr < in.size()) + size_t indented = 0; + while (ptr < in.size()) { - // Find beginning of next word - ptr = in.find_first_not_of(' ', ptr); - if (ptr == std::string::npos) - break; - // Find end of next word - size_t endword = in.find_first_of(' ', ptr); - if (endword == std::string::npos) - endword = in.size(); - // Add newline and indentation if this wraps over the allowed width - if (col > 0) - { - if ((col + endword - ptr) > width) - { - out << '\n'; - for(size_t i=0; i Date: Wed, 3 Feb 2016 05:38:27 +0000 Subject: When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen --- src/bitcoind.cpp | 3 ++- src/init.cpp | 9 ++++----- src/qt/splashscreen.cpp | 11 ++++++++--- src/qt/utilitydialog.cpp | 2 +- src/util.cpp | 14 +++++++++----- src/util.h | 2 +- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 440356aa80..9ad5a47869 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -17,6 +17,7 @@ #include "httpserver.h" #include "httprpc.h" #include "rpcserver.h" +#include "utilstrencodings.h" #include #include @@ -82,7 +83,7 @@ bool AppInit(int argc, char* argv[]) if (mapArgs.count("-version")) { - strUsage += LicenseInfo(); + strUsage += FormatParagraph(LicenseInfo()); } else { diff --git a/src/init.cpp b/src/init.cpp index 8a9cc6d960..5746fb5120 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -33,7 +33,6 @@ #include "ui_interface.h" #include "util.h" #include "utilmoneystr.h" -#include "utilstrencodings.h" #include "validationinterface.h" #ifdef ENABLE_WALLET #include "wallet/db.h" @@ -513,13 +512,13 @@ std::string HelpMessage(HelpMessageMode mode) std::string LicenseInfo() { // todo: remove urls from translations on next change - return FormatParagraph(strprintf(_("Copyright (C) %i-%i %s"), 2009, COPYRIGHT_YEAR, CopyrightHolders())) + "\n" + + return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" + "\n" + - FormatParagraph(_("This is experimental software.")) + "\n" + + _("This is experimental software.") + "\n" + "\n" + - FormatParagraph(_("Distributed under the MIT software license, see the accompanying file COPYING or .")) + "\n" + + _("Distributed under the MIT software license, see the accompanying file COPYING or .") + "\n" + "\n" + - FormatParagraph(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.")) + + _("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.") + "\n"; } diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 4d745088ac..21dab957f3 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -44,7 +44,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) // define text to place QString titleText = tr(PACKAGE_NAME); QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText = QChar(0xA9)+QString(" %1-%2 ").arg(2009).arg(COPYRIGHT_YEAR) + QString::fromStdString(CopyrightHolders()); + QString copyrightText = QString::fromUtf8(CopyrightHolders(strprintf("\xc2\xA9 %u-%u ", 2009, COPYRIGHT_YEAR)).c_str()); QString titleAddText = networkStyle->getTitleAddText(); QString font = QApplication::font().toString(); @@ -101,8 +101,13 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText); // draw copyright stuff - pixPaint.setFont(QFont(font, 10*fontFactor)); - pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight,paddingTop+titleCopyrightVSpace,copyrightText); + { + pixPaint.setFont(QFont(font, 10*fontFactor)); + const int x = pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight; + const int y = paddingTop+titleCopyrightVSpace; + QRect copyrightRect(x, y, pixmap.width() - x - paddingRight, pixmap.height() - y); + pixPaint.drawText(copyrightRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, copyrightText); + } // draw additional text if special network if(!titleAddText.isEmpty()) { diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 3e96f26b3a..5fafa57598 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -56,7 +56,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : uri.setMinimal(true); // use non-greedy matching licenseInfoHTML.replace(uri, "\\1"); // Replace newlines with HTML breaks - licenseInfoHTML.replace("\n\n", "

"); + licenseInfoHTML.replace("\n", "
"); ui->aboutMessage->setTextFormat(Qt::RichText); ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); diff --git a/src/util.cpp b/src/util.cpp index 0439ead476..1f6b84119a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -834,10 +834,14 @@ int GetNumCores() #endif } -std::string CopyrightHolders() +std::string CopyrightHolders(const std::string& strPrefix) { - std::string strCopyrightHolders = _(COPYRIGHT_HOLDERS); - if (strCopyrightHolders.find("%s") == strCopyrightHolders.npos) - return strCopyrightHolders; - return strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION)); + std::string strCopyrightHolders = strPrefix + _(COPYRIGHT_HOLDERS); + if (strCopyrightHolders.find("%s") != strCopyrightHolders.npos) { + strCopyrightHolders = strprintf(strCopyrightHolders, _(COPYRIGHT_HOLDERS_SUBSTITUTION)); + } + if (strCopyrightHolders.find("Bitcoin Core developers") == strCopyrightHolders.npos) { + strCopyrightHolders += "\n" + strPrefix + "The Bitcoin Core developers"; + } + return strCopyrightHolders; } diff --git a/src/util.h b/src/util.h index 88e1fe9fb3..5a948c6a9c 100644 --- a/src/util.h +++ b/src/util.h @@ -242,6 +242,6 @@ template void TraceThread(const char* name, Callable func) } } -std::string CopyrightHolders(); +std::string CopyrightHolders(const std::string& strPrefix); #endif // BITCOIN_UTIL_H -- cgit v1.2.3