diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-10-14 07:49:00 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-10-14 07:56:25 -0400 |
commit | ed192a5ae0261aa59a25677fa29bce0f29fe5bcf (patch) | |
tree | e06153b612a7ae8551d79a3925fa56a32809981f /games-arcade/netris/netris-0.52-r4.ebuild | |
parent | app-crypt/coolkey: fix build w/ upcoming clang16 (diff) | |
download | gentoo-ed192a5ae0261aa59a25677fa29bce0f29fe5bcf.tar.gz gentoo-ed192a5ae0261aa59a25677fa29bce0f29fe5bcf.tar.bz2 gentoo-ed192a5ae0261aa59a25677fa29bce0f29fe5bcf.zip |
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 <ionen@gentoo.org>
Diffstat (limited to 'games-arcade/netris/netris-0.52-r4.ebuild')
-rw-r--r-- | games-arcade/netris/netris-0.52-r4.ebuild | 68 |
1 files changed, 68 insertions, 0 deletions
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 <sys/types.h> \ +#include <time.h> +' \ + -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 +} |