From f9114acb1794b0f163d391771501d89289283886 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 12 Oct 2023 04:20:00 +0000 Subject: [PATCH] whois: fix build with Clang --- pkgs/tools/networking/whois/clang.patch | 11 +++++++++++ pkgs/tools/networking/whois/default.nix | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 pkgs/tools/networking/whois/clang.patch diff --git a/pkgs/tools/networking/whois/clang.patch b/pkgs/tools/networking/whois/clang.patch new file mode 100644 index 000000000000..3091b9a3eee3 --- /dev/null +++ b/pkgs/tools/networking/whois/clang.patch @@ -0,0 +1,11 @@ +--- a/utils.h ++++ b/utils.h +@@ -15,7 +15,7 @@ + #endif + + /* Portability macros */ +-#ifdef __GNUC__ ++#if defined __GNUC__ && ! defined __clang__ + # define NORETURN __attribute__((noreturn)) + # define MALLOC_FREE __attribute__((malloc(free))) + # define NONNULL __attribute__((returns_nonnull)) diff --git a/pkgs/tools/networking/whois/default.nix b/pkgs/tools/networking/whois/default.nix index f9d2e90b58e4..465ab7650137 100644 --- a/pkgs/tools/networking/whois/default.nix +++ b/pkgs/tools/networking/whois/default.nix @@ -11,6 +11,10 @@ stdenv.mkDerivation rec { hash = "sha256-4mFn5cY7ipAU4vOiHC2s69fxYJwShQEQ1eA8t5JvOP0="; }; + patches = [ + ./clang.patch + ]; + nativeBuildInputs = [ perl gettext pkg-config ]; buildInputs = [ libidn2 libiconv ];