Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16402 - new ebuild for nethack: v3.4.1, as released today
Summary: new ebuild for nethack: v3.4.1, as released today
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-26 05:41 UTC by Peter Gantner (a.k.a. nephros)
Modified: 2003-04-15 12:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Gantner (a.k.a. nephros) 2003-02-26 05:41:40 UTC
The version was released today.

This is based on the 3.4.0-r6 ebuild, but I _removed_ the gnome and qt stuff, mostly because it depends on qt-2*, which I don't want to downgrade to (and nethack is the only app which depends on it!). Besides, nethack is meant to be played on a tty, if you want graphics, there are better solutions, like Falcon's Eye and glHack.
I left the X version in though, it looks the same anyway.

I changed the dodir [...]/games to keepdir as advised in bug #16162
NOTE: I did not test this a lot, but it compiles and runs fine.


Reproducible: Always
Steps to Reproduce:

1.
2.
3.
Comment 1 Peter Gantner (a.k.a. nephros) 2003-02-26 05:57:03 UTC
for unknown reasons, the attachment form does no work, so I cut&paste it here:

 -- SNIP HERE --
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/app-games/nethack/nethack-3.4.1-r1.ebuild,v 1.0 2003/02/26 08:40:49 aliz Exp $

inherit games

#SRC_URI="http://ftp.sourceforge.net/sourceforge/nethack/nethack-341.tgz"
SRC_URI="http://belnet.dl.sourceforge.net/sourceforge/nethack/nethack-341.tgz"
DESCRIPTION="The ultimate old-school single player dungeon exploration game"
HOMEPAGE="http://www.nethack.org/"

KEYWORDS="x86"
SLOT="0"
LICENSE="nethack"
IUSE="X"

DEPEND="virtual/glibc
	dev-util/yacc
	>=sys-libs/ncurses-5.2-r5
	X? ( x11-base/xfree )"

# Where nethack data is to be kept
HACKDIR=${GAMES_DATADIR}/${PN}

src_unpack() {
	unpack ${A}

	cd ${S}
	#patch -p1 < ${FILESDIR}/${PF}-gentoo.patch || die

	# This copies the /sys/unix Makefile.*s to their correct places for 
	# seding and compiling.
	cd ${S}/sys/unix
	source setup.sh || die

	# Nethack doesn't use ./configure.  Platform options have to be edited 
	# manually.  This also sets up /usr/share/nethackdir instead of 
	# /usr/games/lib/nethackdir.
	cd ${S}/include
	mv config.h config.h.orig
	sed -e 's:^\(#define COMPRESS\) .*:\1 "/bin/gzip":' \
		-e 's:^\(#define COMPRESS_EXTENSION\) .*:\1 ".gz":' \
		-e 's:^/\* \(#define DLB\) .*:\1:' \
		-e 's:/usr/games/lib/nethackdir:'${HACKDIR}':' \
		-e 's:^/\* \(#define VISION_TABLES\) .*:\1:' \
		config.h.orig >config.h || die # test, remove me if config.h ok
	rm config.h.orig

	cd ${S}/include
	mv unixconf.h unixconf.h.orig
	sed -e 's:^/\* \(#define LINUX\) .*:\1:' \
		-e 's:^/\* \(#define TIMED_DELAY\) .*:\1:' \
		unixconf.h.orig >unixconf.h || die
	rm unixconf.h.orig
	
	cd ${S}/src
	mv Makefile Makefile.orig
	sed -e 's:^\(WINTTYLIB =\).*:\1 -lncurses:' \
		Makefile.orig >Makefile || die
	rm Makefile.orig
	
	if [ `use X` ] ; then
		cd ${S}/include
		mv config.h config.h.orig
		sed -e 's:^/\* \(#define X11_GRAPHICS\) .*:\1:' \
			-e 's:^/\* \(# define USE_XPM\) .*:\1:' \
			config.h.orig >config.h || die
		rm config.h.orig
		
		cd ${S}
		mv Makefile Makefile.orig
		sed -e 's:^\(VARDATND =.*\):\1 x11tiles pet_mark.xbm rip.xpm:' \
			Makefile.orig >Makefile || die
		rm Makefile.orig
		
		# Add the X11 stuffs to the make list
		cd ${S}/src
		mv Makefile Makefile.orig
		sed -e 's:^\(WINSRC = .*\):\1 $(WINX11SRC):' \
			-e 's:^\(WINOBJ = .*\):\1 $(WINX11OBJ):' \
			-e 's:^\(WINLIB = .*\):\1 $(WINX11LIB):' \
			-e 's:^\(WINX11LIB =.*\):\1 -lXpm:' \
			Makefile.orig >Makefile || die
		rm Makefile.orig
	fi
}

src_compile() {
	cd ${S}/src
	# src/Makefile suggests -fomit-frame-pointer for nh on linux
	make \
		CC="gcc" \
		CFLAGS="${CFLAGS} -fomit-frame-pointer -I../include" \
		LFLAGS="-L/usr/X11R6/lib" || die

	cd ${S}/util
	make recover
}

src_install() {
	make \
		CC="gcc" \
		PREFIX=${D}/usr \
		GAMEDIR=${D}${HACKDIR} \
		SHELLDIR=${D}/${GAMES_BINDIR} \
		install || die "make install failed"

	# The final nethack is a sh script.  This fixes the hard-coded
	# HACKDIR directory so it doesn't point to ${D}/usr/share/nethackdir
	dosed "s:^\(HACKDIR=\).*:\1${HACKDIR}:" ${GAMES_BINDIR}/nethack

	cd ${S}/doc
	doman *.6
	dodoc *.txt

	cd ${S}/util
	mv recover recover-nethack
	dogamesbin recover-nethack

	# Can be copied to ~/.nethackrc to set options
	cp ${FILESDIR}/dot.nethackrc ${S}

	if [ `use X` ] ; then
		# install nethack fonts
		dodir ${HACKDIR}/fonts
		cd ${S}/win/X11
		bdftopcf -o nh10.pcf nh10.bdf || die "Converting fonts failed"
		bdftopcf -o ibm.pcf ibm.bdf || die "Converting fonts failed"
		cp *.pcf ${D}${HACKDIR}/fonts
		cd ${D}${HACKDIR}/fonts
		mkfontdir || die "The action mkfontdir ${D}${HACKDIR}/fonts failed"

		# copy nethack x application defaults
		cd ${S}/win/X11
		cp NetHack.ad NetHack.ad.orig
		sed -e 's:^!\(NetHack.tile_file.*\):\1:' \
			NetHack.ad.orig >NetHack.ad || die "Patching NetHack.ad for X failed"
		cp NetHack.ad NetHack
		insinto /etc/X11/app-defaults
		doins NetHack || die "Failed to install NetHack X app defaults"

		cd ${S}
		mv dot.nethackrc dot.nethackrc.orig
		sed -e 's/^\(# Your windowtype choices are: .*\)/\1 x11/' \
			-e 's/^\(OPTIONS=windowtype:\).*/\1x11/' \
			dot.nethackrc.orig >dot.nethackrc || die "Patching dot.nethackrc for X failed"

	fi

	insinto ${HACKDIR}
	doins ${S}/dot.nethackrc
	
	keepdir /usr/share/games/nethack/save
	
	## Add this to /etc/.skel as well, thats the place for default configs
	cp ${S}/dot.nethackrc ${S}/.nethackrc
	insinto /etc/skel
	doins ${S}/.nethackrc
	
	einfo "you may want to look at /etc/skel/.nethackrc for interesting options"

	prepgamesdirs
}


 -- SNIP HERE --
Comment 2 Ulrich Plate (RETIRED) gentoo-dev 2003-03-03 19:18:09 UTC
Other people in the forums report the same compile time error as mine: 

../sys/unix/unixres.c: In function `real_getresuid':
../sys/unix/unixres.c:35: `RTLD_NEXT' undeclared (first use in this function)
../sys/unix/unixres.c:35: (Each undeclared identifier is reported only once
../sys/unix/unixres.c:35: for each function it appears in.)
../sys/unix/unixres.c: In function `real_getresgid':
../sys/unix/unixres.c:47: `RTLD_NEXT' undeclared (first use in this function)
make: *** [unixres.o] Error 1

!!! ERROR: app-games/nethack-3.4.1 failed.
!!! Function src_compile, Line 144, Exitcode 2
!!! (no error message)

But after reading your inital comment, I'll not bother to install it anyway. Who are you to remove the Gnome and Qt "stuff"? Nethack is not "meant to be played" in any particular way, the variety is there, let's have it. This may well be the first ebuild that artificially limits a package to a minimum of its features, and just because you don't want to keep Qt2 around on your system, you decide to break other people's habits? Think again, please.
Comment 3 Peter Gantner (a.k.a. nephros) 2003-03-03 22:21:08 UTC
You are of course right, I do not have a right to cripple an ebuild.
 [...skipping reference to the licensing as it is not the point]

As a matter of fact, I simply wanted to check out the new nethack ASAP (as I caught the release message on the same day), and if possible install it "the gentoo way". When I found that it worked out of the box for me (yes, after deleting the GUI options), and In fact, it still does, I figured I might as well submit it for others to use.
I see user submitted ebuilds merely as suggestion, subject to review by higher authorities, and one must expect to be turned down, which is fine.

I do not intend to change peoples' playing style (especially not with a legend like this), I just found it awkward that - of all things! - nethack would require me to install qt.

In other news, this bug does have duplicate in #16472.
Comment 4 Ulrich Plate (RETIRED) gentoo-dev 2003-03-05 22:13:27 UTC
That's not a duplicate, it's a slightly different ebuild, one that does build 
with Qt, but borks out on +gnome. It would be great if either of you two 
ebuilders could figure out how to get all four interfaces to work again.

Coming to think of it, there is a duplicate here: http://bugs.gentoo.org/show_bug.cgi?id=16827
Comment 5 Martin Holzer (RETIRED) gentoo-dev 2003-04-15 12:15:03 UTC
in cvs now