about summary refs log tree commit diff
path: root/pkgs/applications/graphics/gcolor2/default.nix
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-06-04 17:29:45 +0100
committerSergei Trofimovich <slyich@gmail.com>2022-06-04 17:30:38 +0100
commit72ed5665a234ac7de86a762e004704c322e8b28f (patch)
treed831b6a35b6a771c89ae258fe4506563cfc633da /pkgs/applications/graphics/gcolor2/default.nix
parent4ae74bbc9489c37c2c53b15e600dbdcf0c33ba32 (diff)
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
Diffstat (limited to 'pkgs/applications/graphics/gcolor2/default.nix')
-rw-r--r--pkgs/applications/graphics/gcolor2/default.nix15
1 files changed, 12 insertions, 3 deletions
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 ]