From c95a1d47240ca4808186d941b4e08a28a957bb08 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 10 May 2022 07:47:15 +0100 Subject: [PATCH] cataract: add -fcommon workaround Without the change -fno-common toolchains like upstream gcc-10 fail to build as: ld: stats.o:/build/cataract-675e647/src/stats.h:24: multiple definition of `stats_images'; cgg.o:/build/cataract-675e647/src/stats.h:24: first defined here --- pkgs/applications/misc/cataract/build.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/applications/misc/cataract/build.nix b/pkgs/applications/misc/cataract/build.nix index 0adab84830d2..2c369e64b5d2 100644 --- a/pkgs/applications/misc/cataract/build.nix +++ b/pkgs/applications/misc/cataract/build.nix @@ -26,6 +26,12 @@ stdenv.mkDerivation { sed -i 's|#include |#include |' src/jpeg-utils.cpp ''; + # Add workaround for -fno-common toolchains like upstream gcc-10 to + # avoid build failures like: + # ld: stats.o:/build/cataract-675e647/src/stats.h:24: multiple definition of + # `stats_images'; cgg.o:/build/cataract-675e647/src/stats.h:24: first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; + installPhase = '' mkdir $out/{bin,share} -p cp src/cgg{,-dirgen} $out/bin/