From 128d1385b0b77c8dad4dcb93af6b6cddda9a8ccd Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 14 May 2022 18:26:29 +0100 Subject: [PATCH] hping: pull patch pending upstream inclusion for -fno-common toolchain support Without the change build fails against upstream gcc-10 as: ld: scan.o:/build/source/hping2.h:360: multiple definition of `delaytable'; main.o:/build/source/hping2.h:360: first defined here --- pkgs/tools/networking/hping/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/hping/default.nix b/pkgs/tools/networking/hping/default.nix index 97b45c64ee2..33663a44d2a 100644 --- a/pkgs/tools/networking/hping/default.nix +++ b/pkgs/tools/networking/hping/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, libpcap, withTcl ? true, tcl }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, libpcap, withTcl ? true, tcl }: stdenv.mkDerivation rec { pname = "hping"; @@ -10,6 +10,15 @@ stdenv.mkDerivation rec { rev = "3547c7691742c6eaa31f8402e0ccbb81387c1b99"; # there are no tags/releases sha256 = "0y0n1ybij3yg9lfgzcwfmjz1sjg913zcqrv391xx83dm0j80sdpb"; }; + patches = [ + # Pull patch pending upstream inclusion for -fno-common toolchain + # support: https://github.com/antirez/hping/pull/64 + (fetchpatch { + name = "fno-common.patch"; + url = "https://github.com/antirez/hping/pull/64/commits/d057b9309aec3a5a53aaee1ac3451a8a5b71b4e8.patch"; + sha256 = "0bqr7kdlziijja588ipj8g5hv2109wq01c6x2qadbhjfnsps1b6l"; + }) + ]; buildInputs = [ libpcap ] ++ lib.optional withTcl tcl;