From bb3f1c9c9e0ab86cd890c980a1bfe09a30726895 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 1 Nov 2021 07:41:56 +0000 Subject: [PATCH] mtr: 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: ui/curses.c:765:42: error: format not a string literal and no format arguments [-Werror=format-security] 765 | mvprintw(rowstat - 1, startstat, msg); | ^~~ --- pkgs/tools/networking/mtr/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/mtr/default.nix b/pkgs/tools/networking/mtr/default.nix index 1257c167e768..3e11d8eac085 100644 --- a/pkgs/tools/networking/mtr/default.nix +++ b/pkgs/tools/networking/mtr/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config +{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config , libcap, ncurses , withGtk ? false, gtk3 }: @@ -13,6 +13,16 @@ stdenv.mkDerivation rec { sha256 = "0wnz87cr2lcl74bj8qxq9xgai40az3pk9k0z893scyc8svd61xz6"; }; + patches = [ + # pull patch to fix build failure against ncurses-6.3: + # https://github.com/traviscross/mtr/pull/411 + (fetchpatch { + name = "ncurses-6.3.patch"; + url = "https://github.com/traviscross/mtr/commit/aeb493e08eabcb4e6178bda0bb84e9cd01c9f213.patch"; + sha256 = "1qk8lf4sha18g36mr84vbdvll2s8khgbzyyq0as3ifx44lv0qlf2"; + }) + ]; + # we need this before autoreconfHook does its thing postPatch = '' echo ${version} > .tarball-version