]> git.draconx.ca Git - gentoo-draconx.git/blobdiff - games-strategy/uplink/uplink-1.6-r2.ebuild
games-strategy/uplink: Update to work with latest gentoo repo.
[gentoo-draconx.git] / games-strategy / uplink / uplink-1.6-r2.ebuild
similarity index 52%
rename from games-strategy/uplink/uplink-1.6-r1.ebuild
rename to games-strategy/uplink/uplink-1.6-r2.ebuild
index ab69670e3da1e22b9d77202e320f6b78f6238a16..fffde449e2ca6003f95790cda47f0ed6f6654739 100644 (file)
@@ -1,10 +1,11 @@
-# Copyright © 2011, 2015 Nick Bowler
-# License GPLv3+: GNU General Public License version 3 or later.
+# Copyright © 2011, 2015, 2021 Nick Bowler
+# License GPLv3+: GNU General Public License version 3 or any later version.
+# This is free software: you are free to change and redistribute it.
 # There is NO WARRANTY, to the extent permitted by law.
 
-EAPI=5
+EAPI=7
 
-inherit games
+inherit desktop wrapper xdg-utils
 
 MY_P=${PN}_${PV}-1
 
@@ -15,16 +16,17 @@ SRC_URI="amd64? ( ${MY_P}_amd64.tar.gz )
 RESTRICT="fetch"
 
 LICENSE="uplink"
-KEYWORDS="~amd64 ~x86"
+KEYWORDS="-* ~amd64 -x86" # needs libtiff.so.5 patch for x86
 SLOT="0"
 
-DEPEND="dev-util/patchelf"
+BDEPEND="dev-util/patchelf
+       dev-util/xdelta:3"
 RDEPEND="media-libs/libsdl[opengl]
        media-libs/sdl-mixer[mikmod]
        media-libs/freetype:2
-       media-libs/tiff:3"
+       >=media-libs/tiff-4.0.9"
 
-src_unpack() {
+src_unpack () {
        local root
 
        unpack $A
@@ -36,7 +38,25 @@ src_unpack() {
        mv "$root" "$P" || die
 }
 
-src_compile() {
+src_prepare () {
+       local exe binpatches=(
+               # Adjust stack allocation size to work with libtiff.so.5
+               libtiff_compat
+       )
+
+       use amd64 && exe=uplink.bin.x86_64
+       use x86 && exe=uplink.bin.x86
+
+       for f in "${binpatches[@]}"; do
+               patch=$exe.$f.vcdiff
+               einfo "Applying $patch"
+               xdelta3 -fds "$exe" "$FILESDIR/$patch" "$exe" || die
+       done
+
+       default
+}
+
+src_compile () {
        local useless_libs="libjpeg.so.62 libmikmod.so.2 libz.so.1"
        local exe
 
@@ -45,12 +65,13 @@ src_compile() {
        test -n "$exe" || die "unsupported architecture"
 
        for lib in $useless_libs; do
+               einfo "Removing unused library $lib"
                patchelf --remove-needed "$lib" "$exe" || die
        done
 }
 
-src_install() {
-       local dir=$GAMES_PREFIX_OPT/$PN
+src_install () {
+       local dir=/opt/uplink-$PV
        local exe
 
        insinto "$dir"
@@ -63,11 +84,17 @@ src_install() {
        exeinto "$dir"
        doexe "$exe"
 
-       doicon uplink.png
+       doicon -s 32x32 uplink.png
        make_desktop_entry "$PN" Uplink uplink
-       games_make_wrapper "$PN" "$dir/$exe"
+       make_wrapper "$PN" "$dir/$exe"
 
        dodoc *.txt
+}
+
+pkg_postinst () {
+       xdg_icon_cache_update
+}
 
-       prepgamesdirs
+pkg_postrm () {
+       pkg_postinst
 }