From ed192a5ae0261aa59a25677fa29bce0f29fe5bcf Mon Sep 17 00:00:00 2001 From: Ionen Wolkens Date: Fri, 14 Oct 2022 07:49:00 -0400 Subject: games-arcade/netris: fix build w/ upcoming clang16 + pass std=gnu89 Tests silently failed (errors to /dev/null, and no confirmation), then it silently skip including the header it didn't find. (just a quick fix, this could use cleanups, better patches, and no sed) Closes: https://bugs.gentoo.org/874021 Signed-off-by: Ionen Wolkens --- .../netris/files/netris-0.52-clang16.patch | 31 ++++++++++ games-arcade/netris/netris-0.52-r3.ebuild | 63 -------------------- games-arcade/netris/netris-0.52-r4.ebuild | 68 ++++++++++++++++++++++ 3 files changed, 99 insertions(+), 63 deletions(-) create mode 100644 games-arcade/netris/files/netris-0.52-clang16.patch delete mode 100644 games-arcade/netris/netris-0.52-r3.ebuild create mode 100644 games-arcade/netris/netris-0.52-r4.ebuild 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 ++void handler(int a, void *b) {} ++int main(void) { on_exit(handler, (void *)0); return 0; } + END +@@ -108,3 +109,3 @@ + #include +-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 +-main(){} ++int main(void){return 0;} + END +@@ -131,3 +132,3 @@ + #include +-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-r3.ebuild deleted file mode 100644 index 54f80a22be4d..000000000000 --- a/games-arcade/netris/netris-0.52-r3.ebuild +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit toolchain-funcs - -DEB_VER="10" -DESCRIPTION="Classic networked version of T*tris" -HOMEPAGE="http://www.netris.org/" -SRC_URI="ftp://ftp.netris.org/pub/netris/${P}.tar.gz - mirror://debian/pool/main/n/netris/netris_${PV}-${DEB_VER}.debian.tar.xz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~mips ~x86" -IUSE="" - -DEPEND="sys-libs/ncurses:0=" -RDEPEND="${DEPEND}" - -src_prepare() { - default - - tc-export CC CXX LD AR RANLIB - - eapply "${S}"/../debian/patches/[01]* - eapply "${FILESDIR}"/${P}-tinfo.patch - - # bug #185332 - sed -i \ - -e '/sys\/time/ i\ -#include \ -#include -' \ - -e '/netint2/ s/short/int16_t/' \ - -e '/netint4/ s/long/int32_t/' \ - netris.h || die - sed -i \ - -e 's/volatile //g' \ - -e '/Be more forgiving/d' \ - -e 's/static myRandSeed/static int myRandSeed/' \ - util.c || die - sed -i \ - -e 's/\(long pauseTimeLeft\)/\1 = 0/' \ - game.c || die - sed -i \ - -e '/^CC/d' \ - -e '/^COPT/d' \ - -e '/^CFLAGS/d' \ - -e 's/(LFLAGS)/(LDFLAGS) $(LFLAGS)/' \ - Configure || die -} - -src_configure() { - bash ./Configure -O || die -} - -src_install() { - dobin netris - newbin sr netris-sample-robot - dodoc FAQ README robot_desc -} diff --git a/games-arcade/netris/netris-0.52-r4.ebuild b/games-arcade/netris/netris-0.52-r4.ebuild new file mode 100644 index 000000000000..6f5c8b733523 --- /dev/null +++ b/games-arcade/netris/netris-0.52-r4.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +DEB_VER="10" +DESCRIPTION="Classic networked version of T*tris" +HOMEPAGE="http://www.netris.org/" +SRC_URI="ftp://ftp.netris.org/pub/netris/${P}.tar.gz + mirror://debian/pool/main/n/netris/netris_${PV}-${DEB_VER}.debian.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~mips ~x86" +IUSE="" + +DEPEND="sys-libs/ncurses:0=" +RDEPEND="${DEPEND}" + +src_prepare() { + default + + tc-export CC CXX LD AR RANLIB + + eapply "${S}"/../debian/patches/[01]* + eapply "${FILESDIR}"/${P}-tinfo.patch + eapply "${FILESDIR}"/${P}-clang16.patch + + # bug #185332 + sed -i \ + -e '/sys\/time/ i\ +#include \ +#include +' \ + -e '/netint2/ s/short/int16_t/' \ + -e '/netint4/ s/long/int32_t/' \ + netris.h || die + sed -i \ + -e 's/volatile //g' \ + -e '/Be more forgiving/d' \ + -e 's/static myRandSeed/static int myRandSeed/' \ + util.c || die + sed -i \ + -e 's/\(long pauseTimeLeft\)/\1 = 0/' \ + game.c || die + sed -i \ + -e '/^CC/d' \ + -e '/^COPT/d' \ + -e '/^CFLAGS/d' \ + -e 's/(LFLAGS)/(LDFLAGS) $(LFLAGS)/' \ + Configure || die +} + +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 +} + +src_install() { + dobin netris + newbin sr netris-sample-robot + dodoc FAQ README robot_desc +} -- cgit v1.2.3