1 # Copyright © 2011, 2015, 2021 Nick Bowler
2 # License GPLv3+: GNU General Public License version 3 or any later version.
3 # This is free software: you are free to change and redistribute it.
4 # There is NO WARRANTY, to the extent permitted by law.
8 inherit desktop wrapper xdg-utils
12 DESCRIPTION="Crack into virtual computer systems"
13 HOMEPAGE="http://www.uplink.co.uk"
14 SRC_URI="amd64? ( ${MY_P}_amd64.tar.gz )
15 x86? ( ${MY_P}_i386.tar.gz )"
19 KEYWORDS="-* ~amd64 -x86" # needs libtiff.so.5 patch for x86
22 BDEPEND="dev-util/patchelf
24 RDEPEND="media-libs/libsdl[opengl]
25 media-libs/sdl-mixer[mikmod]
27 >=media-libs/tiff-4.0.9"
34 use amd64 && root=uplink-x64
35 use x86 && root=uplink-x86
36 test -n "$root" || die "unsupported architecture"
38 mv "$root" "$P" || die
42 local exe binpatches=(
43 # Adjust stack allocation size to work with libtiff.so.5
47 use amd64 && exe=uplink.bin.x86_64
48 use x86 && exe=uplink.bin.x86
50 for f in "${binpatches[@]}"; do
52 einfo "Applying $patch"
53 xdelta3 -fds "$exe" "$FILESDIR/$patch" "$exe" || die
60 local useless_libs="libjpeg.so.62 libmikmod.so.2 libz.so.1"
63 use amd64 && exe=uplink.bin.x86_64
64 use x86 && exe=uplink.bin.x86
65 test -n "$exe" || die "unsupported architecture"
67 for lib in $useless_libs; do
68 einfo "Removing unused library $lib"
69 patchelf --remove-needed "$lib" "$exe" || die
74 local dir=/opt/uplink-$PV
80 use amd64 && exe=uplink.bin.x86_64
81 use x86 && exe=uplink.bin.x86
82 test -n "$exe" || die "unsupported architecture"
87 doicon -s 32x32 uplink.png
88 make_desktop_entry "$PN" Uplink uplink
89 make_wrapper "$PN" "$dir/$exe"