summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-06-09 22:22:21 +0100
committerSergei Trofimovich <slyich@gmail.com>2022-06-09 22:22:21 +0100
commit1ee09a25e808abf4d8d65f3900ba6aef2cd028b6 (patch)
tree917bb275b1ff78e33c1cf75ed083edd171f1d2a8
parentfdf46783c776c84389e7ee46193e5a18adc119f6 (diff)
downloadnixpkgs-1ee09a25e808abf4d8d65f3900ba6aef2cd028b6.tar
nixpkgs-1ee09a25e808abf4d8d65f3900ba6aef2cd028b6.tar.gz
nixpkgs-1ee09a25e808abf4d8d65f3900ba6aef2cd028b6.tar.bz2
nixpkgs-1ee09a25e808abf4d8d65f3900ba6aef2cd028b6.tar.lz
nixpkgs-1ee09a25e808abf4d8d65f3900ba6aef2cd028b6.tar.xz
nixpkgs-1ee09a25e808abf4d8d65f3900ba6aef2cd028b6.tar.zst
nixpkgs-1ee09a25e808abf4d8d65f3900ba6aef2cd028b6.zip
neverball: pull upstream fix for -fno-common toolchains
Without the change build fails on upstream gcc-10 as:

    ld: ball/st_save.o:(.bss+0x0): multiple definition of
      `text_input'; share/text.o:(.bss+0x0): first defined here
-rw-r--r--pkgs/games/neverball/default.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/games/neverball/default.nix b/pkgs/games/neverball/default.nix
index ba1d403207a..5e8e3f41c78 100644
--- a/pkgs/games/neverball/default.nix
+++ b/pkgs/games/neverball/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, SDL2, libGL, libpng, libjpeg, SDL2_ttf, libvorbis, gettext
+{ lib, stdenv, fetchurl, fetchpatch, SDL2, libGL, libpng, libjpeg, SDL2_ttf, libvorbis, gettext
 , physfs }:
 
 stdenv.mkDerivation rec {
@@ -8,12 +8,21 @@ stdenv.mkDerivation rec {
     url = "https://neverball.org/neverball-${version}.tar.gz";
     sha256 = "184gm36c6p6vaa6gwrfzmfh86klhnb03pl40ahsjsvprlk667zkk";
   };
+  patches = [
+    # Pull upstream fix for -fno-common toolchains
+    #   https://github.com/Neverball/neverball/pull/198
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/Neverball/neverball/commit/a42492b8db06934c7a794630db92e3ff6ebaadaa.patch";
+      sha256 = "0sqyxfwpl4xxra8iz87j5rxzwani16xra2xl4l5z61shvq30308h";
+    })
+  ];
 
   buildInputs = [ libpng SDL2 libGL libjpeg SDL2_ttf libvorbis gettext physfs ];
 
   dontPatchELF = true;
 
-  patchPhase = ''
+  postPatch = ''
     sed -i -e 's@\./data@'$out/share/neverball/data@ share/base_config.h Makefile
     sed -i -e 's@\./locale@'$out/share/neverball/locale@ share/base_config.h Makefile
     sed -i -e 's@-lvorbisfile@-lvorbisfile -lX11 -lgcc_s@' Makefile