diff options
author | Ionen Wolkens <ionen@gentoo.org> | 2022-10-16 12:27:06 -0400 |
---|---|---|
committer | Ionen Wolkens <ionen@gentoo.org> | 2022-10-16 12:59:05 -0400 |
commit | 8a3473c6b639d633ba9517468e01e5a268d99b14 (patch) | |
tree | 65545c6fcdfc79168f7b8975113173a2798f0b0c /games-roguelike | |
parent | x11-wm/vtwm: EAPI7->8, drop rplay, fix w/ clang16, -std=gnu89 (diff) | |
download | gentoo-8a3473c6b639d633ba9517468e01e5a268d99b14.tar.gz gentoo-8a3473c6b639d633ba9517468e01e5a268d99b14.tar.bz2 gentoo-8a3473c6b639d633ba9517468e01e5a268d99b14.zip |
games-roguelike/nethack: fix build w/ clang16, pass -std=gnu89
wrt -Wno-error, this has the same problem as net-misc/vncrec
for which there's not much that can reasonably be done about
here (and is harmless).
Closes: https://bugs.gentoo.org/874462
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'games-roguelike')
-rw-r--r-- | games-roguelike/nethack/files/nethack-3.6.6-clang16.patch | 10 | ||||
-rw-r--r-- | games-roguelike/nethack/nethack-3.6.6-r1.ebuild (renamed from games-roguelike/nethack/nethack-3.6.6.ebuild) | 22 |
2 files changed, 27 insertions, 5 deletions
diff --git a/games-roguelike/nethack/files/nethack-3.6.6-clang16.patch b/games-roguelike/nethack/files/nethack-3.6.6-clang16.patch new file mode 100644 index 000000000000..b8a67644b80e --- /dev/null +++ b/games-roguelike/nethack/files/nethack-3.6.6-clang16.patch @@ -0,0 +1,10 @@ +https://bugs.gentoo.org/874462 +--- a/win/tty/wintty.c ++++ b/win/tty/wintty.c +@@ -26,2 +26,6 @@ + ++#ifdef DEF_PAGER ++#include <fcntl.h> ++#endif ++ + #ifndef NO_TERMS diff --git a/games-roguelike/nethack/nethack-3.6.6.ebuild b/games-roguelike/nethack/nethack-3.6.6-r1.ebuild index 1d26ceda38ae..7c457f11ab98 100644 --- a/games-roguelike/nethack/nethack-3.6.6.ebuild +++ b/games-roguelike/nethack/nethack-3.6.6-r1.ebuild @@ -8,6 +8,7 @@ inherit desktop flag-o-matic toolchain-funcs DESCRIPTION="The ultimate old-school single player dungeon exploration game" HOMEPAGE="https://www.nethack.org/" SRC_URI="https://nethack.org/download/${PV}/nethack-${PV//.}-src.tgz -> ${P}.tar.gz" +S="${WORKDIR}/NetHack-NetHack-${PV}_Released" LICENSE="nethack" SLOT="0" @@ -18,6 +19,7 @@ RDEPEND=" acct-group/gamestat sys-libs/ncurses:0= X? ( + x11-libs/libX11 x11-libs/libXaw x11-libs/libXpm x11-libs/libXt @@ -36,25 +38,35 @@ BDEPEND=" ) " -S="${WORKDIR}/NetHack-NetHack-${PV}_Released" +PATCHES=( + "${FILESDIR}/${PN}-3.6.3-recover.patch" + "${FILESDIR}/${PN}-3.6.6-wunused-result.patch" # bug 830556 + "${FILESDIR}/${PN}-3.6.6-clang16.patch" +) src_prepare() { - eapply "${FILESDIR}/${PN}-3.6.3-recover.patch" - eapply "${FILESDIR}/${PN}-3.6.6-wunused-result.patch" # bug 830556 - eapply_user + default cp "${FILESDIR}/${PN}-3.6.3-hint-$(usex X x11 tty)" hint || die "Failed to copy hint file" sys/unix/setup.sh hint || die "Failed to run setup.sh" } src_compile() { + append-cflags -std=gnu89 # old codebase, incompatible with c2x append-cflags -I../include -DDLB -DSECURE -DTIMED_DELAY -DVISION_TABLES -DDUMPLOG -DSCORE_ON_BOTL append-cflags '-DCOMPRESS=\"${EPREFIX}/bin/gzip\"' '-DCOMPRESS_EXTENSION=\".gz\"' append-cflags "-DHACKDIR=\\\"${EPREFIX}/usr/$(get_libdir)/nethack\\\"" "-DVAR_PLAYGROUND=\\\"${EPREFIX}/var/games/nethack\\\"" append-cflags "-DDEF_PAGER=\\\"${PAGER}\\\"" append-cflags -DSYSCF "-DSYSCF_FILE=\\\"${EPREFIX}/etc/nethack.sysconf\\\"" - use X && append-cflags -DX11_GRAPHICS -DUSE_XPM + if use X; then + append-cflags -DX11_GRAPHICS -DUSE_XPM + + # XtErrorHandler usage seems right, but headers "may" add ((noreturn)) + # giving an incompatible type error with clang-16 (could alternatively + # use private _X_NORETURN but this may be fragile) + append-cflags -Wno-error=incompatible-pointer-types #874462 + fi LOCAL_MAKEOPTS=( CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LFLAGS="${LDFLAGS}" |