From 72ed5665a234ac7de86a762e004704c322e8b28f Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 4 Jun 2022 17:29:45 +0100 Subject: gcolor2: pull patch pending upstream inclusion for -fno-common toolchains Without the change build on upstream gcc-10 fails as: ld: callbacks.o:src/callbacks.h:44: multiple definition of `gcolor2'; main.o:src/callbacks.h:44: first defined here ld: callbacks.o:src/callbacks.h:46: multiple definition of `colorvalue'; main.o:src/callbacks.h:46: first defined here ld: callbacks.o:src/callbacks.h:45: multiple definition of `menu'; main.o:src/callbacks.h:45: first defined here --- pkgs/applications/graphics/gcolor2/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'pkgs/applications/graphics/gcolor2/default.nix') diff --git a/pkgs/applications/graphics/gcolor2/default.nix b/pkgs/applications/graphics/gcolor2/default.nix index 0e79f981fbc08..5caa541670470 100644 --- a/pkgs/applications/graphics/gcolor2/default.nix +++ b/pkgs/applications/graphics/gcolor2/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, gtk2, perlPackages, pkg-config } : +{lib, stdenv, fetchurl, fetchpatch, gtk2, perlPackages, pkg-config } : let version = "0.4"; in stdenv.mkDerivation { @@ -16,9 +16,18 @@ stdenv.mkDerivation { ''; # from https://github.com/PhantomX/slackbuilds/tree/master/gcolor2/patches - patches = if stdenv.hostPlatform.system == "x86_64-linux" then + patches = (if stdenv.hostPlatform.system == "x86_64-linux" then [ ./gcolor2-amd64.patch ] else - [ ]; + [ ]) + ++ [ + # Pull patch pending upstream inclusion for -fno-common toolchains: + # https://sourceforge.net/p/gcolor2/patches/8/ + (fetchpatch { + name = "fno-common.patch"; + url = "https://sourceforge.net/p/gcolor2/patches/8/attachment/0001-gcolor2-fix-build-on-gcc-10-fno-common.patch"; + sha256 = "0187zc8as9g3d6mpm3isg87jfpryj0hajb4inwvii8gxrzbi5l5f"; + }) + ]; nativeBuildInputs = [ pkg-config ]; buildInputs = [ gtk2 ] -- cgit 1.4.1