commit:     359a269725785328df0c0cf856d1e8374d98735e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 10 01:24:28 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 10 01:24:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=359a2697

sci-libs/plplot: fix modern C issue in (CMake) configure

Closes: https://bugs.gentoo.org/879761
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../plplot/files/plplot-5.15.0_p6-configure-c99.patch  | 18 ++++++++++++++++++
 ...lot-5.15.0_p6.ebuild => plplot-5.15.0_p6-r1.ebuild} |  1 +
 2 files changed, 19 insertions(+)

diff --git a/sci-libs/plplot/files/plplot-5.15.0_p6-configure-c99.patch 
b/sci-libs/plplot/files/plplot-5.15.0_p6-configure-c99.patch
new file mode 100644
index 000000000000..60bb7aaf4501
--- /dev/null
+++ b/sci-libs/plplot/files/plplot-5.15.0_p6-configure-c99.patch
@@ -0,0 +1,18 @@
+https://bugs.gentoo.org/879761
+https://sourceforge.net/p/plplot/patches/37/
+
+Avoid implicitly declaring exit.  Future compilers will not support
+implicit function declarations, so this cmake probe will always fail.
+
+--- a/cmake/modules/TestForHighBitCharacters.c
++++ b/cmake/modules/TestForHighBitCharacters.c
+@@ -17,6 +17,6 @@ int
+    int i;
+    for (i = 0; i < 256; i++)
+      if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i))
+-       exit(1);
+-   exit (0);
++       return 1;
++   return 0;
+ }
+

diff --git a/sci-libs/plplot/plplot-5.15.0_p6.ebuild 
b/sci-libs/plplot/plplot-5.15.0_p6-r1.ebuild
similarity index 99%
rename from sci-libs/plplot/plplot-5.15.0_p6.ebuild
rename to sci-libs/plplot/plplot-5.15.0_p6-r1.ebuild
index 57b6884acdff..9ea598c98339 100644
--- a/sci-libs/plplot/plplot-5.15.0_p6.ebuild
+++ b/sci-libs/plplot/plplot-5.15.0_p6-r1.ebuild
@@ -120,6 +120,7 @@ src_prepare() {
        for p in $(<"${WORKDIR}"/debian/patches/series) ; do
                eapply -p1 "${WORKDIR}/debian/patches/${p}"
        done
+       eapply "${FILESDIR}"/${PN}-5.15.0_p6-configure-c99.patch
 
        # avoid installing license
        sed -i -e '/COPYING.LIB/d' CMakeLists.txt || die

Reply via email to