Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 98 lines 2.2 kB view raw
1{ 2 lib, 3 mkDerivation, 4 fetchFromGitHub, 5 fetchpatch, 6 qmake, 7 qtbase, 8 SDL, 9 SDL_mixer, 10 boost181, 11 curl, 12 gsasl, 13 libgcrypt, 14 libircclient, 15 protobuf, 16 sqlite, 17 wrapQtAppsHook, 18 tinyxml2, 19 target ? "client", 20}: 21 22let 23 boost = boost181; 24in 25 26mkDerivation rec { 27 pname = "pokerth-${target}"; 28 version = "1.1.2"; 29 30 src = fetchFromGitHub { 31 owner = "pokerth"; 32 repo = "pokerth"; 33 rev = "v${version}"; 34 hash = "sha256-j4E3VMpaPqX7+hE3wYRZZUeRD//F+K2Gp8oPmJqX5FQ="; 35 }; 36 37 patches = [ 38 (fetchpatch { 39 name = "pokerth-1.1.2.patch"; 40 url = "https://aur.archlinux.org/cgit/aur.git/plain/pokerth-1.1.2.patch?h=pokerth&id=7734029cf9c6ef58f42ed873e1b9c3c19eb1df3b"; 41 hash = "sha256-we2UOCFF5J/Wlji/rJeCHDu/dNsUU+R+bTw83AmvDxs="; 42 }) 43 (fetchpatch { 44 name = "pokerth-1.1.2.patch.2019"; 45 url = "https://aur.archlinux.org/cgit/aur.git/plain/pokerth-1.1.2.patch.2019?h=pokerth&id=7734029cf9c6ef58f42ed873e1b9c3c19eb1df3b"; 46 hash = "sha256-m6uFPmPC3T9kV7EI1p33vQSi0d/w+YCH0dKjviAphMY="; 47 }) 48 (fetchpatch { 49 name = "pokerth-1.1.2.patch.2020"; 50 url = "https://aur.archlinux.org/cgit/aur.git/plain/pokerth-1.1.2.patch.2020?h=pokerth&id=7734029cf9c6ef58f42ed873e1b9c3c19eb1df3b"; 51 hash = "sha256-I2qrgLGSMvFDHyUZFWGPGnuecZ914NBf2uGK02X/wOg="; 52 }) 53 ]; 54 55 postPatch = '' 56 for f in *.pro; do 57 substituteInPlace $f \ 58 --replace '$$'{PREFIX}/include/libircclient ${libircclient.dev}/include/libircclient \ 59 --replace 'LIB_DIRS =' 'LIB_DIRS = ${boost.out}/lib' \ 60 --replace /opt/gsasl ${gsasl} 61 done 62 ''; 63 64 nativeBuildInputs = [ 65 qmake 66 wrapQtAppsHook 67 ]; 68 69 buildInputs = [ 70 SDL 71 SDL_mixer 72 boost 73 curl 74 gsasl 75 libgcrypt 76 libircclient 77 protobuf 78 qtbase 79 sqlite 80 tinyxml2 81 ]; 82 83 qmakeFlags = [ 84 "CONFIG+=${target}" 85 "pokerth.pro" 86 ]; 87 88 env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL}/include/SDL"; 89 90 meta = with lib; { 91 homepage = "https://www.pokerth.net"; 92 description = "Poker game ${target}"; 93 mainProgram = "pokerth"; 94 license = licenses.gpl3; 95 maintainers = with maintainers; [ obadz ]; 96 platforms = platforms.all; 97 }; 98}