From a679de55a4d8426c690408da28b471d3347f81dc Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 12 May 2022 22:24:53 +0100 Subject: [PATCH] chocolateDoom: pull upstream fix for -fno-common toolchains Without the change build fails on -fno-common toolchains like upstream gcc-10: ld: hexen/libhexen.a(g_game.o):/build/source/src/hexen/g_game.c:101: multiple definition of `demoextend'; hexen/libhexen.a(mn_menu.o): /build/source/src/hexen/mn_menu.c:134: first defined here --- pkgs/games/chocolate-doom/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/games/chocolate-doom/default.nix b/pkgs/games/chocolate-doom/default.nix index 28ef9b6417ea..fabb12fa71fa 100644 --- a/pkgs/games/chocolate-doom/default.nix +++ b/pkgs/games/chocolate-doom/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, autoreconfHook, pkg-config, SDL2, SDL2_mixer, SDL2_net, fetchFromGitHub }: +{ lib, stdenv, autoreconfHook, pkg-config, SDL2, SDL2_mixer, SDL2_net, fetchFromGitHub, fetchpatch }: stdenv.mkDerivation rec { pname = "chocolate-doom"; @@ -11,6 +11,16 @@ stdenv.mkDerivation rec { sha256 = "1zlcqhd49c5n8vaahgaqrc2y10z86xng51sbd82xm3rk2dly25jp"; }; + patches = [ + # Pull upstream patch to fix builx against gcc-10: + # https://github.com/chocolate-doom/chocolate-doom/pull/1257 + (fetchpatch { + name = "fno-common.patch"; + url = "https://github.com/chocolate-doom/chocolate-doom/commit/a8fd4b1f563d24d4296c3e8225c8404e2724d4c2.patch"; + sha256 = "1dmbygn952sy5n8qqp0asg11pmygwgygl17lrj7i0fxa0nrhixhj"; + }) + ]; + postPatch = '' sed -e 's#/games#/bin#g' -i src{,/setup}/Makefile.am '';