summary refs log tree commit diff
path: root/pkgs/games/uqm/default.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2017-11-08 06:33:21 +0100
committeraszlig <aszlig@nix.build>2017-11-08 06:48:15 +0100
commit7603da33decd2f3777306729d2a95c091b7801ab (patch)
tree2479bbf383258b78e5ce5b29e1e16b7b42360c52 /pkgs/games/uqm/default.nix
parent3429d8cbbfd5cb15ab57ee1bbd173411fbee7328 (diff)
downloadnixpkgs-7603da33decd2f3777306729d2a95c091b7801ab.tar
nixpkgs-7603da33decd2f3777306729d2a95c091b7801ab.tar.gz
nixpkgs-7603da33decd2f3777306729d2a95c091b7801ab.tar.bz2
nixpkgs-7603da33decd2f3777306729d2a95c091b7801ab.tar.lz
nixpkgs-7603da33decd2f3777306729d2a95c091b7801ab.tar.xz
nixpkgs-7603da33decd2f3777306729d2a95c091b7801ab.tar.zst
nixpkgs-7603da33decd2f3777306729d2a95c091b7801ab.zip
uqm: Fix build against glibc 2.26
I've bisected the introduction of the build failure to be the glibc 2.26
upgrade with commit 9bb67d5c1e546968fa3d195f0bcad82414243566.

At first I was somewhat stumped why an glibc update could cause
undeclared identifiers, but after looking at the changes of glibc and
the source code of The Ur-Quan Masters the problem quickly turned out to
be this very change:

https://sourceware.org/git/?p=glibc.git;a=commit;h=7b037c095e31c2396d0a9b0e6356bc566ee4812f

So string.h now in turn includes strings.h, which in theory wouldn't be
a problem.

However, both strings.h and the strings.h in the uqm source code use
constant _STRINGS_H, which causes the glibc strings.h to be included but
the one from uqm basically includes an empty file.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/uqm/default.nix')
-rw-r--r--pkgs/games/uqm/default.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/games/uqm/default.nix b/pkgs/games/uqm/default.nix
index 22a0418d4ca..1a2afa29f8f 100644
--- a/pkgs/games/uqm/default.nix
+++ b/pkgs/games/uqm/default.nix
@@ -70,6 +70,11 @@ in stdenv.mkDerivation rec {
     ln -s "${videos}" "uqm-${version}/content/addons/3dovideo"
   '';
 
+  # Using _STRINGS_H as include guard conflicts with glibc.
+  postPatch = ''
+    sed -i -e '/^#/s/_STRINGS_H/_UQM_STRINGS_H/g' src/uqm/comm/*/strings.h
+  '';
+
   # uqm has a 'unique' build system with a root script incidentally called
   # 'build.sh'.
   configurePhase = ''