testing/namecoin: update to 0.3.76

update to 0.3.76
This commit is contained in:
Stuart Cardall 2014-09-14 21:06:06 +00:00 committed by Natanael Copa
parent 2dbd4a1dd4
commit ac3894bded
5 changed files with 39 additions and 346 deletions

View File

@ -1,5 +1,5 @@
--- namecoin-nc0.3.75/src/net.cpp
+++ namecoin-nc0.3.75/src/net.cpp.new
--- namecoin-nc*/src/net.cpp
+++ namecoin-nc*/src/net.cpp
@@ -19,10 +19,10 @@
#endif
@ -15,47 +15,3 @@
#endif
using namespace std;
@@ -1088,8 +1088,7 @@
{
printf("ThreadMapPort started\n");
- char port[6];
- sprintf(port, "%d", GetListenPort());
+ std::string port = strprintf("%u", GetListenPort());
const char * rootdescurl = 0;
const char * multicastif = 0;
@@ -1113,25 +1112,26 @@
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
if (r == 1)
{
- char intClient[16];
- char intPort[6];
+ string strDesc = "Namecoin " + FormatFullVersion();
-#if !defined(__WXMSW__) && !defined(MAC_OSX)
+#ifndef UPNPDISCOVER_SUCCESS
+ /* miniupnpc 1.5 */
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
- port, port, lanaddr, 0, "TCP", 0);
+ port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0);
#else
+ /* miniupnpc 1.6 */
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
- port, port, lanaddr, 0, "TCP", 0, "0");
+ port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), "TCP", 0, "0");
#endif
if(r!=UPNPCOMMAND_SUCCESS)
printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
- port, port, lanaddr, r, strupnperror(r));
+ port.c_str(), port.c_str(), lanaddr, r, strupnperror(r));
else
printf("UPnP Port Mapping successful.\n");
loop {
if (fShutdown || !fUseUPnP)
{
- r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port, "TCP", 0);
+ r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0);
printf("UPNP_DeletePortMapping() returned : %d\n", r);
freeUPNPDevlist(devlist); devlist = 0;
FreeUPNPUrls(&urls);

View File

@ -1,16 +1,16 @@
--- namecoin-nc0.3.75/src/Makefile
+++ namecoin-nc0.3.75/src/Makefile
--- namecoin-nc*/src/Makefile
+++ namecoin-nc*/src/Makefile
@@ -9,24 +9,20 @@
DEFS += -DBOOST_THREAD_USE_LIB
INCLUDEPATHS= \
- -I../libs/openssl-1.0.1h/include \
- -I../libs/openssl-1.0.1i/include \
- -I../libs/db-4.7.25.NC/build_unix \
- -I../libs/boost_1_50_0
+ -I/usr/include
LIBPATHS= \
- -L../libs/openssl-1.0.1h \
- -L../libs/openssl-1.0.1i \
- -L../libs/db-4.7.25.NC/build_unix \
- -L../libs/boost_1_50_0/stage/lib
+ -L/usr/lib

View File

@ -1,19 +1,19 @@
--- namecoin-vQ.3.72/src/init.cpp
+++ namecoin-vQ.3.72/src/init.cpp
@@ -98,6 +98,10 @@
--- namecoin-nc*/src/init.cpp
+++ namecoin-nc*/src/init.cpp
@@ -99,6 +99,10 @@
#ifndef GUI
int main(int argc, char* argv[])
{
+ #ifndef WIN32
+ SetupEnvironment();
+ SetupEnvironment();
+ #endif
+
bool fRet = false;
fRet = AppInit(argc, argv);
--- namecoin-vQ.3.72/src/qt/bitcoin.cpp
+++ namecoin-vQ.3.72/src/qt/bitcoin.cpp
@@ -122,6 +122,10 @@
--- namecoin-nc*/src/qt/bitcoin.cpp
+++ namecoin-nc*/src/qt/bitcoin.cpp
@@ -124,6 +124,10 @@
#ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[])
{
@ -23,12 +23,12 @@
+
// Command-line options take precedence:
ParseParameters(argc, argv);
--- namecoin-vQ.3.72/src/util.cpp
+++ namecoin-vQ.3.72/src/util.cpp
@@ -1101,3 +1101,20 @@
else
return SoftSetArg(strArg, std::string("0"));
--- namecoin-nc*/src/util.cpp
+++ namecoin-nc*/src/util.cpp
@@ -1114,3 +1114,20 @@
}
return true;
}
+
+#ifndef WIN32
@ -47,15 +47,15 @@
+ }
+}
+#endif
--- namecoin-vQ.3.72/src/util.h
+++ namecoin-vQ.3.72/src/util.h
@@ -198,6 +198,8 @@
--- namecoin-nc0.3.76/src/util.h
+++ namecoin-nc0.3.76/src.new/util.h
@@ -211,6 +211,7 @@
void RandAddSeed();
void RandAddSeedPerfmon();
+void SetupEnvironment();
+
int OutputDebugStringF(const char* pszFormat, ...);
int my_snprintf(char* buffer, size_t limit, const char* format, ...);

View File

@ -1,259 +0,0 @@
--- namecoin-nc0.3.75/namecoin-qt.pro
+++ namecoin-nc0.3.75/namecoin-qt.pro
@@ -3,7 +3,8 @@
macx:TARGET = "Namecoin-Qt"
VERSION = 0.3.75
INCLUDEPATH += src src/json src/qt
-QT += network
+QT += core gui network
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
DEFINES += GUI QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd
CONFIG += thread
@@ -118,30 +119,27 @@
# Input
DEPENDPATH += src src/json src/cryptopp src/qt
-NAMECOIN_HEADERS = headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
- script.h allocators.h db.h walletdb.h crypter.h net.h irc.h keystore.h main.h wallet.h bitcoinrpc.h uibase.h ui.h noui.h init.h auxpow.h
+HEADERS += src/headers.h src/strlcpy.h src/serialize.h src/uint256.h src/util.h src/key.h src/bignum.h src/base58.h \
+ src/script.h src/allocators.h src/db.h src/walletdb.h src/crypter.h src/net.h src/irc.h src/keystore.h src/main.h src/wallet.h src/bitcoinrpc.h src/uibase.h src/ui.h src/noui.h src/init.h src/auxpow.h
-NAMECOIN_SOURCES = \
- auxpow.cpp \
- util.cpp \
- key.cpp \
- script.cpp \
- db.cpp \
- walletdb.cpp \
- crypter.cpp \
- net.cpp \
- irc.cpp \
- keystore.cpp \
- main.cpp \
- wallet.cpp \
- bitcoinrpc.cpp \
- init.cpp \
- cryptopp/sha.cpp \
- cryptopp/cpu.cpp \
- namecoin.cpp
-
-HEADERS += $$join(NAMECOIN_HEADERS, " src/", " src/",)
-SOURCES += $$join(NAMECOIN_SOURCES, " src/", " src/",)
+SOURCES += \
+ src/auxpow.cpp \
+ src/util.cpp \
+ src/key.cpp \
+ src/script.cpp \
+ src/db.cpp \
+ src/walletdb.cpp \
+ src/crypter.cpp \
+ src/net.cpp \
+ src/irc.cpp \
+ src/keystore.cpp \
+ src/main.cpp \
+ src/wallet.cpp \
+ src/bitcoinrpc.cpp \
+ src/init.cpp \
+ src/cryptopp/sha.cpp \
+ src/cryptopp/cpu.cpp \
+ src/namecoin.cpp
HEADERS += \
src/qt/netbase.h \
--- namecoin-nc0.3.75/src/qt/addressbookpage.cpp
+++ namecoin-nc0.3.75.new/src/qt/addressbookpage.cpp
@@ -140,8 +140,13 @@
// Set column widths
ui->tableView->horizontalHeader()->resizeSection(
AddressTableModel::Address, 320);
+#if QT_VERSION < 0x050000
ui->tableView->horizontalHeader()->setResizeMode(
AddressTableModel::Label, QHeaderView::Stretch);
+#else
+ ui->tableView->horizontalHeader()->setSectionResizeMode(
+ AddressTableModel::Label, QHeaderView::Stretch);
+#endif
connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(selectionChanged()));
--- namecoin-nc0.3.75/src/qt/bitcoin.cpp
+++ namecoin-nc0.3.75.new/src/qt/bitcoin.cpp
@@ -20,7 +20,9 @@
#include <boost/filesystem.hpp>
#include <QMessageBox>
+#if QT_VERSION < 0x050000
#include <QTextCodec>
+#endif
#include <QLocale>
#include <QTimer>
#include <QTranslator>
@@ -122,16 +124,14 @@
#ifndef BITCOIN_QT_TEST
int main(int argc, char *argv[])
{
- #ifndef WIN32
- SetupEnvironment();
- #endif
-
// Command-line options take precedence:
ParseParameters(argc, argv);
+#if QT_VERSION < 0x050000
// Internal string conversion is all UTF-8
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());
+#endif
Q_INIT_RESOURCE(bitcoin);
QApplication app(argc, argv);
--- namecoin-nc0.3.75/src/qt/bitcoingui.cpp
+++ namecoin-nc0.3.75.new/src/qt/bitcoingui.cpp
@@ -49,10 +49,16 @@
#include <QDateTime>
#include <QMovie>
#include <QFileDialog>
+#if QT_VERSION < 0x050000
#include <QDesktopServices>
+#else
+#include <QStandardPaths>
+#endif
#include <QTimer>
#include <QDragEnterEvent>
+#if QT_VERSION < 0x050000
#include <QUrl>
+#endif
#include <QMimeData>
#include <QStyle>
@@ -933,7 +939,11 @@
void BitcoinGUI::backupWallet()
{
+#if QT_VERSION < 0x050000
QString saveDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+#else
+ QString saveDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
+#endif
QString filename = QFileDialog::getSaveFileName(this, tr("Backup Wallet"), saveDir, tr("Wallet Data (*.dat)"));
if(!filename.isEmpty()) {
if(!walletModel->backupWallet(filename)) {
--- namecoin-nc0.3.75/src/qt/guiutil.cpp
+++ namecoin-nc0.3.75.new/src/qt/guiutil.cpp
@@ -14,8 +14,12 @@
#include <QDoubleValidator>
#include <QFont>
#include <QLineEdit>
+#if QT_VERSION >= 0x050000
+#include <QUrlQuery>
+#else
#include <QUrl>
-#include <QTextDocument> // For Qt::escape
+#endif
+#include <QTextDocument> // For Qt::mightBeRichText
#include <QAbstractItemView>
#include <QClipboard>
#include <QFileDialog>
@@ -87,7 +91,12 @@
SendCoinsRecipient rv;
rv.address = uri.path();
rv.amount = 0;
+#if QT_VERSION < 0x050000
QList<QPair<QString, QString> > items = uri.queryItems();
+#else
+ QUrlQuery uriQuery(uri);
+ QList<QPair<QString, QString> > items = uriQuery.queryItems();
+#endif
for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)
{
bool fShouldReturnFalse = false;
@@ -140,7 +149,11 @@
QString HtmlEscape(const QString& str, bool fMultiLine)
{
+#if QT_VERSION < 0x050000
QString escaped = Qt::escape(str);
+#else
+ QString escaped = str.toHtmlEscaped();
+#endif
if(fMultiLine)
{
escaped = escaped.replace("\n", "<br>\n");
@@ -175,7 +188,11 @@
QString myDir;
if(dir.isEmpty()) // Default to user documents location
{
+#if QT_VERSION < 0x050000
myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
+#else
+ myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
+#endif
}
else
{
@@ -474,4 +491,4 @@
printf("SHGetSpecialFolderPathA() failed, could not obtain requested path.\n");
return fs::path("");
}
-#endif
\ No newline at end of file
+#endif
--- namecoin-nc0.3.75/src/qt/managenamespage.cpp
+++ namecoin-nc0.3.75.new/src/qt/managenamespage.cpp
@@ -162,8 +162,13 @@
// Set column widths
ui->tableView->horizontalHeader()->resizeSection(
NameTableModel::Name, COLUMN_WIDTH_NAME);
+#if QT_VERSION < 0x050000
ui->tableView->horizontalHeader()->setResizeMode(
NameTableModel::Value, QHeaderView::Stretch);
+#else
+ ui->tableView->horizontalHeader()->setSectionResizeMode(
+ NameTableModel::Value, QHeaderView::Stretch);
+#endif
ui->tableView->horizontalHeader()->resizeSection(
NameTableModel::Address, COLUMN_WIDTH_ADDRESS);
ui->tableView->horizontalHeader()->resizeSection(
--- namecoin-nc0.3.75/src/qt/overviewpage.cpp
+++ namecoin-nc0.3.75.new/src/qt/overviewpage.cpp
@@ -46,7 +46,11 @@
bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool();
QVariant value = index.data(Qt::ForegroundRole);
QColor foreground = option.palette.color(QPalette::Text);
+#if QT_VERSION < 0x050000
if(qVariantCanConvert<QColor>(value))
+#else
+ if(value.canConvert(QMetaType::QColor))
+#endif
{
foreground = qvariant_cast<QColor>(value);
}
--- namecoin-nc0.3.75/src/qt/sendcoinsdialog.cpp
+++ namecoin-nc0.3.75.new/src/qt/sendcoinsdialog.cpp
@@ -94,7 +94,11 @@
QStringList formatted;
foreach(const SendCoinsRecipient &rcp, recipients)
{
+#if QT_VERSION < 0x050000
formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), Qt::escape(rcp.label), rcp.address));
+#else
+ formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), rcp.label.toHtmlEscaped(), rcp.address));
+#endif
}
fNewRecipientAllowed = false;
--- namecoin-nc0.3.75/src/qt/transactionview.cpp
+++ namecoin-nc0.3.75.new/src/qt/transactionview.cpp
@@ -174,7 +174,11 @@
transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Status, 23);
transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Date, 120);
transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Type, 120);
+#if QT_VERSION < 0x050000
transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
+#else
+ transactionView->horizontalHeader()->setSectionResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
+#endif
transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Amount, 100);
}
}

View File

@ -1,7 +1,7 @@
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=namecoin
pkgver=3.75
pkgver=3.76
pkgrel=0
pkgdesc="Namecoin is a peer to peer DNS based on bitcoin"
url="https://github.com/namecoin/namecoin"
@ -13,10 +13,9 @@ makedepends="$depends_dev"
install="$pkgname.post-install $pkgname.pre-install"
subpackages="$pkgname-qt"
source="$pkgname-$pkgver.tar.gz::https://github.com/namecoin/namecoin/archive/nc0.$pkgver.tar.gz
12-fix-miniupnpc.patch
12-fix-miniupnpc.patch
20-boost-multithread-dynamic.patch
31-set-default-env-function.patch
40-build-qt5.patch
$pkgname.initd
$pkgname.conf
"
@ -60,24 +59,21 @@ qt() {
install -Dm755 namecoin-qt "$subpkgdir"/usr/bin/namecoin-qt || return 1
}
md5sums="ee67ce5cc01cbf4dae4c76f56933c465 namecoin-3.75.tar.gz
83a1465c87097c871f92b1518a66dbf8 12-fix-miniupnpc.patch
9d5c1c0945e7dd825c0070cc3c7e0583 20-boost-multithread-dynamic.patch
adcb5d3142435cc278f4f90d2f796094 31-set-default-env-function.patch
8e0dea0fbb6c4582b45a4f8934f7354f 40-build-qt5.patch
md5sums="ec7d7e4cc15dc8a7d8aa6f8cd6102e23 namecoin-3.76.tar.gz
a9491dcb41e00275c5ffaa1f1653134c 12-fix-miniupnpc.patch
e4e43d7420191a94500189fe58a34a9c 20-boost-multithread-dynamic.patch
5fd72171fddc40f88740b8893336e44e 31-set-default-env-function.patch
9ecdbd9e17240075d064498a80fd50bd namecoin.initd
59b2e0e765738ba48f632051fb6917ae namecoin.conf"
sha256sums="6ca938951f408828a3b3d2c3ec3078956aa8a060405eb8f0632f4bfd824d7f98 namecoin-3.75.tar.gz
403bdbad00961620eac497191302448e33b5f7f307b6f10e94089984fbdddafa 12-fix-miniupnpc.patch
17a7aaabd71cc826d58851d58e81e978d2a5134953d477b11ef85292360de5a5 20-boost-multithread-dynamic.patch
48dbfc38b9d2130b2c57ed265d037096d24554c870b56eda65d2e43a614bffc9 31-set-default-env-function.patch
06c1bf0f780fdbc6df2dde73fe6aa3ae185e635ce581664e6a3663f046709f3f 40-build-qt5.patch
sha256sums="bb6c9decc86447ccfc7dca6cd25e8af181f3cd057cc0aa13ba67c143a438e300 namecoin-3.76.tar.gz
583df477b3f85939a5920f8fb00a4cee4ed1643fe28dbddb97938e39757aad51 12-fix-miniupnpc.patch
1b0e2c1c3ca849df816405c9f8dd86e056daed213c3e4c4e72161cabd64e67e8 20-boost-multithread-dynamic.patch
5cadb754f66e100a4b4146eb5178cf21b4d5a1367cf278a7d10d56a5875f181f 31-set-default-env-function.patch
04ae66115343aa8ed7343139a2370b1e570c8ab4397d09457f5f157dd906a204 namecoin.initd
4b413833527929ea863351469a5a4fc1e0ac365fe9df5e8a8304d8667acf8cea namecoin.conf"
sha512sums="96c823aa05ba9cf2f8cc92ebdf71c8c0377baa14f7192c4e6d577f6f9f421dc55b17f35a8d1019d1da917209c2773d78c114e986c2c56f4af5b6b7e2f8867d1c namecoin-3.75.tar.gz
fdf06dcf40d2333728b89c9dcdc6ac0f7330c865578cfccb5daea008d572901d5efc48784bb308c9b0f8e778c0c6e179816e2357e9d92f64c15f6482f9a1b698 12-fix-miniupnpc.patch
f4555776c9bb34bb3e805e07ceb702199df8f07bdc1358e5035a1f05e995a5999dfcc45d24bc79e66b9a40e3f0b3789878816073d5adacd7aa848c4429224da7 20-boost-multithread-dynamic.patch
2ad327f21e685b86ca6767cf4545af29ad82d3593f5e3cc6cf6a64036408fe7bdd05cde98571c1747ece2ccd2fe88b5e77c59594a12a5377486d4e40b16c6096 31-set-default-env-function.patch
ae4651f7695a4efb68859875c1628e552ef6b46721e625bc43618d8142551704d4c85226bd053a14e5f577e438dec45bd61170d529f28ab83944b7e209c11381 40-build-qt5.patch
sha512sums="7f4ee2f49fd136e087a65ca0a1814afe62e285e3b20fdd25033a2c186dc29ed4b1b44238ba5d96b6168c66e64cd975112297eb8049333d939ecdcf80569b9b3d namecoin-3.76.tar.gz
c53e3bff2b57d2137730790e9314b364572a5f3c4e449cc6c9d9d2643bdd980bbaee857a53eceaa22de35688a147675d89d1e427927a14b3d0130c54626c82f9 12-fix-miniupnpc.patch
fc13574fef73cca20178e5895e2327567f40c91d25105d72b301a155f9025bfb494ce337096424fd71da8034fb0544562b8459c1d8ae2598ee503efd5995c6bf 20-boost-multithread-dynamic.patch
1bb4e2b0c3b2a7f952cbc0a8fd8014641eef19875b945cce1c5c648236ccd5fd5a9144d796ca68afddde88b13adaaa1675efc26ec2100149d9e3481569fd95d7 31-set-default-env-function.patch
3048248b3da7300b0b3cb5667283badc17b41e6c90573604fd9ea9eb9933e93f9b1d6288846793b4e7a001a4cae5e52d2ce42e4bdc83e48f72aca6ee0e8ddd43 namecoin.initd
3f92cb9a5f66d0e9e3792691b2e62b929c092030273bb87ebd9564e0c02196a5a9f69c458162f1b35099ac28e9b79b1c4035144b9d2dae4ad3e87d05a40d7ed4 namecoin.conf"