# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 inherit games multilib eutils subversion ESVN_REPO_URI="http://project6014.googlecode.com/svn/trunk/" ESVN_PROJECT="project6016-read-only" DV="0.2.1" DESCRIPTION="Mod sequel to Star Control II: The Ur-Quan Masters" HOMEPAGE="http://code.google.com/p/project6014/" SRC_URI="http://project6014.googlecode.com/files/P6014-${DV}-prv-content.uqm voice? ( http://project6014.googlecode.com/files/P6014-${DV}-prv-voice.uqm ) music? ( http://project6014.googlecode.com/files/P6014-${DV}-prv-3domusic.uqm ) 640? ( http://project6014.googlecode.com/files/P6014-${DV}-prv-hires2x.uqm ) 1280? ( http://project6014.googlecode.com/files/P6014-${DV}-prv-hires4x.uqm ) " LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" IUSE="voice music 640 1280" RDEPEND="media-libs/libvorbis virtual/jpeg >=media-libs/libpng-1.4 media-libs/libsdl media-libs/sdl-image media-libs/libogg media-libs/libvorbis media-libs/libmikmod" RDEPEND="${DEPEND}" src_unpack() { subversion_src_unpack } src_prepare() { local myopengl # Everything is in a subdir called "sc2". This, mv ./sc2/* ./ use opengl \ && myopengl=opengl \ || myopengl=pure cat <<-EOF > config.state CHOICE_debug_VALUE='nodebug' CHOICE_graphics_VALUE='${myopengl}' CHOICE_sound_VALUE='mixsdl' CHOICE_accel_VALUE='plainc' INPUT_install_prefix_VALUE='${GAMES_PREFIX}' INPUT_install_bindir_VALUE='\$prefix/bin' INPUT_install_libdir_VALUE='\$prefix/lib' INPUT_install_sharedir_VALUE='${GAMES_DATADIR}/' EOF # Take out the read so we can be non-interactive. sed -i \ -e '/read CHOICE/d' build/unix/menu_functions \ || die "sed menu_functions failed" # support the user's CFLAGS. sed -i \ -e "s/-O3/${CFLAGS}/" build/unix/build.config \ || die "sed build.config failed" sed -i \ -e "s:@INSTALL_LIBDIR@:$(games_get_libdir)/:g" build/unix/uqm-wrapper.in \ || die "sed uqm-wrapper.in failed" } src_configure() { ./build.sh uqm config || die "configure failed" } src_compile() { ./build.sh uqm || die "build failed" } src_install() { newgamesbin uqm-wrapper p6014 || die "newgamesbin failed" exeinto "$(games_get_libdir)"/${PN} doexe p6014 || die "doexe failed" insinto "${GAMES_DATADIR}"/${PN}/content/packages doins "${DISTDIR}"/P6014-${DV}-prv-content.uqm || die "doins failed" echo ${PN}-${DV} > "${D}${GAMES_DATADIR}"/${PN}/content/version \ || die "creating version file failed" insinto "${GAMES_DATADIR}"/${PN}/content/addons if use music; then doins "${DISTDIR}"/P6014-${DV}-prv-3domusic.uqm || die "doins failed" fi if use voice; then doins "${DISTDIR}"/P6014-${DV}-prv-voice.uqm || die "doins failed" fi if use 640; then doins "${DISTDIR}"/P6014-${DV}-prv-hires2x.uqm || die "doins failed" fi if use 1280; then doins "${DISTDIR}"/P6014-${DV}-prv-hires4x.uqm || die "doins failed" fi dodoc AUTHORS ChangeLog Contributing README WhatsNew doc/users/manual.txt docinto devel dodoc doc/devel/[!n]* docinto devel/netplay dodoc doc/devel/netplay/* make_desktop_entry p6014 "Project 6014" prepgamesdirs }