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