ec9f3bc57fed1bfde60fc56e9f416837963d31b1
[gentoo.git] / games-strategy / darwinia / darwinia-1.4.0_beta9.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 CDROM_OPTIONAL="yes"
6 inherit eutils unpacker cdrom games
7
8 MY_PV=${PV/_beta/b}
9 DESCRIPTION="the hyped indie game of the year. By the Uplink creators"
10 HOMEPAGE="http://www.darwinia.co.uk/support/linux.html"
11 SRC_URI="http://www.introversion.co.uk/darwinia/downloads/${PN}-full-${MY_PV}.sh"
12
13 LICENSE="Introversion"
14 SLOT="0"
15 KEYWORDS="-* ~amd64 ~x86"
16 IUSE=""
17 RESTRICT="bindist mirror strip"
18
19 RDEPEND="
20         ~virtual/libstdc++-3.3
21         media-libs/libsdl[abi_x86_32(-)]
22         media-libs/libvorbis[abi_x86_32(-)]
23         virtual/glu[abi_x86_32(-)]
24         virtual/opengl[abi_x86_32(-)]"
25
26 S=${WORKDIR}
27
28 dir=${GAMES_PREFIX_OPT}/${PN}
29 QA_PREBUILT="${dir:1}/lib/darwinia.bin.x86"
30
31 src_unpack() {
32         use cdinstall && cdrom_get_cds gamefiles/main.dat
33         unpack_makeself
34 }
35
36 src_install() {
37         insinto "${dir}"/lib
38         exeinto "${dir}"/lib
39
40         doins lib/{language,patch}.dat
41         doexe lib/darwinia.bin.x86 lib/open-www.sh
42
43         exeinto "${dir}"
44         doexe bin/Linux/x86/darwinia
45
46         if use cdinstall ; then
47                 doins "${CDROM_ROOT}"/gamefiles/{main,sounds}.dat
48         fi
49
50         dodoc README
51         newicon darwinian.png darwinia.png
52
53         games_make_wrapper darwinia ./darwinia "${dir}" "${dir}"
54         make_desktop_entry darwinia "Darwinia"
55         prepgamesdirs
56 }
57
58 pkg_postinst() {
59         if ! use cdinstall; then
60                 ewarn "To play the game, you need to copy main.dat and sounds.dat"
61                 ewarn "from gamefiles/ on the game CD to ${dir}/lib/."
62         fi
63         games_pkg_postinst
64 }