1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit desktop toolchain-funcs
10 BASE_P="${PN}-${BASE_PV}"
12 DESCRIPTION="The Ur-Quan Masters: Port of Star Control 2"
13 HOMEPAGE="http://sc2.sourceforge.net/"
14 SRC_URI="mirror://sourceforge/sc2/${MY_P}-source.tgz
15 mirror://sourceforge/sc2/${BASE_P}-content.uqm
16 music? ( mirror://sourceforge/sc2/${BASE_P}-3domusic.uqm )
17 voice? ( mirror://sourceforge/sc2/${BASE_P}-voice.uqm )
18 remix? ( mirror://sourceforge/sc2/${PN}-remix-disc1.uqm \
19 mirror://sourceforge/sc2/${PN}-remix-disc2.uqm \
20 mirror://sourceforge/sc2/${PN}-remix-disc3.uqm \
21 mirror://sourceforge/sc2/${PN}-remix-disc4.uqm )"
25 KEYWORDS="~amd64 ~ppc64 ~x86"
26 IUSE="music opengl remix voice"
31 >=media-libs/libpng-1.4:0=
32 media-libs/libsdl[X,sound,joystick,video]
34 media-libs/sdl-image[png]
36 opengl? ( virtual/opengl )
42 S="${WORKDIR}/${MY_P}"
45 "${FILESDIR}/${BASE_P}-tempdir.patch"
46 "${FILESDIR}/${BASE_P}-warning.patch"
52 local myopengl=$(usex opengl 'opengl' 'pure')
54 cat <<-EOF > config.state
55 CHOICE_debug_VALUE='nodebug'
56 CHOICE_graphics_VALUE='${myopengl}'
57 CHOICE_sound_VALUE='mixsdl'
58 CHOICE_accel_VALUE='plainc'
59 INPUT_install_prefix_VALUE='/usr/share'
60 INPUT_install_bindir_VALUE='\$prefix/bin'
61 INPUT_install_libdir_VALUE='\$prefix/lib'
62 INPUT_install_sharedir_VALUE='/usr/share/'
65 # Take out the read so we can be non-interactive.
67 -e '/read CHOICE/d' build/unix/menu_functions || die
71 -e "s/-O3//" build/unix/build.config || die
74 -e "s:@INSTALL_LIBDIR@:/usr/$(get_libdir)/:g" \
75 build/unix/uqm-wrapper.in || die
79 -e "s/PROG_gcc_FILE=\"gcc\"/PROG_gcc_FILE=\"$(tc-getCC)\"/" \
80 build/unix/config_proginfo_build || die
84 MAKE_VERBOSE=1 ./build.sh uqm || die
88 # Using the included install scripts seems quite painful.
89 # This manual install is totally fragile but maybe they'll
90 # use a sane build system for the next release.
91 newbin uqm-wrapper uqm
92 exeinto /usr/"$(get_libdir)"/${PN}
95 insinto /usr/share/${PN}/content/packages
96 doins "${DISTDIR}"/${BASE_P}-content.uqm
97 echo ${BASE_P} > "${ED}"/usr/share/${PN}/content/version || die
99 insinto /usr/share/${PN}/content/addons
101 doins "${DISTDIR}"/${BASE_P}-3domusic.uqm
105 doins "${DISTDIR}"/${BASE_P}-voice.uqm
109 insinto /usr/share/${PN}/content/addons
110 doins "${DISTDIR}"/${PN}-remix-disc{1,2,3,4}.uqm
113 dodoc AUTHORS ChangeLog Contributing README WhatsNew doc/users/manual.txt
115 dodoc doc/devel/[!n]*
116 docinto devel/netplay
117 dodoc doc/devel/netplay/*
118 make_desktop_entry uqm "The Ur-Quan Masters"