Skip to content

Commit

Permalink
games-arcade/opentyrian: More miscellaneous improvements
Browse files Browse the repository at this point in the history
* Depend on libsdl[video]
* Delete Windows files earlier
* Respect CC
* Support prefix
* Simplify symlink
* Remove unneeded die
* Clean up icon handling

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: James Le Cuirot <[email protected]>
  • Loading branch information
chewi committed Aug 22, 2020
1 parent e0c3505 commit 5d2f78d
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions games-arcade/opentyrian/opentyrian-2.1.20130907-r2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=7

inherit desktop xdg-utils
inherit desktop toolchain-funcs xdg-utils

DESCRIPTION="Open-source port of the DOS game Tyrian, vertical scrolling shooter"
HOMEPAGE="https://github.com/opentyrian/opentyrian"
Expand All @@ -14,7 +14,7 @@ LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND="media-libs/libsdl
DEPEND="media-libs/libsdl[video]
media-libs/sdl-net"
RDEPEND="${DEPEND}"
BDEPEND="app-arch/unzip"
Expand All @@ -25,24 +25,32 @@ PATCHES=(
"${FILESDIR}/${PV}-gcc10.patch"
)

src_prepare() {
default
rm "${WORKDIR}"/tyrian21/{*.exe,dpmi16bi.ovl,loudness.awe} || die "Failed to remove win32 binaries"
}

src_compile() {
emake DATA_PATH="/usr/share/${PN}"
emake \
CC="$(tc-getCC)" \
DATA_PATH="${EPREFIX}/usr/share/${PN}"
}

src_install() {
dobin opentyrian
dosym ../../usr/bin/opentyrian /usr/bin/tyrian
dosym opentyrian /usr/bin/tyrian
dodoc CREDITS NEWS README
domenu linux/opentyrian.desktop || die "Failed to install desktop file"
domenu linux/opentyrian.desktop

local size
for i in linux/icons/*.png ; do
local size=`echo ${i} | sed -e 's:.*-\([0-9]\+\).png:\1:'`
insinto /usr/share/icons/hicolor/${size}x${size}/apps
newins ${i} opentyrian.png
size=${i%.png}
size=${size##*-}
newicon -s "${size}" "${i}" opentyrian.png
done
insinto "/usr/share/${PN}"
cd "${WORKDIR}/tyrian21"
rm *.exe dpmi16bi.ovl loudness.awe || die "Failed to remove win32 binaries"
doins *

insinto /usr/share/"${PN}"
doins "${WORKDIR}"/tyrian21/*
}

pkg_postinst() {
Expand Down

0 comments on commit 5d2f78d

Please sign in to comment.