diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2023-10-13 22:20:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-13 22:20:23 +0200 |
commit | 59f594f59d4d9e3e17fadfe89b9c0c4a2251f888 (patch) | |
tree | 83889e55c9d1af0389eebc7588963524a92ffcbe /pkgs/games | |
parent | 4a7eb88e55f80623bb3ea4968ff4600814016ffb (diff) | |
parent | a82dceca5e47a1cb9efd211d60419374a7c112ef (diff) |
Merge pull request #260238 from trofi/blobwars-fix-for-glibc-2.38
blobwars: fix build against glibc-2.38
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/blobwars/blobwars-2.00-glibc-2.38.patch | 11 | ||||
-rw-r--r-- | pkgs/games/blobwars/default.nix | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/games/blobwars/blobwars-2.00-glibc-2.38.patch b/pkgs/games/blobwars/blobwars-2.00-glibc-2.38.patch new file mode 100644 index 0000000000000..4fe3e373afda6 --- /dev/null +++ b/pkgs/games/blobwars/blobwars-2.00-glibc-2.38.patch @@ -0,0 +1,11 @@ +--- a/src/headers.h ++++ b/src/headers.h +@@ -56,7 +56,7 @@ extern DECLSPEC int SDLCALL SDL_GetGamma(float *red, float *green, float *blue); + #define textdomain(x) while(false) + #endif + +-#if !defined(OpenBSD) && !defined(FreeBSD) && !defined(__APPLE__) ++#if !defined(OpenBSD) && !defined(FreeBSD) && !defined(__APPLE__) && !(defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 38) + static inline void strlcat(char *dest, const char *src, size_t n) { strncat(dest, src, n - 1); } + static inline void strlcpy(char *dest, const char *src, size_t n) { strncpy(dest, src, n); dest[n - 1] = 0; } + #endif diff --git a/pkgs/games/blobwars/default.nix b/pkgs/games/blobwars/default.nix index b0951064c24cf..dd94fc1096966 100644 --- a/pkgs/games/blobwars/default.nix +++ b/pkgs/games/blobwars/default.nix @@ -9,6 +9,8 @@ stdenv.mkDerivation rec { sha256 = "c406279f6cdf2aed3c6edb8d8be16efeda0217494acd525f39ee2bd3e77e4a99"; }; + patches = [ ./blobwars-2.00-glibc-2.38.patch ]; + nativeBuildInputs = [ pkg-config gettext ]; buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net SDL2_ttf zlib ]; env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error" ]; |