From 60ba187b0fbfcce2d4dd5484814398415d9da27a Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 4 Jun 2022 07:02:02 +0100 Subject: [PATCH] gravit: pull fix pending upstream inclusion for -fno-common toolchains Without the change build fails on upstream gcc-10 as: ld: tool.o:(.bss+0x0): multiple definition of `view'; color.o:(.bss+0x0): first defined here ld: tool.o:(.bss+0x820): multiple definition of `video'; color.o:(.bss+0x820): first defined here ld: png_save.o:(.bss+0x0): multiple definition of `view'; color.o:(.bss+0x0): first defined here --- .../science/astronomy/gravit/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix index d6844307d428..a957bfc988bc 100644 --- a/pkgs/applications/science/astronomy/gravit/default.nix +++ b/pkgs/applications/science/astronomy/gravit/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake }: stdenv.mkDerivation rec { pname = "gravit"; @@ -11,6 +11,16 @@ stdenv.mkDerivation rec { hash = "sha256-JuqnLLD5+Ec8kQI0SK98V1O6TTbGM6+yKn5KCHe85eM="; }; + patches = [ + # Pull fix pending upstream inclusion for -fno-common toolchains: + # https://github.com/gak/gravit/pull/100 + (fetchpatch { + name = "fno-common.patch"; + url = "https://github.com/gak/gravit/commit/0f848834889212f16201fd404d2d5b9bb5b47d23.patch"; + hash = "sha256-k1aMIg7idMt53o6dFgIKJflOMp0Jp5NwgWEijcIwXrQ="; + }) + ]; + buildInputs = [ libGLU libGL SDL SDL_ttf SDL_image lua5 libpng libSM libICE ]; nativeBuildInputs = [ autoconf automake ];