]> git.draconx.ca Git - gentoo-draconx.git/blob - games-strategy/uplink/uplink-1.6-r1.ebuild
uplink: Patch up binaries to remove bundled libs.
[gentoo-draconx.git] / games-strategy / uplink / uplink-1.6-r1.ebuild
1 # Copyright © 2011, 2015 Nick Bowler
2 # License GPLv3+: GNU General Public License version 3 or later.
3 # There is NO WARRANTY, to the extent permitted by law.
4
5 EAPI=5
6
7 inherit games
8
9 MY_P=${PN}_${PV}-1
10
11 DESCRIPTION="Crack into virtual computer systems"
12 HOMEPAGE="http://www.uplink.co.uk"
13 SRC_URI="amd64? ( ${MY_P}_amd64.tar.gz )
14         x86? ( ${MY_P}_i386.tar.gz )"
15 RESTRICT="fetch"
16
17 LICENSE="uplink"
18 KEYWORDS="~amd64 ~x86"
19 SLOT="0"
20
21 DEPEND="dev-util/patchelf"
22 RDEPEND="media-libs/libsdl[opengl]
23         media-libs/sdl-mixer[mikmod]
24         media-libs/freetype:2
25         media-libs/tiff:3"
26
27 src_unpack() {
28         local root
29
30         unpack $A
31
32         use amd64 && root=uplink-x64
33         use x86 && root=uplink-x86
34         test -n "$root" || die "unsupported architecture"
35
36         mv "$root" "$P" || die
37 }
38
39 src_compile() {
40         local useless_libs="libjpeg.so.62 libmikmod.so.2 libz.so.1"
41         local exe
42
43         use amd64 && exe=uplink.bin.x86_64
44         use x86 && exe=uplink.bin.x86
45         test -n "$exe" || die "unsupported architecture"
46
47         for lib in $useless_libs; do
48                 patchelf --remove-needed "$lib" "$exe" || die
49         done
50 }
51
52 src_install() {
53         local dir=$GAMES_PREFIX_OPT/$PN
54         local exe
55
56         insinto "$dir"
57         doins *.dat
58
59         use amd64 && exe=uplink.bin.x86_64
60         use x86 && exe=uplink.bin.x86
61         test -n "$exe" || die "unsupported architecture"
62
63         exeinto "$dir"
64         doexe "$exe"
65
66         doicon uplink.png
67         make_desktop_entry "$PN" Uplink uplink
68         games_make_wrapper "$PN" "$dir/$exe"
69
70         dodoc *.txt
71
72         prepgamesdirs
73 }