1 # Copyright © 2011, 2015, 2021, 2023 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]
28 media-libs/tiff-compat:4
29 ( >=media-libs/tiff-4.0.9:0 <media-libs/tiff-4.5:0 )
37 use amd64 && root=uplink-x64
38 use x86 && root=uplink-x86
39 test -n "$root" || die "unsupported architecture"
41 mv "$root" "$P" || die
45 local exe binpatches=(
46 # Adjust stack allocation size to work with libtiff.so.5
50 use amd64 && exe=uplink.bin.x86_64
51 use x86 && exe=uplink.bin.x86
53 for f in "${binpatches[@]}"; do
55 einfo "Applying $patch"
56 xdelta3 -fds "$exe" "$FILESDIR/$patch" "$exe" || die
63 local useless_libs="libjpeg.so.62 libmikmod.so.2 libz.so.1"
66 use amd64 && exe=uplink.bin.x86_64
67 use x86 && exe=uplink.bin.x86
68 test -n "$exe" || die "unsupported architecture"
70 for lib in $useless_libs; do
71 einfo "Removing unused library $lib"
72 patchelf --remove-needed "$lib" "$exe" || die
77 local dir=/opt/uplink-$PV
83 use amd64 && exe=uplink.bin.x86_64
84 use x86 && exe=uplink.bin.x86
85 test -n "$exe" || die "unsupported architecture"
90 doicon -s 32x32 uplink.png
91 make_desktop_entry "$PN" Uplink uplink
92 make_wrapper "$PN" "$dir/$exe"