commit:     32a2ca20d1e2121516ea8a6aa461052983b9b399
Author:     Pascal Jäger <pascal.jaeger <AT> leimstift <DOT> de>
AuthorDate: Thu Dec 15 08:06:55 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 05:02:33 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32a2ca20

media-gfx/quat: fix build for clang16

Closes: https://bugs.gentoo.org/871213

Signed-off-by: Pascal Jäger <pascal.jaeger <AT> leimstift.de>
Closes: https://github.com/gentoo/gentoo/pull/28670
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/quat-1.20-fix-build-for-clang16.patch    | 84 ++++++++++++++++++++++
 media-gfx/quat/quat-1.20-r3.ebuild                 | 43 +++++++++++
 2 files changed, 127 insertions(+)

diff --git a/media-gfx/quat/files/quat-1.20-fix-build-for-clang16.patch 
b/media-gfx/quat/files/quat-1.20-fix-build-for-clang16.patch
new file mode 100644
index 000000000000..b9e0006b1932
--- /dev/null
+++ b/media-gfx/quat/files/quat-1.20-fix-build-for-clang16.patch
@@ -0,0 +1,84 @@
+Clang16 will not support implicit integers, implicit function declarations and
+implicit integer to pointer conversions by default. 
+This patch overhauls the source code to comply with modern C standards.
+
+Bug: https://bugs.gentoo.org/871213
+This patch was sent upstream via mail. 
+
+Pascal Jäger <pascal.jae...@leimstift.de> (2022-12-15)
+
+--- a/kernel/colors.c
++++ b/kernel/colors.c
+@@ -117,11 +117,7 @@ int CalcWeightsum(struct realpal_struct *realpal)
+    return(0);
+ }
+ 
+-int CreateDispPal(disppal, realpal, maxcol, phongmax, rdepth, gdepth, bdepth)
+-   struct disppal_struct *disppal;
+-   struct realpal_struct *realpal;
+-   int maxcol, rdepth, gdepth, bdepth;
+-   double phongmax;
++int CreateDispPal (struct disppal_struct *disppal, struct realpal_struct 
*realpal, int maxcol, double phongmax, int rdepth, int gdepth, int bdepth)
+ {
+    int i, j, requiredcols, maxdepth, maxbright, oswcols;
+    int disppos; 
+
+--- a/kernel/files.c
++++ b/kernel/files.c
+@@ -374,22 +374,7 @@ int ParseFile(const char *nam, const char *_altpath, 
struct keyword_struct kword
+    return(0);
+ }
+ 
+-int PNGInitialization(name, mode, png, png_info, png_internal, xstart, 
ystart, calctime, f,
+-   v, pal, realpal, colorscheme, cutbuf, zflag)
+-const char *name;
+-int mode;
+-FILE **png;
+-struct png_info_struct *png_info;
+-struct png_internal_struct *png_internal;
+-int xstart, ystart;
+-long calctime;
+-struct frac_struct *f;
+-struct view_struct *v;
+-struct disppal_struct *pal;
+-struct realpal_struct *realpal;
+-char *colorscheme;
+-double *cutbuf;
+-int zflag;
++int PNGInitialization (const char *name, int mode, FILE **png, struct 
png_info_struct *png_info, struct png_internal_struct *png_internal, int 
xstart, int ystart, long calctime, struct frac_struct *f, struct view_struct 
*v, struct disppal_struct *pal, struct realpal_struct *realpal, char 
*colorscheme, double *cutbuf, int zflag)
+ /* rewrites file "name" */
+ {
+    int i, j, pos, cutpos;
+--- a/kernel/quat.c
++++ b/kernel/quat.c
+@@ -794,7 +794,7 @@ int CalculateFractal(char *Error, char *pngfile, FILE 
**png,/* struct png_info_s
+       return(-1);
+    }
+          
+-   my_time = (long)time((time_t)NULL);
++   my_time = (long)time((time_t*)NULL);
+    if (frac.formula==0)
+    { 
+       cr.iterate = iterate_0; cr.iternorm = iternorm_0;
+--- a/kernel/textver.c
++++ b/kernel/textver.c
+@@ -143,7 +143,7 @@ int TEXTVER_putline(long x1, long x2, long xres, int y, 
unsigned char *Buf, int
+    return(0);
+ }
+ 
+-int TEXTVER_check_event()
++int TEXTVER_check_event (void)
+ {
+ #ifdef __unix__
+       if (keypressed()) 
+--- a/kernel/quat.c
++++ b/kernel/quat.c
+@@ -949,7 +949,7 @@ int CalculateFractal(char *Error, char *pngfile, FILE 
**png,/* struct png_info_s
+        { 
+           i = view.xres*3; if (IsStereo(&view)) i *= 2;
+           memset(line, 0, (size_t)i+1);
+-          calc_time += (long)time((time_t)NULL) - my_time;
++          calc_time += (long)time((time_t*)NULL) - my_time;
+           if (png != NULL)
+           {
+              PNGEnd(png_internal, line, 0, j);

diff --git a/media-gfx/quat/quat-1.20-r3.ebuild 
b/media-gfx/quat/quat-1.20-r3.ebuild
new file mode 100644
index 000000000000..f959b5ad2329
--- /dev/null
+++ b/media-gfx/quat/quat-1.20-r3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic
+
+DESCRIPTION="A 3D quaternionic fractal generator"
+HOMEPAGE="http://www.physcip.uni-stuttgart.de/phy11733/quat_e.html";
+SRC_URI="http://www.physcip.uni-stuttgart.de/phy11733/download/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="X debug"
+
+DEPEND="
+       >=sys-libs/zlib-1.1.4
+       X? (
+               =x11-libs/fltk-1*
+               x11-libs/libX11
+               x11-libs/libXext
+               x11-libs/libXft
+       )
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${P}-fix-build-for-clang16.patch" )
+
+src_configure() {
+       # throws tons of warnings otherwise
+       append-cxxflags -Wno-deprecated-declarations -Wno-writable-strings
+       export FLUID="/usr/bin/fluid" # needed because configure tries an 
invalid option
+       econf \
+               $(use_enable X gui) \
+               $(use_enable debug) \
+               $(use_enable debug prof)
+}
+
+src_install() {
+       emake DESTDIR="${D}" install
+       dodoc AUTHORS ChangeLog NEWS README
+}

Reply via email to