summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games-arcade/netris/files/netris-0.52-clang16.patch31
-rw-r--r--games-arcade/netris/netris-0.52-r4.ebuild (renamed from games-arcade/netris/netris-0.52-r3.ebuild)9
2 files changed, 38 insertions, 2 deletions
diff --git a/games-arcade/netris/files/netris-0.52-clang16.patch b/games-arcade/netris/files/netris-0.52-clang16.patch
new file mode 100644
index 000000000000..7d13d02975bf
--- /dev/null
+++ b/games-arcade/netris/files/netris-0.52-clang16.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/874021
+--- a/Configure
++++ b/Configure
+@@ -78,3 +78,3 @@
+ echo "Checking for libraries"
+-echo 'main(){}' > test.c
++echo 'int main(void){return 0;}' > test.c
+ LFLAGS=""
+@@ -96,4 +96,5 @@
+ cat << END > test.c
+-void handler(void) {}
+-main() { on_exit(handler, (void *)0); }
++#include <stdlib.h>
++void handler(int a, void *b) {}
++int main(void) { on_exit(handler, (void *)0); return 0; }
+ END
+@@ -108,3 +109,3 @@
+ #include <signal.h>
+-main() { sigset_t set; sigprocmask(SIG_BLOCK, &set, &set); }
++int main(void) { sigset_t set; sigprocmask(SIG_BLOCK, &set, &set); return 0; }
+ END
+@@ -119,3 +120,3 @@
+ #include <getopt.h>
+-main(){}
++int main(void){return 0;}
+ END
+@@ -131,3 +132,3 @@
+ #include <memory.h>
+-main(){}
++int main(void){return 0;}
+ END
diff --git a/games-arcade/netris/netris-0.52-r3.ebuild b/games-arcade/netris/netris-0.52-r4.ebuild
index 54f80a22be4d..6f5c8b733523 100644
--- a/games-arcade/netris/netris-0.52-r3.ebuild
+++ b/games-arcade/netris/netris-0.52-r4.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-inherit toolchain-funcs
+inherit flag-o-matic toolchain-funcs
DEB_VER="10"
DESCRIPTION="Classic networked version of T*tris"
@@ -26,6 +26,7 @@ src_prepare() {
eapply "${S}"/../debian/patches/[01]*
eapply "${FILESDIR}"/${P}-tinfo.patch
+ eapply "${FILESDIR}"/${P}-clang16.patch
# bug #185332
sed -i \
@@ -53,6 +54,10 @@ src_prepare() {
}
src_configure() {
+ append-cflags -std=gnu89 # old codebase, incompatible with c2x
+ append-cppflags -D_DEFAULT_SOURCE #874021, for on_exit()
+ append-cflags ${CPPFLAGS}
+
bash ./Configure -O || die
}