[gentoo-commits] repo/gentoo:master commit in: games-fps/qudos/files/, games-fps/qudos/

2022-10-24 Thread Sam James
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 

[gentoo-commits] repo/gentoo:master commit in: games-fps/qudos/files/, games-fps/qudos/

2021-04-06 Thread Sam James
commit: bc70afdf256aa8e9415e79eaa24d3207354eef3a
Author: Sam James  gentoo  org>
AuthorDate: Tue Apr  6 20:36:59 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Apr  6 20:42:51 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc70afdf

games-fps/qudos: port to EAPI 7, games.eclass--

Signed-off-by: Sam James  gentoo.org>

 games-fps/qudos/files/qudos-0.40.1-gnusource.patch |  4 +-
 games-fps/qudos/files/qudos-0.40.1-libpng15.patch  |  4 +-
 games-fps/qudos/qudos-0.40.1.ebuild| 52 +-
 3 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/games-fps/qudos/files/qudos-0.40.1-gnusource.patch 
b/games-fps/qudos/files/qudos-0.40.1-gnusource.patch
index dd2113b0c3b..b82a276b012 100644
--- a/games-fps/qudos/files/qudos-0.40.1-gnusource.patch
+++ b/games-fps/qudos/files/qudos-0.40.1-gnusource.patch
@@ -1,5 +1,5 @@
 src/unix/qsh_unix.c.orig   2011-10-22 17:46:37.665993357 -0500
-+++ src/unix/qsh_unix.c2011-10-22 17:46:40.965972209 -0500
+--- a/src/unix/qsh_unix.c
 b/src/unix/qsh_unix.c
 @@ -17,6 +17,9 @@
   * Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   *

diff --git a/games-fps/qudos/files/qudos-0.40.1-libpng15.patch 
b/games-fps/qudos/files/qudos-0.40.1-libpng15.patch
index ecf9de9370e..633215be34b 100644
--- a/games-fps/qudos/files/qudos-0.40.1-libpng15.patch
+++ b/games-fps/qudos/files/qudos-0.40.1-libpng15.patch
@@ -1,5 +1,5 @@
 src/ref_gl/gl_local.h
-+++ src/ref_gl/gl_local.h
+--- a/src/ref_gl/gl_local.h
 b/src/ref_gl/gl_local.h
 @@ -29,6 +29,7 @@
  #include 
  #include 

diff --git a/games-fps/qudos/qudos-0.40.1.ebuild 
b/games-fps/qudos/qudos-0.40.1.ebuild
index 1c167f70ec4..24a6a4e0161 100644
--- a/games-fps/qudos/qudos-0.40.1.ebuild
+++ b/games-fps/qudos/qudos-0.40.1.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-inherit eutils flag-o-matic toolchain-funcs games
+inherit desktop flag-o-matic toolchain-funcs
 
 FILE_STEM="QuDos-${PV}-src"
 PK3_FILE="QuDos-${PV}.pk3"
@@ -13,6 +13,7 @@ DESCRIPTION="Enhanced Quake 2 engine"
 HOMEPAGE="https://github.com/ZwS/qudos;
 SRC_URI="mirror://gentoo/${FILE_STEM}.tar.bz2
https://github.com/ZwS/qudos/raw/master/quake2/baseq2/qudos.pk3 -> 
${PK3_FILE}"
+S="${WORKDIR}"/${FILE_STEM}
 
 LICENSE="GPL-2+"
 SLOT="0"
@@ -34,13 +35,19 @@ DEPEND="opengl? (
x11-libs/libXext
x11-libs/libXxf86dga
x11-libs/libXxf86vm"
-RDEPEND="${DEPEND}
+RDEPEND="
+   ${DEPEND}
cdinstall? ( games-fps/quake2-data )
demo? ( games-fps/quake2-demodata[symlink] )
-   textures? ( games-fps/quake2-textures )"
+   textures? ( games-fps/quake2-textures )
+"
 
-S=${WORKDIR}/${FILE_STEM}
-dir=${GAMES_DATADIR}/${MY_PN}
+dir=usr/share/${MY_PN}
+
+PATCHES=(
+   "${FILESDIR}"/${P}-libpng15.patch
+   "${FILESDIR}"/${P}-gnusource.patch
+)
 
 default_client() {
if use opengl || use sdl || ! use dedicated ; then
@@ -51,8 +58,6 @@ default_client() {
 }
 
 pkg_setup() {
-   games_pkg_setup
-
if ! use qmax && $( use opengl || use sdl ) ; then
elog "The 'qmax' graphical improvements are recommended."
echo
@@ -85,12 +90,12 @@ src_unpack() {
 }
 
 src_prepare() {
-   rm docs/gnu.txt
+   rm docs/gnu.txt || die
 
# Change default sound driver and its location
sed -i \
-e "s:\"oss\":\"${snd_drv}\":" \
-   -e "s:\"\./snd:\"$(games_get_libdir)/${PN}/snd:" \
+   -e "s:\"\./snd:\"/usr/$(get_libdir)/${PN}/snd:" \
src/client/snd_dma.c || die
 
sed -i \
@@ -102,11 +107,12 @@ src_prepare() {
-e '1i#define OF(x) x' \
src/qcommon/unzip/ioapi.h || die
fi
+
sed -i -e '106,119 s/CFL/LED/' Makefile || die
 
-   epatch \
-   "${FILESDIR}"/${P}-libpng15.patch \
-   "${FILESDIR}"/${P}-gnusource.patch
+   sed -i -e 's:-L/usr/lib -L$(LOCALBASE)/lib :: ' Makefile || die
+
+   default
 }
 
 src_configure() {
@@ -115,7 +121,9 @@ src_configure() {
 }
 
 src_compile() {
-   yesno() { usex $1 YES NO; }
+   yesno() {
+   usex ${1} YES NO;
+   }
 
local client="YES"
default_client || client="NO"
@@ -137,7 +145,7 @@ src_compile() {
TYPE="${type}" \
DATADIR="${dir}" \
LOCALBASE=/usr \
-   LIBDIR="$(games_get_libdir)"/${PN} \
+   LIBDIR="/usr/$(get_libdir)"/${PN} \
WITH_QMAX=$(yesno qmax) \
BUILD_3ZB2=$(yesno mods) \
BUILD_CTF=$(yesno mods) \
@@ -157,24 +165,24 @@ src_compile() {
 
 src_install() {
if default_client ; then
-   newgamesbin ${MY_PN}/QuDos ${PN}
+   newbin ${MY_PN}/QuDos ${PN}
+
# Change from gif to png in