From ad48be73f575f494c8f695b6ff4592ae367857c4 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 8 May 2022 20:47:33 +0100 Subject: [PATCH] gtkdialog: pull gentoo patch for -fno-common toolchains Without the change build fails on -fno-common toolchains like upstream gcc-10: $ nix build -L --impure --expr 'with import ./. {}; gtkdialog.overrideAttrs (oa: { NIX_CFLAGS_COMPILE = (oa.NIX_CFLAGS_COMPILE or []) ++ ["-fno-common"]; })' ... ld: widget_window.o:/build/gtkdialog-0.8.3/src/gtkdialog.h:43: multiple definition of `function_signals_block'; gtkdialog.o:/build/gtkdialog-0.8.3/src/gtkdialog.h:43: first defined here --- pkgs/development/tools/misc/gtkdialog/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/misc/gtkdialog/default.nix b/pkgs/development/tools/misc/gtkdialog/default.nix index 9e6d846e80a4..995a6bb9cdb9 100644 --- a/pkgs/development/tools/misc/gtkdialog/default.nix +++ b/pkgs/development/tools/misc/gtkdialog/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, gtk2, pkg-config }: +{lib, stdenv, fetchurl, fetchpatch, gtk2, pkg-config }: stdenv.mkDerivation rec { pname = "gtkdialog"; @@ -8,6 +8,14 @@ stdenv.mkDerivation rec { url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/${pname}/${pname}-${version}.tar.gz"; sha256 = "ff89d2d7f1e6488e5df5f895716ac1d4198c2467a2a5dc1f51ab408a2faec38e"; }; + patches = [ + # Pull Gentoo patch for -fno-common toolchain fix. + (fetchpatch { + name = "fno-common.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/x11-misc/gtkdialog/files/gtkdialog-0.8.3-fno-common.patch?id=98692e4c4ad494b88c4902ca1ab3e6541190bbe8"; + sha256 = "1mh01krzpfy7lbbqx3xm71xsiqqgg67w4snv794wspfqkk2hicvz"; + }) + ]; nativeBuildInputs = [ pkg-config ]; buildInputs = [ gtk2 ];