commit:     23992eb4e9aadd9e4db52362305b1a7812e97e7b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 15 06:15:16 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 15 06:15:16 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23992eb4

media-gfx/gnofract4d: fix build w/ clang 16

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/gnofract4d-4.3_p20221125-clang16.patch   | 44 ++++++++++++++++++++++
 ...5.ebuild => gnofract4d-4.3_p20221125-r1.ebuild} |  4 ++
 2 files changed, 48 insertions(+)

diff --git a/media-gfx/gnofract4d/files/gnofract4d-4.3_p20221125-clang16.patch 
b/media-gfx/gnofract4d/files/gnofract4d-4.3_p20221125-clang16.patch
new file mode 100644
index 000000000000..3ca2ae35911a
--- /dev/null
+++ b/media-gfx/gnofract4d/files/gnofract4d-4.3_p20221125-clang16.patch
@@ -0,0 +1,44 @@
+https://github.com/fract4d/gnofract4d/pull/254
+
+From dd92a4bf2c6e68352203c511f465846e5c96407b Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Fri, 14 Apr 2023 09:33:28 +0200
+Subject: [PATCH] Declare image_lookup, gradient in fract_stdlib.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This avoids test failures in generated code with C compilers
+that do not support implicit function declartions:
+
+>           raise fracttypes.TranslationError(
+                "Error reported by C compiler:%s" % output)
+E           fract4d_compiler.fracttypes.TranslationError: Error reported by C 
co
+mpiler:/tmp/fract4d_4tueiy9c/gnofract4d-cache/fract4d_9ebc1853081db2ea5eb7cce846
+42cd4e.c: In function ‘pf_calc’:
+E           
/tmp/fract4d_4tueiy9c/gnofract4d-cache/fract4d_9ebc1853081db2ea5eb7c
+ce84642cd4e.c:282:1: error: implicit declaration of function ‘image_lookup’
+E             282 | image_lookup(t__a_cf1image,z_re,z_im, &t__cf10, &t__cf11, 
&t
+__cf12);
+E                 | ^~~~~~~~~~~~
+
+
+>           raise fracttypes.TranslationError(
+                "Error reported by C compiler:%s" % output)
+E           fract4d_compiler.fracttypes.TranslationError: Error reported by C 
compiler:/tmp/fract4d_4tueiy9c/gnofract4d-cache/fract4d_2ccc81a001cdf717973d45d4cbd12778.c:
 In function ‘pf_calc’:
+E           
/tmp/fract4d_4tueiy9c/gnofract4d-cache/fract4d_2ccc81a001cdf717973d45d4cbd12778.c:323:1:
 error: implicit declaration of function ‘gradient’
+E             323 | gradient(t__a__gradient,t__cf09, &t__cf010, &t__cf011, 
&t__cf012);
+E                 | ^~~~~~~~
+--- a/fract4d/c/fract_stdlib.h
++++ b/fract4d/c/fract_stdlib.h
+@@ -52,6 +52,9 @@ extern "C"
+     double read_float_array_2D(void *array, int x, int y);
+     int write_float_array_2D(void *array, int x, int y, double val);
+ 
++    void image_lookup(void *im, double x, double y, double *pr, double *pg, 
double *pb);
++    void gradient(void *grad_object, double index, double *r, double *g, 
double *b);
++
+ #ifdef __cplusplus
+ }
+ #endif
+

diff --git a/media-gfx/gnofract4d/gnofract4d-4.3_p20221125.ebuild 
b/media-gfx/gnofract4d/gnofract4d-4.3_p20221125-r1.ebuild
similarity index 95%
rename from media-gfx/gnofract4d/gnofract4d-4.3_p20221125.ebuild
rename to media-gfx/gnofract4d/gnofract4d-4.3_p20221125-r1.ebuild
index 8fc1f112c6e4..2132a58fe933 100644
--- a/media-gfx/gnofract4d/gnofract4d-4.3_p20221125.ebuild
+++ b/media-gfx/gnofract4d/gnofract4d-4.3_p20221125-r1.ebuild
@@ -38,6 +38,10 @@ distutils_enable_tests pytest
 
 S="${WORKDIR}/${PN}-${COMMIT}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.3_p20221125-clang16.patch
+)
+
 src_prepare() {
        sed -i -e "s:share/doc/gnofract4d/:share/doc/${PF}/:" setup.py || die
 

Reply via email to