commit: 8a8f84d6806e35409cb85f652dcf37e2ed8c
Author: Sam James gentoo org>
AuthorDate: Mon Oct 24 17:17:26 2022 +
Commit: Sam James gentoo org>
CommitDate: Mon Oct 24 19:21:05 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a8f
games-fps/qudos: almost fix build w/ Clang 16
- Drop various seds, converting them into patches
- Fix build with libpng 1.4.0 too
- Fix build on modern glibc
- Use pkg-config (and therefore fix build on LLD)
This nearly got there wrt Clang 16, but then ended up hitting
-Wincompatible-function-pointer-types with some USE flags
and got fed up.
Bug: https://bugs.gentoo.org/874486
Closes: https://bugs.gentoo.org/730806
Closes: https://bugs.gentoo.org/770904
Signed-off-by: Sam James gentoo.org>
.../qudos/files/qudos-0.40.1-libjpeg-clash.patch | 25 +
games-fps/qudos/files/qudos-0.40.1-libpng.patch| 30 +
games-fps/qudos/files/qudos-0.40.1-libpng15.patch | 10 --
.../qudos/files/qudos-0.40.1-no-bits-nan.patch | 12 ++
.../qudos/files/qudos-0.40.1-respect-cc.patch | 15 +++
.../qudos/files/qudos-0.40.1-respect-libdir.patch | 53 +
.../qudos/files/qudos-0.40.1-use-pkg-config.patch | 30 +
.../qudos/files/qudos-0.40.1-zlib-build.patch | 12 ++
...{qudos-0.40.1.ebuild => qudos-0.40.1-r1.ebuild} | 121 ++---
9 files changed, 235 insertions(+), 73 deletions(-)
diff --git a/games-fps/qudos/files/qudos-0.40.1-libjpeg-clash.patch
b/games-fps/qudos/files/qudos-0.40.1-libjpeg-clash.patch
new file mode 100644
index ..944c1aff856c
--- /dev/null
+++ b/games-fps/qudos/files/qudos-0.40.1-libjpeg-clash.patch
@@ -0,0 +1,25 @@
+From c657cd54baee3bdfe7a92c9b91536bb5c3ddcdd8 Mon Sep 17 00:00:00 2001
+From: Sam James
+Date: Mon, 24 Oct 2022 17:50:17 +0100
+Subject: [PATCH 2/5] Fix clash with libjpeg
+
+--- a/src/ref_gl/gl_image.c
b/src/ref_gl/gl_image.c
+@@ -912,7 +912,7 @@ jpg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
+ }
+
+ void
+-jpeg_mem_src(j_decompress_ptr cinfo, byte * mem, int len)
++qudos_jpeg_mem_src(j_decompress_ptr cinfo, byte * mem, int len)
+ {
+ cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(struct jpeg_source_mgr));
+ cinfo->src->init_source = jpg_null;
+@@ -956,7 +956,7 @@ LoadJPG(char *filename, byte ** pic, int *width, int
*height)
+ jpeg_create_decompress();
+
+ /* Feed JPEG memory into the libJpeg Object */
+- jpeg_mem_src(, rawdata, rawsize);
++ qudos_jpeg_mem_src(, rawdata, rawsize);
+
+ /* Process JPEG header */
+ jpeg_read_header(, true);
diff --git a/games-fps/qudos/files/qudos-0.40.1-libpng.patch
b/games-fps/qudos/files/qudos-0.40.1-libpng.patch
new file mode 100644
index ..78fb4cdb7bd5
--- /dev/null
+++ b/games-fps/qudos/files/qudos-0.40.1-libpng.patch
@@ -0,0 +1,30 @@
+--- a/src/ref_gl/gl_local.h
b/src/ref_gl/gl_local.h
+@@ -29,6 +29,7 @@
+ #include
+ #include
+
++#include /* Z_DEFAULT_COMPRESSION */
+ #include
+ #include
+
+Subject: [PATCH] Fix build with libpng 1.4.0
+
+From the 1.4.0 release notes:
+```
+ m. The function png_set_gray_1_2_4_to_8() was removed. It has been
+ deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with
+ png_set_expand_gray_1_2_4_to_8() because the former function also
+ expanded palette images.
+```
+--- a/src/ref_gl/gl_image.c
b/src/ref_gl/gl_image.c
+@@ -1186,7 +1186,7 @@ LoadPNG(char *filename, byte ** pic, int *width, int
*height)
+ if (my_png->ColorType == PNG_COLOR_TYPE_PALETTE)
+ png_set_palette_to_rgb(png);
+ if (my_png->ColorType == PNG_COLOR_TYPE_GRAY && my_png->BitDepth < 8)
+- png_set_gray_1_2_4_to_8(png);
++ png_set_expand_gray_1_2_4_to_8(png);
+
+ /* Add alpha channel if present */
+ if (png_get_valid(png, pnginfo, PNG_INFO_tRNS))
diff --git a/games-fps/qudos/files/qudos-0.40.1-libpng15.patch
b/games-fps/qudos/files/qudos-0.40.1-libpng15.patch
deleted file mode 100644
index 633215be34be..
--- a/games-fps/qudos/files/qudos-0.40.1-libpng15.patch
+++ /dev/null
@@ -1,10 +0,0 @@
a/src/ref_gl/gl_local.h
-+++ b/src/ref_gl/gl_local.h
-@@ -29,6 +29,7 @@
- #include
- #include
-
-+#include /* Z_DEFAULT_COMPRESSION */
- #include
- #include
-
diff --git a/games-fps/qudos/files/qudos-0.40.1-no-bits-nan.patch
b/games-fps/qudos/files/qudos-0.40.1-no-bits-nan.patch
new file mode 100644
index ..adcffef23c40
--- /dev/null
+++ b/games-fps/qudos/files/qudos-0.40.1-no-bits-nan.patch
@@ -0,0 +1,12 @@
+--- a/src/mods/rogue/g_local.h
b/src/mods/rogue/g_local.h
+@@ -26,9 +26,6 @@
+ //==
+
+ #ifndef _WIN32
+-#ifdef __linux__
+-#include
+-#endif
+ #define min(a,b) ((a) < (b) ? (a) : (b))
+ #define max(a,b) ((a) > (b) ? (a) : (b))
+ #ifdef __sun__
diff