]> git.draconx.ca Git - gentoo-draconx.git/commitdiff
uplink: Patch up binaries to remove bundled libs.
authorNick Bowler <nbowler@draconx.ca>
Thu, 26 Feb 2015 02:51:40 +0000 (21:51 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 13 Apr 2015 23:58:53 +0000 (19:58 -0400)
All the libs we need are in the main tree; we just need to remove
useless NEEDED entries from the binary.  Easy enough with patchelf.

games-strategy/uplink/Manifest
games-strategy/uplink/uplink-1.6-r1.ebuild [new file with mode: 0644]
games-strategy/uplink/uplink-1.6.ebuild [deleted file]

index 0c71dd66dd11580caa7921c0ef72b28007a7ed3b..abd7b9c997512669c9b03be4a210b1f087be4b1b 100644 (file)
@@ -1,3 +1,3 @@
-DIST uplink_1.6-1_amd64.tar.gz 22848679 RMD160 0746a2c739335fa3a56a6775ddd1a605da468c7e SHA1 0431a98b09af5ba9502b2c79b0a9e3b97e084f80 SHA256 6a3cdcbc86b2f1a254c3ae340847e4e0d56a6c7524f4814499c3463b575a09e0
-DIST uplink_1.6-1_i386.tar.gz 22897824 RMD160 b6ad33aa58b19a6bffb56d78c8c40cc6be648fa1 SHA1 3fb43adf2062f70b60aa79a8a731cc33e958b376 SHA256 6ea785fcb58cd943a0d36d64824c3df6652a52b6e133026ac9e32761f41be8e8
-EBUILD uplink-1.6.ebuild 1561 RMD160 bbfe9bfa09c1a94b1a555a398f0a185daf14a23b SHA1 ea4e97c057d9fe7d357e875f9c083fb8194f6c22 SHA256 77b3bdb463511fcaf45b8aab1149e9823383f3aca99b59a20ecb41ac72d3b02e
+DIST uplink_1.6-1_amd64.tar.gz 22848679 SHA256 6a3cdcbc86b2f1a254c3ae340847e4e0d56a6c7524f4814499c3463b575a09e0 SHA512 b1c174209f4c2ea1d09fad251073c2fac7cb6f0eba3a1ab53095a336226f5196bbedcbb3f3ba10b4a15037483f2ed21a6c306ecc79039c4ac0a91bc4838e5ef0 WHIRLPOOL fe453c6b0be7f243c9a4ee4f1cf0c9a0e589d08b66bf5a7058d166d706ebbd8f4497b68e6cd78ffc1ff44882e7b79c02b47676b45903f0b505b37b4e2f2fbb2d
+DIST uplink_1.6-1_i386.tar.gz 22897824 SHA256 6ea785fcb58cd943a0d36d64824c3df6652a52b6e133026ac9e32761f41be8e8 SHA512 1d351ae359087746655a5a678f7df38ba9a2735fc5d17439917030732bf87427e77891e85392c7ec0a6228e3dab53fea1a4ca7d02b54f9d59e12911190d9ab53 WHIRLPOOL beeec7a7a6125aee846b81bdc36f0a442178607bb1800ee6bde5bdddfc8c32b6588ff9eb00936772a85208f1d7490f8e5071a0e8ea4e82a26ad4cb80f6e3f81a
+EBUILD uplink-1.6-r1.ebuild 1404 SHA256 4def199e524e6374a9f5b85fc5da6630fc72eddb12ece6f119c6a8364477e128 SHA512 168e178ec4e65f7d4016609500dc0926243e463a8e35183e721b4d7e73d234cc1421ad7f268e886ae7a2b7d9b07b0b6980919f3f32533d662b4f82d18f165e7b WHIRLPOOL cf135016f152ac713e8155ddedc584abd0361c63e77dd65192f7405af37b56b0758a162e31d799e88e0658fbd48d0a39d032c56f78dd8e5fcc778560fee5f4e9
diff --git a/games-strategy/uplink/uplink-1.6-r1.ebuild b/games-strategy/uplink/uplink-1.6-r1.ebuild
new file mode 100644 (file)
index 0000000..ab69670
--- /dev/null
@@ -0,0 +1,73 @@
+# Copyright © 2011, 2015 Nick Bowler
+# License GPLv3+: GNU General Public License version 3 or later.
+# There is NO WARRANTY, to the extent permitted by law.
+
+EAPI=5
+
+inherit games
+
+MY_P=${PN}_${PV}-1
+
+DESCRIPTION="Crack into virtual computer systems"
+HOMEPAGE="http://www.uplink.co.uk"
+SRC_URI="amd64? ( ${MY_P}_amd64.tar.gz )
+       x86? ( ${MY_P}_i386.tar.gz )"
+RESTRICT="fetch"
+
+LICENSE="uplink"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+
+DEPEND="dev-util/patchelf"
+RDEPEND="media-libs/libsdl[opengl]
+       media-libs/sdl-mixer[mikmod]
+       media-libs/freetype:2
+       media-libs/tiff:3"
+
+src_unpack() {
+       local root
+
+       unpack $A
+
+       use amd64 && root=uplink-x64
+       use x86 && root=uplink-x86
+       test -n "$root" || die "unsupported architecture"
+
+       mv "$root" "$P" || die
+}
+
+src_compile() {
+       local useless_libs="libjpeg.so.62 libmikmod.so.2 libz.so.1"
+       local exe
+
+       use amd64 && exe=uplink.bin.x86_64
+       use x86 && exe=uplink.bin.x86
+       test -n "$exe" || die "unsupported architecture"
+
+       for lib in $useless_libs; do
+               patchelf --remove-needed "$lib" "$exe" || die
+       done
+}
+
+src_install() {
+       local dir=$GAMES_PREFIX_OPT/$PN
+       local exe
+
+       insinto "$dir"
+       doins *.dat
+
+       use amd64 && exe=uplink.bin.x86_64
+       use x86 && exe=uplink.bin.x86
+       test -n "$exe" || die "unsupported architecture"
+
+       exeinto "$dir"
+       doexe "$exe"
+
+       doicon uplink.png
+       make_desktop_entry "$PN" Uplink uplink
+       games_make_wrapper "$PN" "$dir/$exe"
+
+       dodoc *.txt
+
+       prepgamesdirs
+}
diff --git a/games-strategy/uplink/uplink-1.6.ebuild b/games-strategy/uplink/uplink-1.6.ebuild
deleted file mode 100644 (file)
index c7a2596..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-# This should be bumped to EAPI=4 as soon as the games eclass supports it, so
-# that doins preserves symlinks.
-EAPI=3
-
-inherit games
-
-MY_P="${PN}_${PV}-1"
-
-DESCRIPTION="Crack into virtual computer systems"
-HOMEPAGE="http://www.uplink.co.uk"
-SRC_URI="amd64? ( ${MY_P}_amd64.tar.gz )
-       x86? ( ${MY_P}_i386.tar.gz )"
-RESTRICT="fetch"
-
-# Bundled libs :(
-QA_PRESTRIPPED="${GAMES_PREFIX_OPT}/${PN}/lib.*"
-
-LICENSE="uplink"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-DEPEND=""
-RDEPEND="${DEPEND}
-       media-libs/libsdl[opengl]
-       media-libs/sdl-mixer[mikmod]
-       media-libs/freetype:2"
-
-pkg_nofetch() {
-       ewarn
-       ewarn "Place ${A} to ${DISTDIR}"
-       ewarn
-}
-
-src_unpack() {
-       local root
-
-       unpack "${A}"
-
-       if use amd64; then
-               root=uplink-x64
-       elif use x86; then
-               root=uplink-x86
-       else
-               die "unsupported architecture"
-       fi
-
-       mv "$root" uplink || die "failed to move unpacked data"
-}
-
-S="${WORKDIR}/${PN}"
-
-src_install() {
-       local dir="${GAMES_PREFIX_OPT}/${PN}"
-       local exe lib
-
-       insinto "${dir}"
-       doins *.dat
-
-       if use amd64; then
-               lib=lib64
-               exe=uplink.bin.x86_64
-       elif use x86; then
-               lib=lib
-               exe=uplink.bin.x86
-       else
-               die "unsupported architecture"
-       fi
-
-       # The system SDL libs should work fine, but install the other bundled
-       # libraries which use older SONAMEs than the versions in Gentoo.
-       insinto "${dir}/${lib}"
-       doins "${lib}"/libjpeg.so.62*
-       doins "${lib}"/libtiff.so.3*
-       doins "${lib}"/libmikmod.so.2*
-
-       exeinto "${dir}"
-       doexe "${exe}"
-
-       doicon uplink.png
-       make_desktop_entry "${PN}" Uplink uplink
-       games_make_wrapper "${PN}" "${dir}/$exe"
-
-       dodoc *.txt
-
-       prepgamesdirs
-}