summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2022-03-13 07:55:25 +0000
committerSergei Trofimovich <slyich@gmail.com>2022-03-13 07:59:07 +0000
commit71b07eaac3552d41c92a604059840e3c5589a657 (patch)
tree8851985b36be4261b5bb2a1df6eaa373b8ad3efe /pkgs/games
parent1944ec70cf5e56417ba5bb48d7a8893001ff6f3d (diff)
downloadnixpkgs-71b07eaac3552d41c92a604059840e3c5589a657.tar
nixpkgs-71b07eaac3552d41c92a604059840e3c5589a657.tar.gz
nixpkgs-71b07eaac3552d41c92a604059840e3c5589a657.tar.bz2
nixpkgs-71b07eaac3552d41c92a604059840e3c5589a657.tar.lz
nixpkgs-71b07eaac3552d41c92a604059840e3c5589a657.tar.xz
nixpkgs-71b07eaac3552d41c92a604059840e3c5589a657.tar.zst
nixpkgs-71b07eaac3552d41c92a604059840e3c5589a657.zip
freedroidrpg: add upstream fix for -fno-common toolchains
Without the upstream change build fails on toolchains that default to
`-fno-common` (like clang-13 or upstream  gcc-10+):

    $ nix build --impure --expr 'with import ./.{}; freedroidrpg.override { stdenv = clang13Stdenv; }' -L
    ...
    freedroidrpg> ld: addon_crafting_ui.o:/build/freedroidrpg-0.16.1/src/./struct.h:1025:
      multiple definition of `tux_rendering'; action.o:/build/freedroidrpg-0.16.1/src/./struct.h:1025: first defined here
    ...
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/freedroidrpg/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/games/freedroidrpg/default.nix b/pkgs/games/freedroidrpg/default.nix
index e0582c524ec..84fd9c154a2 100644
--- a/pkgs/games/freedroidrpg/default.nix
+++ b/pkgs/games/freedroidrpg/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, lib, stdenv, pkg-config, gettext, python3, SDL, SDL_image, SDL_gfx, SDL_mixer, libogg, libvorbis, lua5_3, libjpeg, libpng, zlib, libiconv }:
+{ fetchurl, fetchpatch, lib, stdenv, pkg-config, gettext, python3, SDL, SDL_image, SDL_gfx, SDL_mixer, libogg, libvorbis, lua5_3, libjpeg, libpng, zlib, libiconv }:
 
 let
   version = "0.16.1";
@@ -11,6 +11,15 @@ in stdenv.mkDerivation {
     sha256 = "0n4kn38ncmcy3lrxmq8fjry6c1z50z4q1zcqfig0j4jb0dsz2va2";
   };
 
+  patches = [
+    # Pull upstream fix for -fno-common tolchains.
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://gitlab.com/freedroid/freedroid-src/-/commit/e610d427374226b79da5258d979936459f30c761.patch";
+      sha256 = "1s7sw4dkc7b6i72j6x47driq6v0k3wss48l9ivd4fw40n3iaxjb1";
+    })
+  ];
+
   nativeBuildInputs = [ pkg-config gettext python3 ];
 
   buildInputs = [