Update pokerth to 1.1.2

- Add additional patches for upcoming boost update to 1.66.0
- HOMEPAGE update
- Makefile tweaks
- Add protoc pre-configure task

ok jca@
This commit is contained in:
rsadowski 2018-01-30 14:47:25 +00:00
parent 102672f0bb
commit 48415e9c19
12 changed files with 64 additions and 161 deletions

View File

@ -1,36 +1,37 @@
# $OpenBSD: Makefile,v 1.38 2017/12/26 19:18:57 rsadowski Exp $
# $OpenBSD: Makefile,v 1.39 2018/01/30 14:47:25 rsadowski Exp $
COMMENT= texas hold'em poker game with online capabilities
#'
BROKEN-hppa = needs atomic ops
V= 1.1.1
DISTNAME= PokerTH-${V}-src
EXTRACT_SUFX= .tar.bz2
PKGNAME= pokerth-${V}
REVISION= 4
DISTNAME = pokerth-1.1.2
CATEGORIES= games x11
HOMEPAGE= http://www.pokerth.net/
HOMEPAGE= https://www.pokerth.net/
# GPLv2
# AGPL3+
PERMIT_PACKAGE_CDROM= Yes
WANTLIB += c m pthread ${COMPILER_LIBCXX}
WANTLIB += ICE lib/qt4/QtGui lib/qt4/QtNetwork lib/qt4/QtSql SDL SDL_mixer SM
WANTLIB += X11 Xext Xi Xinerama Xrender boost_filesystem-mt boost_iostreams-mt
WANTLIB += boost_program_options-mt boost_random-mt boost_regex-mt
WANTLIB += boost_system-mt boost_thread-mt crypto curl fontconfig
WANTLIB += freetype gsasl iconv ircclient protobuf sqlite3 ssl tinyxml
WANTLIB += ${COMPILER_LIBCXX} ICE QtGui QtNetwork QtSql SDL SDL_mixer
WANTLIB += SM X11 Xext Xi Xinerama Xrender boost_chrono-mt boost_filesystem-mt
WANTLIB += boost_iostreams-mt boost_program_options-mt boost_random-mt
WANTLIB += boost_regex-mt boost_system-mt boost_thread-mt c crypto
WANTLIB += curl fontconfig freetype gsasl iconv ircclient m protobuf
WANTLIB += sqlite3 ssl tinyxml
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=pokerth/}
# C++11
COMPILER = base-clang ports-gcc ports-clang
MODULES= devel/qmake \
x11/qt4
MODQMAKE_PROJECTS= pokerth.pro
MODQMAKE_PROJECTS = pokerth.pro
RUN_DEPENDS= devel/desktop-file-utils
LIB_DEPENDS= converters/libiconv \
databases/sqlite3 \
devel/sdl-mixer \
@ -41,14 +42,21 @@ LIB_DEPENDS= converters/libiconv \
security/libgsasl \
textproc/tinyxml
BUILD_DEPENDS = devel/protobuf
CONFIGURE_ENV= HOME=${WRKDIR}
NO_TEST= Yes
USE_GMAKE= Yes
WRKDIST= ${WRKDIR}/${DISTNAME}-rc
MODQMAKE_ARGS += CONFIG+="client"
pre-configure:
cd ${WRKSRC} && \
perl -pi -e 's,-std=gnu\+\+0x,,g' *.pro
protoc --cpp_out=src/third_party/protobuf chatcleaner.proto && \
protoc --cpp_out=src/third_party/protobuf pokerth.proto
post-install:
${INSTALL_PROGRAM} ${WRKBUILD}/pokerth ${PREFIX}/bin

View File

@ -1,2 +1,2 @@
SHA256 (PokerTH-1.1.1-src.tar.bz2) = r+bTiH0v35L9bYnuKVHTsUoNQ7cNuoWNMtQSFKU1c4g=
SIZE (PokerTH-1.1.1-src.tar.bz2) = 19326922
SHA256 (pokerth-1.1.2.tar.gz) = Ass97oB33iDNRJG2YEmxI9i91/okOFX5fIF5NIdcKXo=
SIZE (pokerth-1.1.2.tar.gz) = 21354306

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-pokerth_pro,v 1.1 2018/01/30 14:47:25 rsadowski Exp $
build server
Index: pokerth.pro
--- pokerth.pro.orig
+++ pokerth.pro
@@ -7,6 +7,7 @@ official_server {
}
client: {
SUBDIRS += pokerth_game.pro
+ SUBDIRS += pokerth_server.pro
}
!mac:!gui_800x480:!client:!qml-client {
SUBDIRS += pokerth_server.pro chatcleaner.pro

View File

@ -1,23 +0,0 @@
$OpenBSD: patch-src_core_common_avatarmanager_cpp,v 1.1 2017/12/26 19:18:57 rsadowski Exp $
Index: src/core/common/avatarmanager.cpp
--- src/core/common/avatarmanager.cpp.orig
+++ src/core/common/avatarmanager.cpp
@@ -61,7 +61,7 @@ using namespace std;
using namespace boost::filesystem;
struct AvatarFileState {
- ifstream inputStream;
+ std::ifstream inputStream;
};
AvatarManager::AvatarManager(bool useExternalServer, const std::string &externalServerAddress,
@@ -363,7 +363,7 @@ AvatarManager::StoreAvatarInCache(const MD5Buf &md5buf
path tmpPath(cacheDir);
tmpPath /= (md5buf.ToString() + ext);
string fileName(tmpPath.file_string());
- ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
+ std::ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
if (!o.fail()) {
o.write((const char *)data, size);
o.close();

View File

@ -1,32 +0,0 @@
$OpenBSD: patch-src_core_common_loghelper_server_cpp,v 1.1 2017/12/26 19:18:57 rsadowski Exp $
Index: src/core/common/loghelper_server.cpp
--- src/core/common/loghelper_server.cpp.orig
+++ src/core/common/loghelper_server.cpp
@@ -67,7 +67,7 @@ void
internal_log_err(const string &msg)
{
if (!g_logFile.empty()) {
- ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
+ std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
if (!o.fail()) {
o << second_clock::local_time() << " ERR: " << msg;
o.flush();
@@ -80,7 +80,7 @@ internal_log_msg(const std::string &msg)
{
if (g_logLevel) {
if (!g_logFile.empty()) {
- ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
+ std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
if (!o.fail())
o << second_clock::local_time() << " MSG: " << msg;
}
@@ -92,7 +92,7 @@ internal_log_level(const std::string &msg, int logLeve
{
if (g_logLevel >= logLevel) {
if (!g_logFile.empty()) {
- ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
+ std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
if (!o.fail())
o << second_clock::local_time() << " OUT: " << msg;
}

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-src_net_common_clientstate_cpp,v 1.1 2017/12/26 19:18:57 rsadowski Exp $
Index: src/net/common/clientstate.cpp
--- src/net/common/clientstate.cpp.orig
+++ src/net/common/clientstate.cpp
@@ -302,8 +302,8 @@ ClientStateReadingServerList::Enter(boost::shared_ptr<
// Unzip the file using zlib.
try {
- ifstream inFile(zippedServerListPath.directory_string().c_str(), ios_base::in | ios_base::binary);
- ofstream outFile(xmlServerListPath.directory_string().c_str(), ios_base::out | ios_base::trunc);
+ std::ifstream inFile(zippedServerListPath.directory_string().c_str(), ios_base::in | ios_base::binary);
+ std::ofstream outFile(xmlServerListPath.directory_string().c_str(), ios_base::out | ios_base::trunc);
boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
in.push(boost::iostreams::zlib_decompressor());
in.push(inFile);

View File

@ -1,23 +0,0 @@
$OpenBSD: patch-src_net_common_clientthread_cpp,v 1.1 2017/12/26 19:18:57 rsadowski Exp $
Index: src/net/common/clientthread.cpp
--- src/net/common/clientthread.cpp.orig
+++ src/net/common/clientthread.cpp
@@ -1604,7 +1604,7 @@ void
ClientThread::ReadSessionGuidFromFile()
{
string guidFileName(GetContext().GetCacheDir() + TEMP_GUID_FILENAME);
- ifstream guidStream(guidFileName.c_str(), ios::in | ios::binary);
+ std::ifstream guidStream(guidFileName.c_str(), ios::in | ios::binary);
if (guidStream.good()) {
std::vector<char> tmpGuid(CLIENT_GUID_SIZE);
guidStream.read(&tmpGuid[0], CLIENT_GUID_SIZE);
@@ -1616,7 +1616,7 @@ void
ClientThread::WriteSessionGuidToFile() const
{
string guidFileName(GetContext().GetCacheDir() + TEMP_GUID_FILENAME);
- ofstream guidStream(guidFileName.c_str(), ios::out | ios::trunc | ios::binary);
+ std::ofstream guidStream(guidFileName.c_str(), ios::out | ios::trunc | ios::binary);
if (guidStream.good()) {
guidStream.write(GetContext().GetSessionGuid().c_str(), GetContext().GetSessionGuid().size());
}

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-src_net_common_downloaderthread_cpp,v 1.1 2017/12/26 19:18:57 rsadowski Exp $
Index: src/net/common/downloaderthread.cpp
--- src/net/common/downloaderthread.cpp.orig
+++ src/net/common/downloaderthread.cpp
@@ -96,7 +96,7 @@ DownloaderThread::Main()
// Previous download was finished.
if (m_curDownloadData) {
path filepath(m_curDownloadData->filename);
- ifstream instream(filepath.file_string().c_str(), ios_base::in | ios_base::binary);
+ std::ifstream instream(filepath.file_string().c_str(), ios_base::in | ios_base::binary);
// Find out file size.
// Not fully portable, but works on win/linux/mac.
instream.seekg(0, ios_base::beg);

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-src_net_common_ircthread_cpp,v 1.3 2014/07/09 09:40:49 ajacoutot Exp $
--- src/net/common/ircthread.cpp.orig Fri Jan 10 22:18:20 2014
+++ src/net/common/ircthread.cpp Wed Jul 9 11:16:58 2014
@@ -32,14 +32,14 @@
#include <net/socket_helper.h>
#include <net/ircthread.h>
#include <net/socket_msg.h>
-#include <libircclient/libircclient.h>
+#include <libircclient.h>
// We need to do the following to handle different versions of libircclient.
// Sadly, libircclient doesn't have actual definitions for its versions in its headers.
// However, we can use a definition that appeared in the same version we need
// to check for. Hacky, but hey, it works.
#ifdef LIBIRC_OPTION_SSL_NO_VERIFY
-#include <libircclient/libirc_rfcnumeric.h>
+#include <libirc_rfcnumeric.h>
#endif
#include <boost/algorithm/string/predicate.hpp>

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-src_net_serveraccepthelper_h,v 1.1 2018/01/30 14:47:25 rsadowski Exp $
fix build with boost 1.66
- use io_context instead of io_service
Index: src/net/serveraccepthelper.h
--- src/net/serveraccepthelper.h.orig
+++ src/net/serveraccepthelper.h
@@ -122,8 +122,12 @@ class ServerAcceptHelper : public ServerAcceptInterfac
const boost::system::error_code &error)
{
if (!error) {
+#if BOOST_VERSION < 106600
boost::asio::socket_base::non_blocking_io command(true);
acceptedSocket->io_control(command);
+#else
+ acceptedSocket->non_blocking(true);
+#endif
acceptedSocket->set_option(typename P::no_delay(true));
acceptedSocket->set_option(boost::asio::socket_base::keep_alive(true));
boost::shared_ptr<SessionData> sessionData(new SessionData(acceptedSocket, m_lobbyThread->GetNextSessionId(), m_lobbyThread->GetSessionDataCallback(), *m_ioService));

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-src_pokerth_server_cpp,v 1.1 2017/12/26 19:18:57 rsadowski Exp $
Index: src/pokerth_server.cpp
--- src/pokerth_server.cpp.orig
+++ src/pokerth_server.cpp
@@ -161,7 +161,7 @@ main(int argc, char *argv[])
pidFile = tmpPidPath.directory_string();
}
{
- ofstream pidStream(pidFile.c_str(), ios_base::out | ios_base::trunc);
+ std::ofstream pidStream(pidFile.c_str(), ios_base::out | ios_base::trunc);
if (!pidStream.fail())
pidStream << getpid();
else

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.9 2014/07/09 09:40:49 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.10 2018/01/30 14:47:25 rsadowski Exp $
@bin bin/pokerth
@bin bin/pokerth_server
share/applications/pokerth.desktop
@ -423,6 +423,7 @@ share/pokerth/data/misc/agpl.html
share/pokerth/data/misc/third_party_libs.txt
share/pokerth/data/sounds/
share/pokerth/data/sounds/default/
share/pokerth/data/sounds/default/.directory
share/pokerth/data/sounds/default/allin.wav
share/pokerth/data/sounds/default/bet.wav
share/pokerth/data/sounds/default/blinds_raises_level1.wav