# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games flag-o-matic MY_PN="hexen2" DESCRIPTION="Hexen 2 port - Hammer of Thyrion" HOMEPAGE="http://uhexen2.sourceforge.net/" SRC_URI="mirror://sourceforge/uhexen2/hexen2source-${PV}.tgz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="alsa opengl timidity" RDEPEND=">=media-libs/libsdl-1.2.7 >=media-libs/sdl-mixer-1.2.5 amd64? ( >=app-emulation/emul-linux-x86-sdl-2.1 ) alsa? ( >=media-libs/alsa-lib-1.0.7 ) opengl? ( virtual/opengl ) timidity? ( media-sound/timidity++ ) sys-devel/gcc sys-libs/glibc || ( ( x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext ) virtual/x11 )" DEPEND="${RDEPEND} x86? ( >=dev-lang/nasm-0.98.38 )" S=${WORKDIR}/${MY_PN}source-${PV} S2=${S}/${MY_PN} dir=${GAMES_DATADIR}/${MY_PN} # Prefix to make OpenGL instead of software-rendered binaries GL_PREFIX="" use opengl && GL_PREFIX="gl" yesno() { useq $1 && echo yes || echo no ; } pkg_setup () { games_pkg_setup if use amd64 ; then if ! has_m32 ; then eerror "Your compiler seems to be unable to compile 32bit code." eerror "Make sure you compile gcc with:" echo eerror " USE=multilib FEATURES=-sandbox" die "Cannot produce 32bit code" fi if has_multilib_profile ; then export ABI=x86 else append-flags -m32 append-ldflags -m32 fi fi if use timidity ; then if ! built_with_use media-libs/sdl-mixer timidity ; then eerror "Recompile media-libs/sdl-mixer with the timidity USE flag" die "sdl-mixer without timidity detected" fi fi } src_compile() { # Hexen cd "${S2}" emake clean emake USE_ALSA=$(yesno alsa) USE_MIDI=$(yesno timidity) \ GLH2_BINARY=${MY_PN} ${GL_PREFIX}h2 # Hexenworld cd "${S}"/hexenworld ./build.sh } src_install() { newgamesbin "${S2}"/${MY_PN} ${MY_PN}.bin \ || die "newgamesbin ${MY_PN} failed" games_make_wrapper ${MY_PN} ${MY_PN}.bin "${dir}" # Hexenworld newgamesbin "${S}"/hexenworld/Server/hwsv hwsv.bin \ || die "newgamesbin hwsv failed" games_make_wrapper hwsv hwsv.bin "${dir}" newgamesbin "${S}"/hexenworld/Master/hwmaster hwmaster.bin \ || die "newgamesbin hwmaster failed" games_make_wrapper hwmaster hwmaster.bin "${dir}" newgamesbin "${S}"/hexenworld/Client/${GL_PREFIX}hwcl hwcl.bin \ || die "newgamesbin hwcl failed" games_make_wrapper hwcl hwcl.bin "${dir}" keepdir "${dir}"/{data1,portals} dodoc "${S}"/docs/{ABOUT,BUGS,CHANGES,README,README.AoT,TODO} dodoc "${S}"/hexenworld/Master/README.hwmaster prepgamesdirs } pkg_postinst() { games_pkg_postinst einfo "Music requires the timidity USE flag." einfo einfo "For the Hexen 2 original game..." einfo "Put the following files into ${GAMES_DATADIR}/hexen2/data1 before playing:" einfo "hexen.rc pak0.pak pak1.pak progs.dat progs2.dat strings.txt" einfo "Then to play: hexen2" einfo einfo "For the 'Portal of Praevus' mission pack..." einfo "Put the following files into ${GAMES_DATADIR}/hexen2/portals before playing:" einfo " default.cfg hexen.rc pak3.pak progs.dat puzzles.txt strings.txt" einfo "Then to play: hexen2 -portals" einfo einfo "Example command-line:" einfo " hexen2 -sndspeed 44100 -nocdaudio -width 1024 -height 768" einfo einfo "You may need to patch the data files to version 1.1 using 'update_h2' in:" einfo " http://prdownloads.sourceforge.net/uhexen2/hexen2-1.3.0-linux.i586.tgz" }