python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / games / pokerth / default.nix
blobf07b2a614d48d098b131d932311ec1ffc8f523d4
1 { lib, mkDerivation, fetchFromGitHub, runCommand, fetchpatch, patchutils, qmake, qtbase
2 , SDL, SDL_mixer, boost, curl, gsasl, libgcrypt, libircclient, protobuf, sqlite
3 , wrapQtAppsHook
4 , tinyxml2, target ? "client" }:
6 let
7   hiDPI = fetchpatch {
8     url = "https://github.com/pokerth/pokerth/commit/ad8c9cabfb85d8293720d0f14840278d38b5feeb.patch";
9     sha256 = "192x3lqvd1fanasb95shdygn997qfrpk1k62k1f4j3s5chkwvjig";
10   };
12   revertPatch = patch: runCommand "revert-${patch.name}" {} ''
13     ${patchutils}/bin/interdiff ${patch} /dev/null > $out
14   '';
17 mkDerivation rec {
18   pname = "pokerth-${target}";
19   version = "1.1.2";
21   src = fetchFromGitHub {
22     owner = "pokerth";
23     repo = "pokerth";
24     rev = "f5688e01b0efb37035e3b0e3a432200185b9a0c5";
25     sha256 = "0la8d036pbscjnbxf8lkrqjfq8a4ywsfwxil452fhlays6mr19h0";
26   };
28   patches = [
29     (revertPatch hiDPI)
30   ];
32   postPatch = ''
33     for f in *.pro; do
34       substituteInPlace $f \
35         --replace '$$'{PREFIX}/include/libircclient ${libircclient.dev}/include/libircclient \
36         --replace 'LIB_DIRS =' 'LIB_DIRS = ${boost.out}/lib' \
37         --replace /opt/gsasl ${gsasl}
38     done
39   '';
41   nativeBuildInputs = [ qmake wrapQtAppsHook ];
43   buildInputs = [
44     SDL
45     SDL_mixer
46     boost
47     curl
48     gsasl
49     libgcrypt
50     libircclient
51     protobuf
52     qtbase
53     sqlite
54     tinyxml2
55   ];
57   qmakeFlags = [
58     "CONFIG+=${target}"
59     "pokerth.pro"
60   ];
62   NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL}/include/SDL";
64   meta = with lib; {
65     homepage = "https://www.pokerth.net";
66     description = "Poker game ${target}";
67     license = licenses.gpl3;
68     maintainers = with maintainers; [ obadz yana ];
69     platforms = platforms.all;
70   };