pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / games / pokerth / default.nix
blob05b8fd7e58af881288e55d2cf4656c560c0e4fd0
1 { lib, mkDerivation, fetchFromGitHub, fetchpatch, qmake, qtbase
2 , SDL, SDL_mixer, boost, curl, gsasl, libgcrypt, libircclient, protobuf, sqlite
3 , wrapQtAppsHook
4 , tinyxml2, target ? "client" }:
6 mkDerivation rec {
7   pname = "pokerth-${target}";
8   version = "1.1.2";
10   src = fetchFromGitHub {
11     owner = "pokerth";
12     repo = "pokerth";
13     rev = "v${version}";
14     hash = "sha256-j4E3VMpaPqX7+hE3wYRZZUeRD//F+K2Gp8oPmJqX5FQ=";
15   };
17   patches = [
18     (fetchpatch {
19       name = "pokerth-1.1.2.patch";
20       url = "https://aur.archlinux.org/cgit/aur.git/plain/pokerth-1.1.2.patch?h=pokerth&id=7734029cf9c6ef58f42ed873e1b9c3c19eb1df3b";
21       hash = "sha256-we2UOCFF5J/Wlji/rJeCHDu/dNsUU+R+bTw83AmvDxs=";
22     })
23     (fetchpatch {
24       name = "pokerth-1.1.2.patch.2019";
25       url = "https://aur.archlinux.org/cgit/aur.git/plain/pokerth-1.1.2.patch.2019?h=pokerth&id=7734029cf9c6ef58f42ed873e1b9c3c19eb1df3b";
26       hash = "sha256-m6uFPmPC3T9kV7EI1p33vQSi0d/w+YCH0dKjviAphMY=";
27     })
28     (fetchpatch {
29       name = "pokerth-1.1.2.patch.2020";
30       url = "https://aur.archlinux.org/cgit/aur.git/plain/pokerth-1.1.2.patch.2020?h=pokerth&id=7734029cf9c6ef58f42ed873e1b9c3c19eb1df3b";
31       hash = "sha256-I2qrgLGSMvFDHyUZFWGPGnuecZ914NBf2uGK02X/wOg=";
32     })
33   ];
35   postPatch = ''
36     for f in *.pro; do
37       substituteInPlace $f \
38         --replace '$$'{PREFIX}/include/libircclient ${libircclient.dev}/include/libircclient \
39         --replace 'LIB_DIRS =' 'LIB_DIRS = ${boost.out}/lib' \
40         --replace /opt/gsasl ${gsasl}
41     done
42   '';
44   nativeBuildInputs = [ qmake wrapQtAppsHook ];
46   buildInputs = [
47     SDL
48     SDL_mixer
49     boost
50     curl
51     gsasl
52     libgcrypt
53     libircclient
54     protobuf
55     qtbase
56     sqlite
57     tinyxml2
58   ];
60   qmakeFlags = [
61     "CONFIG+=${target}"
62     "pokerth.pro"
63   ];
65   env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL}/include/SDL";
67   meta = with lib; {
68     homepage = "https://www.pokerth.net";
69     description = "Poker game ${target}";
70     mainProgram = "pokerth";
71     license = licenses.gpl3;
72     maintainers = with maintainers; [ obadz ];
73     platforms = platforms.all;
74   };