me
/
guix
Archived
1
0
Fork 0

gnu: pokerth: Fix build and modernize package.

Fixes <https://issues.guix.gnu.org/51093>.

* gnu/packages/games.scm (pokerth) [source]: Apply patch
[inputs]: Use new style.
[phases]: Delete trailing #t.  Use gexps.
{fix-paths}: Remove the gsasl and libircclient related substitutions.
master
Maxim Cournoyer 2022-07-12 11:08:42 -04:00
parent 07fdfb9e1e
commit f0c8abe857
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
3 changed files with 79 additions and 44 deletions

View File

@ -1598,6 +1598,7 @@ dist_patch_DATA = \
%D%/packages/patches/pciutils-hurd-fix.patch \ %D%/packages/patches/pciutils-hurd-fix.patch \
%D%/packages/patches/pjproject-install-libpjsua2.patch \ %D%/packages/patches/pjproject-install-libpjsua2.patch \
%D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \ %D%/packages/patches/plasma-framework-fix-KF5PlasmaMacros.cmake.patch \
%D%/packages/patches/pokerth-boost.patch \
%D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \ %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \
%D%/packages/patches/pthreadpool-system-libraries.patch \ %D%/packages/patches/pthreadpool-system-libraries.patch \
%D%/packages/patches/python-chai-drop-python2.patch \ %D%/packages/patches/python-chai-drop-python2.patch \

View File

@ -72,6 +72,7 @@
;;; Copyright © 2022 Roman Riabenko <roman@riabenko.com> ;;; Copyright © 2022 Roman Riabenko <roman@riabenko.com>
;;; Copyright © 2022 zamfofex <zamfofex@twdb.moe> ;;; Copyright © 2022 zamfofex <zamfofex@twdb.moe>
;;; Copyright © 2022 Gabriel Arazas <foo.dogsquared@gmail.com> ;;; Copyright © 2022 Gabriel Arazas <foo.dogsquared@gmail.com>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -12248,53 +12249,48 @@ game.") ;thanks to Debian for description
(delete-file-recursively "src/third_party/websocketpp") (delete-file-recursively "src/third_party/websocketpp")
(substitute* "pokerth_lib.pro" (substitute* "pokerth_lib.pro"
(("src/third_party/websocketpp") (("src/third_party/websocketpp")
"")) ""))))
#t)))) (patches (search-patches "pokerth-boost.patch"))))
(build-system qt-build-system) (build-system qt-build-system)
(inputs (inputs
`(("boost" ,boost) (list boost
("curl" ,curl) curl
("gsasl" ,gsasl) gsasl
("libgcrypt" ,libgcrypt) libgcrypt
("libircclient" ,libircclient) libircclient
("protobuf" ,protobuf-2) ; remove package when no longer needed protobuf-2 ;remove package when no longer needed
("qtbase" ,qtbase-5) qtbase-5
("sdl" ,(sdl-union (list sdl sdl-mixer))) (sdl-union (list sdl sdl-mixer))
("sqlite" ,sqlite) sqlite
("tinyxml" ,tinyxml) tinyxml
("websocketpp" ,websocketpp) websocketpp
("zlib" ,zlib))) zlib))
(arguments (arguments
`(#:tests? #f ; No test suite (list
#:phases #:tests? #f ; No test suite
(modify-phases %standard-phases #:phases
(add-after 'unpack 'fix-paths #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'fix-paths
(substitute* (find-files "." "\\.pro$") (lambda* (#:key inputs #:allow-other-keys)
(("/opt/gsasl") (substitute* (find-files "." "\\.pro$")
(assoc-ref inputs "gsasl")) (("LIB_DIRS =")
(("\\$\\$\\{PREFIX\\}/include/libircclient") (string-append "LIB_DIRS = "
(search-input-directory inputs "/include/libircclient")) #$(this-package-input "boost") "/lib")))))
(("LIB_DIRS =") (add-after 'unpack 'fix-build
(string-append "LIB_DIRS = " (lambda _
(assoc-ref inputs "boost") "/lib"))) ;; Fixes for Boost versions >= 1.66.
#t)) (substitute* '("src/net/common/clientthread.cpp"
(add-after 'unpack 'fix-build "src/net/serveraccepthelper.h")
(lambda _ (("boost::asio::socket_base::non_blocking_io command\\(true\\);")
;; Fixes for Boost versions >= 1.66. "")
(substitute* '("src/net/common/clientthread.cpp" (("newSock->io_control\\(command\\);")
"src/net/serveraccepthelper.h") "newSock->non_blocking(true);")
(("boost::asio::socket_base::non_blocking_io command\\(true\\);") (("acceptedSocket->io_control\\(command\\);")
"") "acceptedSocket->non_blocking(true);"))))
(("newSock->io_control\\(command\\);") (replace 'configure
"newSock->non_blocking(true);") (lambda _
(("acceptedSocket->io_control\\(command\\);") (invoke "qmake" "pokerth.pro" "CONFIG+=client"
"acceptedSocket->non_blocking(true);")) (string-append "PREFIX=" #$output)))))))
#t))
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(invoke "qmake" "pokerth.pro" "CONFIG+=client"
(string-append "PREFIX=" (assoc-ref outputs "out"))))))))
(home-page "https://www.pokerth.net") (home-page "https://www.pokerth.net")
(synopsis "Texas holdem poker game") (synopsis "Texas holdem poker game")
(description (description

View File

@ -0,0 +1,38 @@
Retrieved from https://patch-diff.githubusercontent.com/raw/pokerth/pokerth/pull/396.patch
From a769887330a317d55e7f64c71a32ad130ffb9307 Mon Sep 17 00:00:00 2001
From: Stefan Strogin <steils@gentoo.org>
Date: Mon, 18 May 2020 03:30:53 +0300
Subject: [PATCH] Fix using boost placeholders (#395)
---
src/net/common/serveracceptwebhelper.cpp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/net/common/serveracceptwebhelper.cpp b/src/net/common/serveracceptwebhelper.cpp
index f61d4d779..8701e1e99 100644
--- a/src/net/common/serveracceptwebhelper.cpp
+++ b/src/net/common/serveracceptwebhelper.cpp
@@ -29,6 +29,7 @@
* as that of the covered work. *
*****************************************************************************/
+#include <boost/bind/bind.hpp>
#include <net/serveracceptwebhelper.h>
#include <net/sessiondata.h>
#include <net/webreceivebuffer.h>
@@ -58,10 +59,10 @@ ServerAcceptWebHelper::Listen(unsigned serverPort, bool /*ipv6*/, const std::str
m_webSocketServer->init_asio(m_ioService.get());
- m_webSocketServer->set_validate_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::validate), this, _1));
- m_webSocketServer->set_open_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::on_open), this, _1));
- m_webSocketServer->set_close_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::on_close), this, _1));
- m_webSocketServer->set_message_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::on_message), this, _1, _2));
+ m_webSocketServer->set_validate_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::validate), this, boost::placeholders::_1));
+ m_webSocketServer->set_open_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::on_open), this, boost::placeholders::_1));
+ m_webSocketServer->set_close_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::on_close), this, boost::placeholders::_1));
+ m_webSocketServer->set_message_handler(boost::bind(boost::mem_fn(&ServerAcceptWebHelper::on_message), this, boost::placeholders::_1, boost::placeholders::_2));
m_webSocketServer->listen(serverPort);
m_webSocketServer->start_accept();