games-emulation/np2kai: new package

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Lino Bigatti <linobigatti@protonmail.com>
This commit is contained in:
Lino Bigatti
2021-04-15 02:35:40 -03:00
parent cbe582fd10
commit 938267181e
4 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST np2kai-22.tar.gz 3189290 BLAKE2B 74856a40ae57a71b1958f5c546ee3c907b1b1f5975715b21ce5a6c3a044a4c9ebf425e6ed1819e2d688e48be3853bb5f161e3e0c5031cd316359f7ebce0d5418 SHA512 47cd75b251dc0382537769225297dd155bb7b95a1fba7417a9c06b56f4fc89b0c38de101a68da8e8d776d456574aa6bf7f4e1490b3666f20469d4bf18e72b6dd

View File

@@ -0,0 +1,10 @@
--- x11/autogen.sh 2021-04-14 11:11:20.183543382 -0300
+++ x11/autogen.sh 2021-04-14 11:12:06.520539255 -0300
@@ -4,7 +4,6 @@
automake -aci --foreign
autoconf
rm -f config.h.in~
-./configure "$@"
rm -f ../np2tool/np2tool.d88
( cd ../np2tool && unzip -j -o np2tool.zip )
make maintainer-clean > /dev/null 2>&1

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>linobigatti@protonmail.com</email>
<name>Lino Bigatti</name>
</maintainer>
<longdescription>
Neko project 2 kai (np2kai for short) is a PC-9801 emulator
written in C and C++. It allows for i286, ia32 and haxm emulation.
It is based on Neko project II.
</longdescription>
<use>
<flag name="sdl">
Use <pkg>media-libs/libsdl</pkg> over <pkg>media-libs/libsdl2</pkg>
</flag>
<flag name="i286">
Enable i286 emulation.
USE="ia32" or USE="haxm" will disable it,
unless all 3 emulation USE flags are set
</flag>
<flag name="ia32">Enable ia32 emulation</flag>
<flag name="haxm">Enable haxm emulation</flag>
</use>
</pkgmetadata>

View File

@@ -0,0 +1,68 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="NP2kai is an emulator for the japanese PC-98 series of computers."
HOMEPAGE="https://domisan.sakura.ne.jp/article/np2kai/np2kai.html"
SRC_URI="https://github.com/AZO234/NP2kai/archive/refs/tags/rev.${PV}.tar.gz -> ${P}.tar.gz"
PATCHES=(
"${FILESDIR}/${P}-autogen.patch"
)
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="sdl +i286 ia32 haxm"
# Configure crashes if sdl AND sdl2 are not present, even if the options are off
# It also requires sdl2-ttf even when building for sdl
DEPEND="sys-libs/glibc
media-libs/libsdl
sdl? ( media-libs/sdl-mixer )
sdl? ( media-libs/sdl-ttf )
media-libs/libsdl2
!sdl? ( media-libs/sdl2-mixer )
media-libs/sdl2-ttf
virtual/libusb
x11-base/xorg-server
x11-libs/gtk+:2"
RDEPEND="${DEPEND}"
BDEPEND="sys-devel/gcc
sys-devel/automake
dev-util/cmake"
S=${WORKDIR}/NP2kai-rev.${PV}/x11
src_configure() {
bash ${S}/autogen.sh
sdlconf=$(usex sdl "--enable-sdl --enable-sdlmixer --enable-sdlttf
--disable-sdl2 --disable-sdl2mixer --disable-sdl2ttf" \
"--enable-sdl2 --enable-sdl2mixer --enable-sdl2ttf
--disable-sdl --disable-sdlmixer --disable-sdlttf" )
features=$( if use i286 && use ia32 && use haxm ; \
then echo --enable-build-all ; \
else echo $(use_enable ia32) $(use_enable haxm) ; \
fi )
econf ${sdlconf} ${features}
}
pkg_postinst() {
if [ "${features}" = "--enable-build-all" ] ; then
cfgname="{xnp2kai, xnp21kai}"
elif ! use ia32 && ! use haxm ; then
cfgname="xnp2kai"
else
cfgname="xnp21kai"
fi
elog "Japanese fonts are needed to use the emulator."
elog "Please run the following command to configure them:"
elog "mkdir -p ~/.config/${cfgname} && ln -s /path/to/font.ttf ~/.config/${cfgname}/default.ttf && rm ~/.config/${cfgname}/font.tmp"
elog "Neko project 2 requires a BIOS dump to work."
elog "Please dump the BIOS from your device and put the files under ~/.config/${cfgname}"
}