On Sun, Jan 28 2018, Rafael Sadowski <raf...@sizeofvoid.org> wrote:
> Hi OpenBSD texas hold'em lovers,
>
> pokerth 1.1.1 will not compile very well with upcoming boost so I
> decided to update it. Looks like a whole new port. It include patches to
> build with upcoming and current boost.
>
> I played on hand with [6][2] All-In. No luck but the games runs fine on
> amd64.
>
> Bad luck in the game luck in port.
>
> Comments? Ok?

LGTM and seems to work fine, except I don't understand astyle is used?

> Cheers, Rafael Sadowski
>
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/games/pokerth/Makefile,v
> retrieving revision 1.38
> diff -u -p -u -p -r1.38 Makefile
> --- Makefile  26 Dec 2017 19:18:57 -0000      1.38
> +++ Makefile  28 Jan 2018 19:41:20 -0000
> @@ -1,36 +1,37 @@
>  # $OpenBSD: Makefile,v 1.38 2017/12/26 19:18:57 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,26 @@ LIB_DEPENDS=      converters/libiconv \
>               security/libgsasl \
>               textproc/tinyxml
>  
> +BUILD_DEPENDS =      devel/protobuf \
> +             devel/astyle
> +
>  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  &&\
> +             astyle --style=kr --indent=force-tab=4 -n \
> +             --lineend=linux --exclude=src/third_party -r "src/*.h" && \
> +             astyle --style=kr --indent=force-tab=4 -n \
> +                     --lineend=linux --exclude=src/third_party -r "src/*.cpp"
>  
>  post-install:
>       ${INSTALL_PROGRAM} ${WRKBUILD}/pokerth ${PREFIX}/bin
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/games/pokerth/distinfo,v
> retrieving revision 1.9
> diff -u -p -u -p -r1.9 distinfo
> --- distinfo  9 Jul 2014 09:40:49 -0000       1.9
> +++ distinfo  28 Jan 2018 19:41:20 -0000
> @@ -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
> Index: patches/patch-pokerth_pro
> ===================================================================
> RCS file: patches/patch-pokerth_pro
> diff -N patches/patch-pokerth_pro
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-pokerth_pro 28 Jan 2018 19:41:20 -0000
> @@ -0,0 +1,15 @@
> +$OpenBSD$
> +
> +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
> Index: patches/patch-src_core_common_avatarmanager_cpp
> ===================================================================
> RCS file: patches/patch-src_core_common_avatarmanager_cpp
> diff -N patches/patch-src_core_common_avatarmanager_cpp
> --- patches/patch-src_core_common_avatarmanager_cpp   26 Dec 2017 19:18:57 
> -0000      1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -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();
> Index: patches/patch-src_core_common_loghelper_server_cpp
> ===================================================================
> RCS file: patches/patch-src_core_common_loghelper_server_cpp
> diff -N patches/patch-src_core_common_loghelper_server_cpp
> --- patches/patch-src_core_common_loghelper_server_cpp        26 Dec 2017 
> 19:18:57 -0000      1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -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;
> -             }
> Index: patches/patch-src_net_common_clientstate_cpp
> ===================================================================
> RCS file: patches/patch-src_net_common_clientstate_cpp
> diff -N patches/patch-src_net_common_clientstate_cpp
> --- patches/patch-src_net_common_clientstate_cpp      26 Dec 2017 19:18:57 
> -0000      1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -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);
> Index: patches/patch-src_net_common_clientthread_cpp
> ===================================================================
> RCS file: patches/patch-src_net_common_clientthread_cpp
> diff -N patches/patch-src_net_common_clientthread_cpp
> --- patches/patch-src_net_common_clientthread_cpp     26 Dec 2017 19:18:57 
> -0000      1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -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());
> -     }
> Index: patches/patch-src_net_common_downloaderthread_cpp
> ===================================================================
> RCS file: patches/patch-src_net_common_downloaderthread_cpp
> diff -N patches/patch-src_net_common_downloaderthread_cpp
> --- patches/patch-src_net_common_downloaderthread_cpp 26 Dec 2017 19:18:57 
> -0000      1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -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);
> Index: patches/patch-src_net_common_ircthread_cpp
> ===================================================================
> RCS file: patches/patch-src_net_common_ircthread_cpp
> diff -N patches/patch-src_net_common_ircthread_cpp
> --- patches/patch-src_net_common_ircthread_cpp        9 Jul 2014 09:40:49 
> -0000       1.3
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -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>
> Index: patches/patch-src_net_serveraccepthelper_h
> ===================================================================
> RCS file: patches/patch-src_net_serveraccepthelper_h
> diff -N patches/patch-src_net_serveraccepthelper_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_net_serveraccepthelper_h        28 Jan 2018 19:41:20 
> -0000
> @@ -0,0 +1,21 @@
> +$OpenBSD$
> +
> +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));
> Index: patches/patch-src_pokerth_server_cpp
> ===================================================================
> RCS file: patches/patch-src_pokerth_server_cpp
> diff -N patches/patch-src_pokerth_server_cpp
> --- patches/patch-src_pokerth_server_cpp      26 Dec 2017 19:18:57 -0000      
> 1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -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
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/games/pokerth/pkg/PLIST,v
> retrieving revision 1.9
> diff -u -p -u -p -r1.9 PLIST
> --- pkg/PLIST 9 Jul 2014 09:40:49 -0000       1.9
> +++ pkg/PLIST 28 Jan 2018 19:41:20 -0000
> @@ -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
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to