1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils multilib toolchain-funcs games
8 DESCRIPTION="The Ur-Quan Masters: Port of Star Control 2"
9 HOMEPAGE="http://sc2.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/sc2/${P}-source.tgz
11 mirror://sourceforge/sc2/${P}-content.uqm
12 music? ( mirror://sourceforge/sc2/${P}-3domusic.uqm )
13 voice? ( mirror://sourceforge/sc2/${P}-voice.uqm )
14 remix? ( mirror://sourceforge/sc2/${PN}-remix-disc1.uqm \
15 mirror://sourceforge/sc2/${PN}-remix-disc2.uqm \
16 mirror://sourceforge/sc2/${PN}-remix-disc3.uqm )"
20 KEYWORDS="amd64 ppc ppc64 x86"
21 IUSE="music opengl remix voice"
23 RDEPEND="media-libs/libmikmod
25 >=media-libs/libpng-1.4:0
26 media-libs/libsdl[X,sound,joystick,video]
28 media-libs/sdl-image[png]
30 opengl? ( virtual/opengl )"
41 cat <<-EOF > config.state
42 CHOICE_debug_VALUE='nodebug'
43 CHOICE_graphics_VALUE='${myopengl}'
44 CHOICE_sound_VALUE='mixsdl'
45 CHOICE_accel_VALUE='plainc'
46 INPUT_install_prefix_VALUE='${GAMES_PREFIX}'
47 INPUT_install_bindir_VALUE='\$prefix/bin'
48 INPUT_install_libdir_VALUE='\$prefix/lib'
49 INPUT_install_sharedir_VALUE='${GAMES_DATADIR}/'
52 # Take out the read so we can be non-interactive.
54 -e '/read CHOICE/d' build/unix/menu_functions || die
58 -e "s/-O3//" build/unix/build.config || die
61 -e "s:@INSTALL_LIBDIR@:$(games_get_libdir)/:g" \
62 build/unix/uqm-wrapper.in || die
66 -e "s/PROG_gcc_FILE=\"gcc\"/PROG_gcc_FILE=\"$(tc-getCC)\"/" \
67 build/unix/config_proginfo_build || die
71 MAKE_VERBOSE=1 ./build.sh uqm || die
75 # Using the included install scripts seems quite painful.
76 # This manual install is totally fragile but maybe they'll
77 # use a sane build system for the next release.
78 newgamesbin uqm-wrapper uqm
79 exeinto "$(games_get_libdir)"/${PN}
82 insinto "${GAMES_DATADIR}"/${PN}/content/packages
83 doins "${DISTDIR}"/${P}-content.uqm
84 echo ${P} > "${D}${GAMES_DATADIR}"/${PN}/content/version || die
86 insinto "${GAMES_DATADIR}"/${PN}/content/addons
88 doins "${DISTDIR}"/${P}-3domusic.uqm
92 doins "${DISTDIR}"/${P}-voice.uqm
96 insinto "${GAMES_DATADIR}"/${PN}/content/addons
97 doins "${DISTDIR}"/${PN}-remix-disc{1,2,3}.uqm
100 dodoc AUTHORS ChangeLog Contributing README WhatsNew doc/users/manual.txt
102 dodoc doc/devel/[!n]*
103 docinto devel/netplay
104 dodoc doc/devel/netplay/*
105 make_desktop_entry uqm "The Ur-Quan Masters"