blobwars: fix build against glibc-2.38

This commit is contained in:
Sergei Trofimovich 2023-10-10 15:58:54 +01:00
parent 06ee4dd693
commit a82dceca5e
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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" ];