2021-01-25 08:26:54 +00:00
|
|
|
{ lib, mkDerivation, fetchFromGitHub, runCommand, fetchpatch, patchutils, qmake, qtbase
|
2018-10-19 17:00:33 +00:00
|
|
|
, SDL, SDL_mixer, boost, curl, gsasl, libgcrypt, libircclient, protobuf, sqlite
|
2020-04-14 07:59:55 +00:00
|
|
|
, wrapQtAppsHook
|
2018-10-19 17:00:33 +00:00
|
|
|
, tinyxml2, target ? "client" }:
|
2016-08-01 10:57:45 +00:00
|
|
|
|
2018-10-19 17:00:33 +00:00
|
|
|
let
|
|
|
|
hiDPI = fetchpatch {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "https://github.com/pokerth/pokerth/commit/ad8c9cabfb85d8293720d0f14840278d38b5feeb.patch";
|
2018-10-19 17:00:33 +00:00
|
|
|
sha256 = "192x3lqvd1fanasb95shdygn997qfrpk1k62k1f4j3s5chkwvjig";
|
2016-08-01 10:57:45 +00:00
|
|
|
};
|
|
|
|
|
2018-10-19 17:00:33 +00:00
|
|
|
revertPatch = patch: runCommand "revert-${patch.name}" {} ''
|
|
|
|
${patchutils}/bin/interdiff ${patch} /dev/null > $out
|
|
|
|
'';
|
|
|
|
in
|
2016-08-01 10:57:45 +00:00
|
|
|
|
2020-04-07 14:48:32 +00:00
|
|
|
mkDerivation rec {
|
2021-06-22 21:44:58 +00:00
|
|
|
pname = "pokerth-${target}";
|
2018-10-19 17:00:33 +00:00
|
|
|
version = "1.1.2";
|
2016-08-01 10:57:45 +00:00
|
|
|
|
2018-10-19 17:00:33 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pokerth";
|
|
|
|
repo = "pokerth";
|
|
|
|
rev = "f5688e01b0efb37035e3b0e3a432200185b9a0c5";
|
|
|
|
sha256 = "0la8d036pbscjnbxf8lkrqjfq8a4ywsfwxil452fhlays6mr19h0";
|
|
|
|
};
|
2016-08-01 10:57:45 +00:00
|
|
|
|
2018-10-19 17:00:33 +00:00
|
|
|
patches = [
|
|
|
|
(revertPatch hiDPI)
|
|
|
|
];
|
2016-08-27 21:04:09 +00:00
|
|
|
|
2016-08-01 10:57:45 +00:00
|
|
|
postPatch = ''
|
2018-10-19 17:00:33 +00:00
|
|
|
for f in *.pro; do
|
2016-08-01 10:57:45 +00:00
|
|
|
substituteInPlace $f \
|
2018-10-19 17:00:33 +00:00
|
|
|
--replace '$$'{PREFIX}/include/libircclient ${libircclient.dev}/include/libircclient \
|
2018-09-19 06:32:25 +00:00
|
|
|
--replace 'LIB_DIRS =' 'LIB_DIRS = ${boost.out}/lib' \
|
2018-10-19 17:00:33 +00:00
|
|
|
--replace /opt/gsasl ${gsasl}
|
2016-08-01 10:57:45 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-04-14 07:59:55 +00:00
|
|
|
nativeBuildInputs = [ qmake wrapQtAppsHook ];
|
2016-08-27 21:04:09 +00:00
|
|
|
|
2018-10-19 17:00:33 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL
|
|
|
|
SDL_mixer
|
|
|
|
boost
|
|
|
|
curl
|
|
|
|
gsasl
|
|
|
|
libgcrypt
|
|
|
|
libircclient
|
|
|
|
protobuf
|
|
|
|
qtbase
|
|
|
|
sqlite
|
|
|
|
tinyxml2
|
|
|
|
];
|
|
|
|
|
|
|
|
qmakeFlags = [
|
|
|
|
"CONFIG+=${target}"
|
|
|
|
"pokerth.pro"
|
|
|
|
];
|
|
|
|
|
2019-10-30 11:34:47 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL";
|
2018-10-19 17:00:33 +00:00
|
|
|
|
2021-01-15 04:31:39 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.pokerth.net";
|
2018-10-19 17:00:33 +00:00
|
|
|
description = "Poker game ${target}";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ obadz yegortimoshenko ];
|
|
|
|
platforms = platforms.all;
|
2016-08-01 10:57:45 +00:00
|
|
|
};
|
|
|
|
}
|