summaryrefslogtreecommitdiff
path: root/games-emulation/hatari
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-11-18 10:15:03 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-11-18 10:15:03 +0000
commitb284a3168fa91a038925d2ecf5e4791011ea5e7d (patch)
tree16fe44748708acacd909d4e2e160a09a7f6d936a /games-emulation/hatari
parent77398e424e45d9e98c1cef3c43bdadb9d56e81ef (diff)
gentoo resync : 18.11.2019
Diffstat (limited to 'games-emulation/hatari')
-rw-r--r--games-emulation/hatari/Manifest9
-rw-r--r--games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch147
-rw-r--r--games-emulation/hatari/files/hatari-2.2.1-default-rom.patch16
-rw-r--r--games-emulation/hatari/files/hatari-2.2.1-joystick.patch59
-rw-r--r--games-emulation/hatari/hatari-2.1.0-r1.ebuild79
-rw-r--r--games-emulation/hatari/hatari-2.2.1.ebuild80
-rw-r--r--games-emulation/hatari/metadata.xml3
7 files changed, 163 insertions, 230 deletions
diff --git a/games-emulation/hatari/Manifest b/games-emulation/hatari/Manifest
index 8dd62b3390a2..18e198986552 100644
--- a/games-emulation/hatari/Manifest
+++ b/games-emulation/hatari/Manifest
@@ -1,4 +1,5 @@
-AUX hatari-2.1.0_caps5_files.patch 5268 BLAKE2B 8562fee9d01377f368fd5062a26df00297a67eef64fbec5dfdbb789638148f9bcd4ed35132d8b26e6432eb151964a835d96ed828bc151518e4bc19af4f71569c SHA512 9148368f98bddb1083735a9ac9077cf830436c31b69b8e0138080325136f76c65957ca450306fc07ab07c5a47b827a9d2fad026c49af35263f7b0ab070de5358
-DIST hatari-2.1.0.tar.bz2 4072778 BLAKE2B 934ab28e799d0d13c26c291005513511367eb2ddbeda0f9756c19f10fa9e6bb8e10451057fa7e0b49a30e3f562eb5f327057d324b2a92e09b1115f63132dca97 SHA512 d1fbf6e60e2df2c43d070bee6a9c1dc93c36a8ea7f75bbf2a67790840952661cee136ebccd6b2ed523ef9b7b56391e058384f2e3f46acb609bb362cac05b9753
-EBUILD hatari-2.1.0-r1.ebuild 2061 BLAKE2B b26dde3a994f4666c25755c3ba79ae8e51c7030f523cfdd7f3d6f4004a7a325479c95df51e0225efdcba190f118dd1d7be9b46f69a08773b0bac99221852217d SHA512 13ca2eec6272b5f40970a6217285c3d850412e3709b484812bb75b5105428546f9c1d589ceba18ceefa1e8b9d0e62eb4316d0e20576ec317d0cb5b8d69d3a977
-MISC metadata.xml 318 BLAKE2B be4d8512e3f8fe751fc03aeae422216c9a366fc4cea3a49e4b8050f2a8280054fcc335f820718743fdf49cdb9a1fb73633e596ac8bf989b22f0f5a5fa33bd93b SHA512 2e304611622c91d0bd54f986ac3f02fc504bbd28e5ce03e5b958100b8567012ea0fe2a46884d29dfa18c6a4408fd0283679eb4a4f62c80a40ad748f5c811d943
+AUX hatari-2.2.1-default-rom.patch 698 BLAKE2B 5830bf75aa9039f0fda3f354bef50fa5dc6c7bea658c2f540a39f21f9b52fbb51447d1f1819ca3eebd248a93f7d255e9ef98a912aa908fbb15277a9ed106b853 SHA512 24659ea52cccb641010b08778608d87b4849b605b2825804f63f1285483605fdc2559f6ce6e17a5a71f801981c7bcf5d429dfc84f6dc6e5ed4cad9f1d957482f
+AUX hatari-2.2.1-joystick.patch 2172 BLAKE2B 67be6915d79612d851bcd617637e05d076f8a498194957a21ee6213c77fc0c7b718220afb0749bb2ccfa9322af34b020391fd8be9540dd1f7ed694f510215c2d SHA512 54b73d294dcc061abc4e037515f18bd0aa2e311c97010b687fce5cd90e427aac431bf820a1dd9ce2b2632e1662496e423582d80b1d55f23eef0734f03adfb2b8
+DIST hatari-2.2.1.tar.bz2 4162798 BLAKE2B 51938a649957779652b0debf7f867b2abe2d54fd3bb31086542f9f5970d01a120455e4381a9cb173724fbc7c45359d4009377bfe99038b338142fa5b82723533 SHA512 0e4c148a355a53c9cf79bdd28e5d7bb5f3389c780576017c6ebe2b69465d67522f373945f0e51681120ece24f5f08442265515486d2d7df7a02d9cd94cc44f1e
+EBUILD hatari-2.2.1.ebuild 2153 BLAKE2B 81234fc342de6c37d0fe7a375186e87bdbe2269424fc9e461091d624c98a6e60e1752192055af18bbcde22d1831728dd3c72c0cfec9bdaa1cae1e8f9029655d5 SHA512 4bcb95ac273b48ed1668afc36acd959867e94f3aba4d1bbd84ff80802ca7599f6db8e58847648528bd8f872292281a20b39e3e2ab222abce698895e1d01e380d
+MISC metadata.xml 619 BLAKE2B 452a04b03222a27e8790a2ce0b38d81899baaf65c9fcdeb22dcec9950cc0fddf027525b23bdb7739fee45ed1daec47071b3d1262006fc3f10c6ff07a8b1bd148 SHA512 6d87d6ab08072cc43e1f42160d0df993dfba7b2f5480261024bdb637f3169062e530029a248c7bee514c604629f6c04c80dd5c609d23bca639a5ef720c266e42
diff --git a/games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch b/games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch
deleted file mode 100644
index cac630f66f44..000000000000
--- a/games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-diff -Nuar hatari-2.1.0-orig/cmake/FindCapsImage.cmake hatari-2.1.0/cmake/FindCapsImage.cmake
---- hatari-2.1.0-orig/cmake/FindCapsImage.cmake 2018-07-28 20:32:59.164780571 +0300
-+++ hatari-2.1.0/cmake/FindCapsImage.cmake 2018-07-28 20:33:16.130781607 +0300
-@@ -1,22 +1,18 @@
--
- IF (CAPSIMAGE_INCLUDE_DIR)
-- # Already in cache, be silent
-- SET(CAPSIMAGE_FIND_QUIETLY TRUE)
-+ # Already in cache, be silent
-+ SET(CAPSIMAGE_FIND_QUIETLY TRUE)
- ENDIF (CAPSIMAGE_INCLUDE_DIR)
-
--
--# Choose the library version to use : 4 or 5
--SET(CAPSIMAGE_VERSION 5)
--
--
--if(CAPSIMAGE_VERSION STREQUAL 4)
-- SET(CAPSIMAGE_DIR caps)
-- FIND_PATH(CAPSIMAGE_INCLUDE_DIR ${CAPSIMAGE_DIR}/capsimage.h)
-+if(ENABLE_CAPSIMAGE5)
-+ SET(CAPSIMAGE_VERSION 5)
-+ FIND_PATH(CAPSIMAGE_INCLUDE_DIR NAMES CapsAPI.h PATH_SUFFIXES caps5)
- else()
-- SET(CAPSIMAGE_DIR caps5)
-- FIND_PATH(CAPSIMAGE_INCLUDE_DIR ${CAPSIMAGE_DIR}/CapsAPI.h)
-+ SET(CAPSIMAGE_VERSION 4)
-+ FIND_PATH(CAPSIMAGE_INCLUDE_DIR NAMES capsimage.h PATH_SUFFIXES caps)
- endif()
-
-+message(${CAPSIMAGE_INCLUDE_DIR})
-+
- if(WIN32)
- FIND_LIBRARY(CAPSIMAGE_LIBRARY NAMES capsimg PATH_SUFFIXES ${CAPSIMAGE_DIR} )
- else()
-diff -Nuar hatari-2.1.0-orig/src/CMakeLists.txt hatari-2.1.0/src/CMakeLists.txt
---- hatari-2.1.0-orig/src/CMakeLists.txt 2018-07-28 20:32:59.152780571 +0300
-+++ hatari-2.1.0/src/CMakeLists.txt 2018-07-28 20:33:16.131781607 +0300
-@@ -55,6 +55,10 @@
- include_directories(${PNG_INCLUDE_DIR})
- endif(PNG_FOUND)
-
-+if(CAPSIMAGE_FOUND)
-+ include_directories(${CAPSIMAGE_INCLUDE_DIR})
-+endif(CAPSIMAGE_FOUND)
-+
- if(X11_FOUND)
- include_directories(${X11_INCLUDE_DIR})
- endif(X11_FOUND)
-diff -Nuar hatari-2.1.0-orig/src/floppy_ipf.c hatari-2.1.0/src/floppy_ipf.c
---- hatari-2.1.0-orig/src/floppy_ipf.c 2018-07-28 20:32:59.152780571 +0300
-+++ hatari-2.1.0/src/floppy_ipf.c 2018-07-28 20:34:32.782786288 +0300
-@@ -30,9 +30,9 @@
-
- #ifdef HAVE_CAPSIMAGE
- #if CAPSIMAGE_VERSION == 5
--#include <caps5/CapsLibAll.h>
-+#include <CapsLibAll.h>
- #else
--#include <caps/fdc.h>
-+#include <fdc.h>
- #define CAPS_LIB_RELEASE 4
- #define CAPS_LIB_REVISION 2
- #endif
-@@ -61,8 +61,8 @@
-
- struct CapsFdc Fdc; /* Fdc state */
- struct CapsDrive Drive[ MAX_FLOPPYDRIVES ]; /* Physical drives */
-- CapsLong CapsImage[ MAX_FLOPPYDRIVES ]; /* Image Id or -1 if drive empty */
-- CapsLong CapsImageType[ MAX_FLOPPYDRIVES ]; /* ImageType or -1 if not known */
-+ Sint32 CapsImage[ MAX_FLOPPYDRIVES ]; /* Image Id or -1 if drive empty */
-+ Sint32 CapsImageType[ MAX_FLOPPYDRIVES ]; /* ImageType or -1 if not known */
-
- int Rev_Track[ MAX_FLOPPYDRIVES ]; /* Needed to handle CAPSSetRevolution for type II/III commands */
- int Rev_Side[ MAX_FLOPPYDRIVES ];
-@@ -83,9 +83,9 @@
- static char *IPF_FilenameFindTrackSide (char *FileName);
- static bool IPF_Insert_RawStreamImage ( int Drive );
-
--static void IPF_CallBack_Trk ( struct CapsFdc *pc , CapsULong State );
--static void IPF_CallBack_Irq ( struct CapsFdc *pc , CapsULong State );
--static void IPF_CallBack_Drq ( struct CapsFdc *pc , CapsULong State );
-+static void IPF_CallBack_Trk ( struct CapsFdc *pc , Uint32 State );
-+static void IPF_CallBack_Irq ( struct CapsFdc *pc , Uint32 State );
-+static void IPF_CallBack_Drq ( struct CapsFdc *pc , Uint32 State );
- static void IPF_Drive_Update_Enable_Side ( void );
- static void IPF_FDC_LogCommand ( Uint8 Command );
- #endif
-@@ -419,8 +419,8 @@
- return false;
-
- #else
-- CapsLong ImageId;
-- CapsLong ImageType;
-+ Sint32 ImageId;
-+ Sint32 ImageType;
-
- ImageId = CAPSAddImage();
- if ( ImageId < 0 )
-@@ -470,7 +470,7 @@
- ImageType = -1;
- #endif
-
-- if ( CAPSLockImageMemory ( ImageId , pImageBuffer , (CapsULong)ImageSize , DI_LOCK_MEMREF ) == imgeOk )
-+ if ( CAPSLockImageMemory ( ImageId , pImageBuffer , (Uint32)ImageSize , DI_LOCK_MEMREF ) == imgeOk )
- {
- struct CapsImageInfo cii;
- int i;
-@@ -703,7 +703,7 @@
- * We need to update the track data by calling CAPSLockTrack
- */
- #ifdef HAVE_CAPSIMAGE
--static void IPF_CallBack_Trk ( struct CapsFdc *pc , CapsULong State )
-+static void IPF_CallBack_Trk ( struct CapsFdc *pc , Uint32 State )
- {
- int Drive = State; /* State is the drive number in that case */
- struct CapsDrive *pd = pc->drive+Drive; /* Current drive where the track change occurred */
-@@ -732,7 +732,7 @@
- * Callback function used when the FDC change the IRQ signal
- */
- #ifdef HAVE_CAPSIMAGE
--static void IPF_CallBack_Irq ( struct CapsFdc *pc , CapsULong State )
-+static void IPF_CallBack_Irq ( struct CapsFdc *pc , Uint32 State )
- {
- LOG_TRACE(TRACE_FDC, "fdc ipf callback irq state=0x%x VBL=%d HBL=%d\n" , (int)State , nVBLs , nHBL );
-
-@@ -751,7 +751,7 @@
- * -> copy the byte to/from the DMA's FIFO if it's a read or a write to the disk
- */
- #ifdef HAVE_CAPSIMAGE
--static void IPF_CallBack_Drq ( struct CapsFdc *pc , CapsULong State )
-+static void IPF_CallBack_Drq ( struct CapsFdc *pc , Uint32 State )
- {
- Uint8 Byte;
-
-diff -Nuar hatari-2.1.0-orig/src/uae-cpu/newcpu.c hatari-2.1.0/src/uae-cpu/newcpu.c
---- hatari-2.1.0-orig/src/uae-cpu/newcpu.c 2018-07-28 20:32:59.158780571 +0300
-+++ hatari-2.1.0/src/uae-cpu/newcpu.c 2018-07-28 20:33:16.132781607 +0300
-@@ -167,7 +167,7 @@
-
- #ifdef HAVE_CAPSIMAGE
- #if CAPSIMAGE_VERSION == 5
--#include <caps5/CapsLibAll.h>
-+#include <CapsLibAll.h>
- #endif
- #endif
-
diff --git a/games-emulation/hatari/files/hatari-2.2.1-default-rom.patch b/games-emulation/hatari/files/hatari-2.2.1-default-rom.patch
new file mode 100644
index 000000000000..c42f67f733c1
--- /dev/null
+++ b/games-emulation/hatari/files/hatari-2.2.1-default-rom.patch
@@ -0,0 +1,16 @@
+Use etos512k.img from the emutos package rather than tos.img.
+
+diff -Naur a/src/configuration.c b/src/configuration.c
+--- a/src/configuration.c 2019-02-08 08:30:11.000000000 +0000
++++ b/src/configuration.c 2019-11-10 21:19:31.712605716 +0000
+@@ -841,8 +841,8 @@
+ ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING;
+
+ /* Set defaults for Rom */
+- sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%ctos.img",
+- Paths_GetDataDir(), PATHSEP);
++ sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%c..%cemutos%cetos512k.img",
++ Paths_GetDataDir(), PATHSEP, PATHSEP, PATHSEP);
+ ConfigureParams.Rom.bPatchTos = true;
+ strcpy(ConfigureParams.Rom.szCartridgeImageFileName, "");
+
diff --git a/games-emulation/hatari/files/hatari-2.2.1-joystick.patch b/games-emulation/hatari/files/hatari-2.2.1-joystick.patch
new file mode 100644
index 000000000000..193bb7206c31
--- /dev/null
+++ b/games-emulation/hatari/files/hatari-2.2.1-joystick.patch
@@ -0,0 +1,59 @@
+https://bugs.gentoo.org/689538
+
+diff -ruN hatari-2.1.0.old/src/gui-sdl/sdlgui.c hatari-2.1.0/src/gui-sdl/sdlgui.c
+--- hatari-2.1.0.old/src/gui-sdl/sdlgui.c 2018-02-07 18:33:56.000000000 +0000
++++ hatari-2.1.0/src/gui-sdl/sdlgui.c 2019-07-08 23:55:50.481270799 +0100
+@@ -1329,12 +1329,28 @@
+ }
+ break;
+
++ case SDL_JOYHATMOTION:
++ if (sdlEvent.jhat.value & SDL_HAT_LEFT)
++ retbutton = SDLGui_HandleShortcut(dlg, SG_SHORTCUT_LEFT);
++ else if (sdlEvent.jhat.value & SDL_HAT_RIGHT)
++ retbutton = SDLGui_HandleShortcut(dlg, SG_SHORTCUT_RIGHT);
++ if (sdlEvent.jhat.value & SDL_HAT_UP)
++ {
++ SDLGui_RemoveFocus(dlg, focused);
++ focused = SDLGui_FocusNext(dlg, focused, -1);
++ }
++ else if (sdlEvent.jhat.value & SDL_HAT_DOWN)
++ {
++ SDLGui_RemoveFocus(dlg, focused);
++ focused = SDLGui_FocusNext(dlg, focused, +1);
++ }
++ break;
++
+ case SDL_JOYBUTTONDOWN:
+ retbutton = SDLGui_HandleSelection(dlg, focused, focused);
+ break;
+
+ case SDL_JOYBALLMOTION:
+- case SDL_JOYHATMOTION:
+ case SDL_MOUSEMOTION:
+ break;
+
+diff -ruN hatari-2.1.0.old/src/joy.c hatari-2.1.0/src/joy.c
+--- hatari-2.1.0.old/src/joy.c 2018-02-07 18:33:56.000000000 +0000
++++ hatari-2.1.0/src/joy.c 2019-07-09 14:46:36.502410790 +0100
+@@ -199,9 +199,20 @@
+ */
+ static bool Joy_ReadJoystick(int nSdlJoyID, JOYREADING *pJoyReading)
+ {
++ unsigned hat = SDL_JoystickGetHat(sdlJoystick[nSdlJoyID], 0);
++
+ /* Joystick is OK, read position from the configured joystick axis */
+ pJoyReading->XPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->XAxisID);
+ pJoyReading->YPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->YAxisID);
++ /* Similarly to other emulators that support hats, override axis readings with hats */
++ if (hat & SDL_HAT_LEFT)
++ pJoyReading->XPos = -32768;
++ if (hat & SDL_HAT_RIGHT)
++ pJoyReading->XPos = 32767;
++ if (hat & SDL_HAT_UP)
++ pJoyReading->YPos = -32768;
++ if (hat & SDL_HAT_DOWN)
++ pJoyReading->YPos = 32767;
+ /* Sets bit #0 if button #1 is pressed: */
+ pJoyReading->Buttons = SDL_JoystickGetButton(sdlJoystick[nSdlJoyID], 0);
+ /* Sets bit #1 if button #2 is pressed: */
diff --git a/games-emulation/hatari/hatari-2.1.0-r1.ebuild b/games-emulation/hatari/hatari-2.1.0-r1.ebuild
deleted file mode 100644
index 7bb3815e13af..000000000000
--- a/games-emulation/hatari/hatari-2.1.0-r1.ebuild
+++ /dev/null
@@ -1,79 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 )
-inherit cmake-utils python-single-r1 readme.gentoo-r1
-
-DESCRIPTION="Atari ST emulator"
-HOMEPAGE="http://hatari.tuxfamily.org/"
-SRC_URI="http://download.tuxfamily.org/hatari/${PV}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="+sdl2"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="${PYTHON_DEPS}
- >=dev-libs/spsdeclib-5.1-r1
- sdl2? ( media-libs/libsdl2[X,sound,video] )
- !sdl2? ( media-libs/libsdl[X,sound,video] )
- media-libs/portaudio
- media-libs/portmidi
- sys-libs/readline:0=
- media-libs/libpng:0=
- sys-libs/zlib:0="
-DEPEND="${RDEPEND}
- virtual/pkgconfig"
-PDEPEND="dev-python/pygtk[${PYTHON_USEDEP}]
- >=games-emulation/emutos-0.9.9.1"
-
-DISABLE_AUTOFORMATTING="yes"
-DOC_CONTENTS="
-You need a TOS ROM to run hatari. EmuTOS, a free TOS implementation,
-has been installed in /usr/lib*/hatari with a .img extension (there
-are several from which to choose).
-Another option is to go to http://www.atari.st/ and get a real TOS:
-http://www.atari.st/
-The first time you run hatari, you should configure it to find the
-TOS you prefer to use. Be sure to save your settings.
-"
-
-PATCHES=( "${FILESDIR}/${P}_caps5_files.patch" )
-DOCS="readme.txt doc/*.txt"
-HTML_DOCS="doc/"
-
-src_prepare() {
- cmake-utils_src_prepare
-
- sed -i -e '/Encoding/d' ./python-ui/hatariui.desktop || die
- sed -i -e "s/python/${EPYTHON}/" tools/atari-hd-image.sh || die
- sed -i -e "s#@DOCDIR@#/usr/share/doc/${PF}/html/#" python-ui/uihelpers.py || die
-}
-
-src_configure() {
- mycmakeargs=(
- "-DDOCDIR=/usr/share/doc/${PF}"
- "-DENABLE_SDL2=$(usex sdl2)"
- "-DENABLE_CAPSIMAGE5=ON"
- )
- cmake-utils_src_configure
-}
-
-src_install() {
- cmake-utils_src_install
- python_fix_shebang "${ED%/}"/usr/share/hatari/{hatariui,hconsole}/
- readme.gentoo_create_doc
-}
-
-pkg_postinst() {
- xdg_desktop_database_update
- xdg_mimeinfo_database_update
- readme.gentoo_print_elog
-}
-
-pkg_postrm() {
- xdg_desktop_database_update
- xdg_mimeinfo_database_update
-}
diff --git a/games-emulation/hatari/hatari-2.2.1.ebuild b/games-emulation/hatari/hatari-2.2.1.ebuild
new file mode 100644
index 000000000000..a8f84107c83e
--- /dev/null
+++ b/games-emulation/hatari/hatari-2.2.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{6,7}} )
+inherit cmake-utils python-single-r1 xdg
+
+DESCRIPTION="Atari ST emulator"
+HOMEPAGE="https://hatari.tuxfamily.org/"
+SRC_URI="https://download.tuxfamily.org/hatari/${PV}/${P}.tar.bz2"
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="capsimage microphone png portmidi readline +sdl2 udev zlib"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ capsimage? ( >=dev-libs/spsdeclib-5.1-r1 )
+ microphone? ( media-libs/portaudio )
+ png? ( media-libs/libpng:0= )
+ portmidi? ( media-libs/portmidi )
+ readline? ( sys-libs/readline:0= )
+ sdl2? ( media-libs/libsdl2[sound,video,X] )
+ !sdl2? ( media-libs/libsdl[sound,video,X] )
+ udev? ( virtual/udev )
+ zlib? ( sys-libs/zlib )
+"
+
+RDEPEND="
+ ${DEPEND}
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ >=games-emulation/emutos-0.9.9.1
+"
+
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.2.1-default-rom.patch
+ "${FILESDIR}"/${PN}-2.2.1-joystick.patch
+)
+
+DOCS=(
+ readme.txt
+ doc/{changelog,coding,scsi-driver,thanks,video-recording}.txt
+)
+
+src_prepare() {
+ xdg_environment_reset
+ cmake-utils_src_prepare
+
+ sed -i "s/\.1\.gz\b/.1/g;T;s/gzip[^\$]*/cat /g" {*/,}*/CMakeLists.txt || die
+ sed -i "s:\"doc\" + sep + \"hatari\":\"doc/${PF}\":" python-ui/uihelpers.py || die
+ sed -i "s/python/${EPYTHON}/" tools/atari-hd-image.sh || die
+
+ # Use emutos package rather than bundled ROM.
+ rm src/tos.img || die
+}
+
+src_configure() {
+ mycmakeargs=(
+ -DBUILD_SHARED_LIBS=OFF
+ -DDOCDIR="${EPREFIX}"/usr/share/doc/${PF}
+ -DENABLE_SDL2=$(usex sdl2)
+ -DCMAKE_DISABLE_FIND_PACKAGE_CapsImage=$(usex !capsimage)
+ -DCMAKE_DISABLE_FIND_PACKAGE_PortAudio=$(usex !microphone)
+ -DCMAKE_DISABLE_FIND_PACKAGE_PortMidi=$(usex !portmidi)
+ -DCMAKE_DISABLE_FIND_PACKAGE_PNG=$(usex !png)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Readline=$(usex !readline)
+ -DCMAKE_DISABLE_FIND_PACKAGE_Udev=$(usex !udev)
+ -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=$(usex !zlib)
+ )
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ python_fix_shebang "${ED}"/usr/share/${PN}/
+}
diff --git a/games-emulation/hatari/metadata.xml b/games-emulation/hatari/metadata.xml
index d4511e749d48..f17253687ee3 100644
--- a/games-emulation/hatari/metadata.xml
+++ b/games-emulation/hatari/metadata.xml
@@ -6,6 +6,9 @@
<name>Gentoo Games Project</name>
</maintainer>
<use>
+ <flag name="capsimage">Use <pkg>dev-libs/spsdeclib</pkg> to read .IPF, .RAW, and .CTR disk images</flag>
+ <flag name="microphone">Use <pkg>media-libs/portaudio</pkg> for Falcon microphone handling</flag>
+ <flag name="portmidi">Use <pkg>media-libs/portmidi</pkg> as an alternative MIDI backend</flag>
<flag name="sdl2">Use libsdl2 instead of libsdl</flag>
</use>
</pkgmetadata>