Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 915841
Collapse All | Expand All

(-)a/games-roguelike/nethack/Manifest (+1 lines)
Line 1 Link Here
1
DIST nethack-3.6.6.tar.gz 5577633 BLAKE2B 7b4b12f3a711785c86208dab83f9de725c33470e056ee57e6d96c3a68f06c1d0d98343ed82eca669986361d0663ddbe56d9a74d9cb45b42bf005c2f323b3cd79 SHA512 579fde93a37a1b5df637d5bac2601194beeb455c175fbe3ef89342122c8567bb8221ce60d8a6168e6b45c67ade7d7b09c86bf202c8cbe2d6294d276be3e53055
1
DIST nethack-3.6.6.tar.gz 5577633 BLAKE2B 7b4b12f3a711785c86208dab83f9de725c33470e056ee57e6d96c3a68f06c1d0d98343ed82eca669986361d0663ddbe56d9a74d9cb45b42bf005c2f323b3cd79 SHA512 579fde93a37a1b5df637d5bac2601194beeb455c175fbe3ef89342122c8567bb8221ce60d8a6168e6b45c67ade7d7b09c86bf202c8cbe2d6294d276be3e53055
2
DIST nethack-3.6.7.tar.gz 5577415 BLAKE2B a03cfe973b0470efe052eee49c312818755e33cf5148a2c39beecf052e44dfe951c6c63a3ff58ce826fa656647ad5bbe558b4854a50fcf987d80014ef4707505 SHA512 7890d17e087f4344d30e9a908fa1f24d7c72bc714c4a6415ed59800902cc0aa6b3ce94c5d73857b0222349b96b1fdc8bf3f93b3ac1153477ad1419af7b0d3fb5
(-)a/games-roguelike/nethack/nethack-3.6.7.ebuild (-1 / +147 lines)
Line 0 Link Here
0
- 
1
# Copyright 1999-2022 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
6
inherit desktop flag-o-matic toolchain-funcs
7
8
DESCRIPTION="The ultimate old-school single player dungeon exploration game"
9
HOMEPAGE="https://www.nethack.org/"
10
SRC_URI="https://nethack.org/download/${PV}/nethack-${PV//.}-src.tgz -> ${P}.tar.gz"
11
S="${WORKDIR}/NetHack-${PV}"
12
13
LICENSE="nethack"
14
SLOT="0"
15
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~x86"
16
IUSE="X"
17
18
RDEPEND="
19
	acct-group/gamestat
20
	sys-libs/ncurses:0=
21
	X? (
22
		x11-libs/libX11
23
		x11-libs/libXaw
24
		x11-libs/libXpm
25
		x11-libs/libXt
26
	)
27
"
28
DEPEND="
29
	${RDEPEND}
30
	X? ( x11-base/xorg-proto )
31
"
32
BDEPEND="
33
	virtual/pkgconfig
34
	app-alternatives/yacc
35
	X? (
36
		x11-apps/bdftopcf
37
		x11-apps/mkfontscale
38
	)
39
"
40
41
PATCHES=(
42
	"${FILESDIR}/${PN}-3.6.6-clang16.patch"
43
)
44
45
src_prepare() {
46
	default
47
48
	cp "${FILESDIR}/${PN}-3.6.3-hint-$(usex X x11 tty)" hint || die "Failed to copy hint file"
49
	sys/unix/setup.sh hint || die "Failed to run setup.sh"
50
}
51
52
src_compile() {
53
	append-cflags -std=gnu89 # old codebase, incompatible with c2x
54
	append-cflags -I../include -DDLB -DSECURE -DTIMED_DELAY -DVISION_TABLES -DDUMPLOG -DSCORE_ON_BOTL
55
	append-cflags '-DCOMPRESS=\"${EPREFIX}/bin/gzip\"' '-DCOMPRESS_EXTENSION=\".gz\"'
56
	append-cflags "-DHACKDIR=\\\"${EPREFIX}/usr/$(get_libdir)/nethack\\\"" "-DVAR_PLAYGROUND=\\\"${EPREFIX}/var/games/nethack\\\""
57
	append-cflags "-DDEF_PAGER=\\\"${PAGER}\\\""
58
	append-cflags -DSYSCF "-DSYSCF_FILE=\\\"${EPREFIX}/etc/nethack.sysconf\\\""
59
60
	if use X; then
61
		append-cflags -DX11_GRAPHICS -DUSE_XPM
62
63
		# XtErrorHandler usage seems right, but headers "may" add ((noreturn))
64
		# giving an incompatible type error with clang-16 (could alternatively
65
		# use private _X_NORETURN but this may be fragile)
66
		append-cflags -Wno-error=incompatible-pointer-types #874462
67
	fi
68
69
	LOCAL_MAKEOPTS=(
70
		CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LFLAGS="${LDFLAGS}"
71
		WINTTYLIB="$($(tc-getPKG_CONFIG) --libs ncurses)"
72
		HACKDIR="${EPREFIX}/usr/$(get_libdir)/nethack" INSTDIR="${ED}/usr/$(get_libdir)/nethack"
73
		SHELLDIR="${ED}/usr/bin" VARDIR="${ED}/var/games/nethack"
74
		)
75
76
	emake "${LOCAL_MAKEOPTS[@]}" nethack recover Guidebook spec_levs
77
78
	# Upstream still has some parallel compilation bugs
79
	emake -j1 "${LOCAL_MAKEOPTS[@]}" all
80
}
81
82
src_install() {
83
	emake "${LOCAL_MAKEOPTS[@]}" install
84
85
	mv "${ED}/usr/$(get_libdir)/nethack/recover" "${ED}/usr/bin/recover-nethack" || die "Failed to move recover-nethack"
86
87
	doman doc/nethack.6
88
	newman doc/recover.6 recover-nethack.6
89
	dodoc doc/Guidebook.txt
90
91
	insinto /etc
92
	newins sys/unix/sysconf nethack.sysconf
93
94
	insinto /etc/skel
95
	newins "${FILESDIR}/${PN}-3.6.0-nethackrc" .nethackrc
96
97
	if use X ; then
98
		cd "${S}/win/X11" || die "Failed to enter win/X11 directory"
99
100
		mkdir -p "${ED}/etc/X11/app-defaults/" || die "Failed to make app-defaults directory"
101
		mv "${ED}/usr/$(get_libdir)/nethack/NetHack.ad" "${ED}/etc/X11/app-defaults/" || die "Failed to move NetHack.ad"
102
103
		newicon nh_icon.xpm nethack.xpm
104
		make_desktop_entry ${PN} Nethack
105
106
		# install nethack fonts
107
		bdftopcf -o nh10.pcf nh10.bdf || die "Converting fonts failed"
108
		bdftopcf -o ibm.pcf ibm.bdf || die "Converting fonts failed"
109
		insinto "/usr/$(get_libdir)/nethack/fonts"
110
		doins *.pcf
111
		mkfontdir "${ED}/usr/$(get_libdir)/nethack/fonts" || die "mkfontdir failed"
112
	fi
113
114
	rm -r "${ED}/var/games/nethack" || die "Failed to clean var/games/nethack"
115
	keepdir /var/games/nethack/save
116
}
117
118
pkg_preinst() {
119
	fowners root:gamestat /var/games/nethack /var/games/nethack/save
120
	fperms 2770 /var/games/nethack /var/games/nethack/save
121
122
	fowners root:gamestat "/usr/$(get_libdir)/nethack/nethack"
123
	fperms g+s "/usr/$(get_libdir)/nethack/nethack"
124
}
125
126
pkg_postinst() {
127
	cd "${EROOT}/var/games/nethack" || die "Failed to enter ${EROOT}/var/games/nethack directory"
128
129
	# Transition mechanism for <nethack-3.6.1 ebuilds. It's perfectly safe, so we'll just run it unconditionally.
130
	chmod 2770 . save || die "Failed to chmod statedir"
131
132
	# Those files can't be created earlier because we don't want portage to wipe them during upgrades
133
	( umask 007 && touch logfile perm record xlogfile ) || die "Failed to create log files"
134
135
	# Instead of using a proper version header in its save files, nethack checks for incompatibilities
136
	# by comparing the mtimes of save files and its own binary. This would require admin interaction even
137
	# during upgrades which don't change the file format, so we'll just touch the files and warn the admin
138
	# manually in case of compatibility issues.
139
	(
140
		shopt -s nullglob
141
		local saves=( bones* save/* )
142
		[[ -n "${saves[*]}" ]] && touch -c "${saves[@]}"
143
	) # non-fatal
144
145
	elog "A minimal default .nethackrc has been placed in /etc/skel/"
146
	elog "The sysconf file is at /etc/nethack.sysconf"
147
}

Return to bug 915841