Merge pull request #46920 from urkud/pokerth-1.1.2

pokerth: 1.1.1 -> 1.1.2, refactor, Qt 5
This commit is contained in:
Yegor Timoshenko 2018-10-20 09:11:51 +00:00 committed by GitHub
commit 7731f70045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 32 deletions

View File

@ -1,45 +1,74 @@
{ stdenv, fetchFromGitHub, qmake4Hook, qt4, protobuf, boost155, tinyxml2, libgcrypt, sqlite, gsasl, curl, SDL, SDL_mixer, libircclient }:
{ stdenv, fetchFromGitHub, runCommand, fetchpatch, patchutils, qmake, qtbase
, SDL, SDL_mixer, boost, curl, gsasl, libgcrypt, libircclient, protobuf, sqlite
, tinyxml2, target ? "client" }:
let boost = boost155;
in stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "pokerth";
version = "1.1.1";
with stdenv.lib;
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "7f3c8a860848c16c8c2f78e3929a65a54ef4c04c";
sha256 = "1md3sl7pdpn3n42k75pxqbkkl19cz4699g1vdi04qpp0jxx09a2k";
let
hiDPI = fetchpatch {
url = https://github.com/pokerth/pokerth/commit/ad8c9cabfb85d8293720d0f14840278d38b5feeb.patch;
sha256 = "192x3lqvd1fanasb95shdygn997qfrpk1k62k1f4j3s5chkwvjig";
};
buildInputs = [ qmake4Hook qt4 protobuf boost tinyxml2 libgcrypt sqlite gsasl curl SDL SDL_mixer libircclient ];
revertPatch = patch: runCommand "revert-${patch.name}" {} ''
${patchutils}/bin/interdiff ${patch} /dev/null > $out
'';
in
outputs = [ "out" "server" ];
stdenv.mkDerivation rec {
name = "pokerth-${target}-${version}";
version = "1.1.2";
qmakeFlags = [ "pokerth.pro" "DEFINES+=_WEBSOCKETPP_NOEXCEPT_TOKEN_=noexcept" ];
src = fetchFromGitHub {
owner = "pokerth";
repo = "pokerth";
rev = "f5688e01b0efb37035e3b0e3a432200185b9a0c5";
sha256 = "0la8d036pbscjnbxf8lkrqjfq8a4ywsfwxil452fhlays6mr19h0";
};
NIX_CFLAGS_COMPILE = [ "-I${SDL.dev}/include/SDL" ];
patches = [
(revertPatch hiDPI)
];
postPatch = ''
for f in connectivity.pro load.pro pokerth_game.pro pokerth_server.pro
do
for f in *.pro; do
substituteInPlace $f \
--replace 'LIB_DIRS =' 'LIB_DIRS = ${boost.out}/lib'
--replace '$$'{PREFIX}/include/libircclient ${libircclient.dev}/include/libircclient \
--replace 'LIB_DIRS =' 'LIB_DIRS = ${boost.out}/lib' \
--replace /opt/gsasl ${gsasl}
done
'';
nativeBuildInputs = [ qmake ];
buildInputs = [
SDL
SDL_mixer
boost
curl
gsasl
libgcrypt
libircclient
protobuf
qtbase
sqlite
tinyxml2
];
qmakeFlags = [
"CONFIG+=${target}"
"pokerth.pro"
];
NIX_CFLAGS_COMPILE = [ "-I${SDL.dev}/include/SDL" ];
enableParallelBuilding = true;
postInstall = ''
install -D -m755 bin/pokerth_server $server/bin/pokerth_server
'';
meta = with stdenv.lib; {
homepage = https://www.pokerth.net;
description = "Open Source Poker client and server";
license = licenses.gpl3;
maintainers = with maintainers; [ obadz ];
platforms = platforms.all;
meta = {
homepage = https://www.pokerth.net;
description = "Poker game ${target}";
license = licenses.gpl3;
maintainers = with maintainers; [ obadz yegortimoshenko ];
platforms = platforms.all;
};
}

View File

@ -20348,11 +20348,9 @@ with pkgs;
pong3d = callPackage ../games/pong3d { };
pokerth = callPackage ../games/pokerth {
protobuf = protobuf3_4;
};
pokerth = libsForQt5.callPackage ../games/pokerth { };
pokerth-server = pokerth.server;
pokerth-server = libsForQt5.callPackage ../games/pokerth { target = "server"; };
prboom = callPackage ../games/prboom { };