# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games 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} >=dev-lang/nasm-0.98.38" S=${WORKDIR} dir=${GAMES_DATADIR}/hexen2 S2=${S}/hexen2source-${PV} S3=${S2}/hexen2 MAKEFILE="Makefile.unix" # Prefix to make OpenGL instead of software-rendered binaries GLPREFIX="" use opengl && GLPREFIX="gl" pkg_setup () { if use amd64 ; then if has_multilib_profile ; then export ABI=x86 else append-flags -m32 append-ldflags -m32 fi fi } src_unpack() { unpack ${A} cd "${S3}" sed -i -e "s/_BINARY=gl/_BINARY=/" ${MAKEFILE} use !alsa && sed -i -e "s/USEALSA=yes/USEALSA=no/" ${MAKEFILE} use !timidity && sed -i -e "s/USEMIDI=yes/USEMIDI=no/" ${MAKEFILE} cd "${S2}"/hexenworld/Client sed -i -e "s/_BINARY=gl/_BINARY=/" ${MAKEFILE} use !alsa && sed -i -e "s/USEALSA=yes/USEALSA=no/" ${MAKEFILE} use !timidity && sed -i -e "s/USEMIDI=yes/USEMIDI=no/" ${MAKEFILE} } src_compile() { cd "${S3}" emake -f ${MAKEFILE} clean emake -f ${MAKEFILE} ${GLPREFIX}h2_dynamic emake -f ${MAKEFILE} clean emake -f ${MAKEFILE} ${GLPREFIX}mp_dynamic # Hexenworld cd "${S2}"/hexenworld emake -C Server emake -C Master emake -C Client -f ${MAKEFILE} clean emake -C Client -f ${MAKEFILE} ${GLPREFIX}hw_dynamic } src_install() { newgamesbin "${S3}"/hexen2 hexen2.bin games_make_wrapper hexen2 hexen2.bin "${dir}" newgamesbin "${S3}"/h2mp h2mp.bin games_make_wrapper h2mp h2mp.bin "${dir}" # Hexenworld newgamesbin "${S2}"/hexenworld/Server/hwsv hwsv.bin games_make_wrapper hwsv hwsv.bin "${dir}" newgamesbin "${S2}"/hexenworld/Master/hwmaster hwmaster.bin games_make_wrapper hwmaster hwmaster.bin "${dir}" newgamesbin "${S2}"/hexenworld/Client/hwcl hwcl.bin games_make_wrapper hwcl hwcl.bin "${dir}" keepdir "${dir}"/{data1,portals} dodoc "${S2}"/docs/{ABOUT,BUGS,CHANGES,README,README.AoT,TODO} dodoc "${S2}"/hexenworld/Master/README.hwmaster prepgamesdirs } 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: h2mp" einfo einfo "Example command-line:" einfo " hexen2 -fullscreen -sndalsa -fsaa 4 -sndspeed 44100 -nocdaudio" 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" games_pkg_postinst }