From e686d3e812124ca02d393122fec8028b9e3bd2bb Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Thu, 12 May 2022 08:03:32 +0100
Subject: [PATCH] _0verkill: add -fcommon workaround for gcc-10

Without the change the build against upstream gcc-10 build fails as:

     ld: sprite.o:/build/0verkill/data.h:171: multiple definition of `obj_attr'; server.o:/build/0verkill/data.h:171: first defined here
     ld: sprite.o:/build/0verkill/data.h:142: multiple definition of `weapon_name'; server.o:/build/0verkill/data.h:142: first defined here

Use -fcommon as a workeround until upstream updates the code.
---
 pkgs/games/0verkill/default.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pkgs/games/0verkill/default.nix b/pkgs/games/0verkill/default.nix
index fa654832e2e2..8f6a5b123058 100644
--- a/pkgs/games/0verkill/default.nix
+++ b/pkgs/games/0verkill/default.nix
@@ -27,6 +27,9 @@ gccStdenv.mkDerivation rec {
     autoupdate
   '';
 
+  # The code needs an update for gcc-10:
+  #   https://github.com/hackndev/0verkill/issues/7
+  NIX_CFLAGS_COMPILE = "-fcommon";
   hardeningDisable = [ "all" ]; # Someday the upstream will update the code...
 
   meta = with lib; {