1
0
flewkey-overlay/app-emulation/x16-emulator/x16-emulator-41.ebuild
Ryan Fox be9e110b9e
app-emulation/x16-emulator: Bump to 41
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Ryan Fox <flewkey@2a03.party>
2022-05-08 20:17:27 -07:00

61 lines
1.4 KiB
Bash

# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/commanderx16/x16-emulator.git"
ROM_REPO_URI="https://github.com/commanderx16/x16-rom.git"
ROM_P="x16-rom-9999"
else
SRC_URI="
https://github.com/commanderx16/x16-emulator/archive/r${PV}.tar.gz -> ${P}.tar.gz
https://github.com/commanderx16/x16-rom/archive/r${PV}.tar.gz -> x16-rom-${PV}.tar.gz
"
KEYWORDS="~amd64"
MY_P="${PN}-r${PV}"
S="${WORKDIR}/${MY_P}"
ROM_P="x16-rom-r${PV}"
fi
DESCRIPTION="Emulator for the Commander X16 computer"
HOMEPAGE="https://github.com/commanderx16/x16-emulator"
LICENSE="BSD-2"
SLOT="0"
IUSE="+rom"
DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND="
rom? ( dev-embedded/cc65 )
media-libs/libsdl2
"
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
use rom && git-r3_fetch "${ROM_REPO_URI}" || die
use rom && git-r3_checkout "${ROM_REPO_URI}" "${WORKDIR}/${ROM_P}" || die
else
default
fi
}
src_prepare() {
default
sed -i "s/-Werror //" "${S}/Makefile"
}
src_compile() {
default
use rom && emake -C "${WORKDIR}/${ROM_P}" || die
}
src_install() {
dodir /opt/${PN}
cp "${S}/x16emu" "${D}/opt/${PN}" || die
use rom && cp "${WORKDIR}/${ROM_P}/build/x16/rom.bin" "${D}/opt/${PN}" || die
dosym "${EPREFIX}/opt/${PN}/x16emu" "${EPREFIX}/usr/bin/x16emu"
}