tty-solitaire: fix build against upcoming ncurses-6.3

On ncurses-6.3 with extra printf() annotations gcc now detects
use of user input in place of format strings:

src/gui.c:48:13: error: format not a string literal and no format arguments [-Werror=format-security]
48 | card_suits[card->suit]);
| ^~~~~~~~~~

+15 -3
+15 -3
pkgs/applications/misc/tty-solitaire/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, ncurses }: 1 + { lib, stdenv, fetchFromGitHub, fetchpatch, ncurses }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "tty-solitaire"; ··· 11 11 sha256 = "sha256-zMLNWJieHxHALFQoSkdAxGbUBGuZnznLX86lI3P21F0="; 12 12 }; 13 13 14 - buildInputs = [ ncurses ]; 14 + patches = [ 15 + # Patch pending upstream inclusion to support ncurses-6.3: 16 + # https://github.com/mpereira/tty-solitaire/pull/61 17 + (fetchpatch { 18 + name = "ncurses-6.3.patch"; 19 + url = "https://github.com/mpereira/tty-solitaire/commit/4d066c564d086ce272b78cb8f80717a7fb83c261.patch"; 20 + sha256 = "sha256-E1XVG0be6JH3K1y7UPap93s8xk8Nk0dKLdKHcJ7mA8E="; 21 + }) 22 + ]; 15 23 16 - patchPhase = "sed -i -e '/^CFLAGS *?= *-g *$/d' Makefile"; 24 + postPatch = '' 25 + sed -i -e '/^CFLAGS *?= *-g *$/d' Makefile 26 + ''; 27 + 28 + buildInputs = [ ncurses ]; 17 29 18 30 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "PREFIX=${placeholder "out"}" ]; 19 31