commit:     f161975e2a310eec02789128306f8bfb54af35a8
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  1 11:59:26 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Jun  2 02:20:51 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f161975e

games-emulation/hatari: add 2.3.1

- removed upstreamed joystick patch
- replaced default-rom patch by using /etc/hatari.cfg, effective even
  if user has their own .cfg in $HOME unless overrides same option
- removed libsdl1 support, upstream advises against using and it'll
  be removed entirely next version
- added python3_10 (haven't managed to find issues)
- the python-ui frontend was previously missing gtk+:3[introspection]
  dep and, rather than add unconditionally, introducing USE=gui
- plus other small adjustments/fixes

bug 739146 config-file test failure was caused by the default-rom patch

Closes: https://bugs.gentoo.org/739146
Closes: https://bugs.gentoo.org/765004
Closes: https://bugs.gentoo.org/765115
Closes: https://github.com/gentoo/gentoo/pull/20905
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-emulation/hatari/Manifest                    |  1 +
 .../files/hatari-2.3.1-caps5-include-path.patch    | 18 +++++
 .../hatari-2.3.1-cmake-include-checksym.patch      | 12 +++
 games-emulation/hatari/hatari-2.3.1.ebuild         | 90 ++++++++++++++++++++++
 4 files changed, 121 insertions(+)

diff --git a/games-emulation/hatari/Manifest b/games-emulation/hatari/Manifest
index ed73c9b263e..aaf8342bc92 100644
--- a/games-emulation/hatari/Manifest
+++ b/games-emulation/hatari/Manifest
@@ -1 +1,2 @@
 DIST hatari-2.2.1.tar.bz2 4162798 BLAKE2B 
51938a649957779652b0debf7f867b2abe2d54fd3bb31086542f9f5970d01a120455e4381a9cb173724fbc7c45359d4009377bfe99038b338142fa5b82723533
 SHA512 
0e4c148a355a53c9cf79bdd28e5d7bb5f3389c780576017c6ebe2b69465d67522f373945f0e51681120ece24f5f08442265515486d2d7df7a02d9cd94cc44f1e
+DIST hatari-2.3.1.tar.bz2 4334129 BLAKE2B 
f309a31cbf181135b02858ebefa4d70116e66d252ef5de03cffa8254c0e86e4eeebfbf626613103790fb803d08028b318721020b292ea748c79e4d008e6d503d
 SHA512 
78a6c7d80bfcd9b3a85a82754f4180cfd906eb95c6a44c8fbb92c2a648dc9c21c74c9dd18db4783d87259a3061b39e639c54cdd6c033d83de1252afef811382f

diff --git a/games-emulation/hatari/files/hatari-2.3.1-caps5-include-path.patch 
b/games-emulation/hatari/files/hatari-2.3.1-caps5-include-path.patch
new file mode 100644
index 00000000000..a12207b0958
--- /dev/null
+++ b/games-emulation/hatari/files/hatari-2.3.1-caps5-include-path.patch
@@ -0,0 +1,18 @@
+Gentoo's spsdeclib ebuild installs headers in caps5/
+while upstream now expects them in caps/
+
+See: https://github.com/hatari/hatari/commit/367a87b
+--- a/cmake/FindCapsImage.cmake
++++ b/cmake/FindCapsImage.cmake
+@@ -6,3 +6,3 @@
+ 
+-SET(CAPSIMAGE_DIR caps)
++SET(CAPSIMAGE_DIR caps5)
+ FIND_PATH(CAPSIMAGE_INCLUDE_DIR ${CAPSIMAGE_DIR}/CapsAPI.h)
+--- a/src/floppy_ipf.c
++++ b/src/floppy_ipf.c
+@@ -34,3 +34,3 @@
+ #endif
+-#include <caps/CapsLibAll.h>
++#include <caps5/CapsLibAll.h>
+ #define CapsLong SDWORD

diff --git 
a/games-emulation/hatari/files/hatari-2.3.1-cmake-include-checksym.patch 
b/games-emulation/hatari/files/hatari-2.3.1-cmake-include-checksym.patch
new file mode 100644
index 00000000000..39da11ea307
--- /dev/null
+++ b/games-emulation/hatari/files/hatari-2.3.1-cmake-include-checksym.patch
@@ -0,0 +1,12 @@
+Fix edge case build failure triggered by passing every
+DISABLE_FIND_PACKAGE, including disabling the normally
+always-enabled readline.
+
+CMake Error at CMakeLists.txt:229 (check_symbol_exists):
+  Unknown CMake command "check_symbol_exists".
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -12,2 +12,3 @@
+ include(CheckStructHasMember)
++include(CheckSymbolExists)
+ include(CheckCCompilerFlag)

diff --git a/games-emulation/hatari/hatari-2.3.1.ebuild 
b/games-emulation/hatari/hatari-2.3.1.ebuild
new file mode 100644
index 00000000000..2512ca06655
--- /dev/null
+++ b/games-emulation/hatari/hatari-2.3.1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..10} )
+inherit cmake 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 gui microphone png portmidi readline udev zlib"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="
+       ${PYTHON_DEPS}
+       media-libs/libsdl2[sound,video]
+       capsimage? ( >=dev-libs/spsdeclib-5.1-r1 )
+       microphone? ( media-libs/portaudio )
+       png? ( media-libs/libpng:= )
+       portmidi? ( media-libs/portmidi )
+       readline? ( sys-libs/readline:= )
+       udev? ( virtual/udev )
+       zlib? ( sys-libs/zlib:= )"
+RDEPEND="
+       ${DEPEND}
+       gui? (
+               $(python_gen_cond_dep '
+                       dev-python/pygobject:3[${PYTHON_USEDEP}]
+               ')
+               x11-libs/gtk+:3[introspection]
+       )
+       >=games-emulation/emutos-0.9.9.1"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-caps5-include-path.patch
+       "${FILESDIR}"/${P}-cmake-include-checksym.patch
+)
+DOCS=(
+       readme.txt
+       doc/{bugs,changelog,scsi-driver,thanks,video-recording}.txt
+)
+
+src_prepare() {
+       cmake_src_prepare
+
+       sed -i "s/\.1\.gz\b/.1/g;T;s/gzip[^\$]*/cat /g" {*/,}*/CMakeLists.txt 
|| die
+       sed -i "s:doc/${PN}:doc/${PF}:" python-ui/uihelpers.py || die
+       # Note: >2.3.1 renames /python/ to /python3/, update accordingly
+       sed -i "s/python/${EPYTHON}/;s/dosfs/fs.fat/" tools/atari-hd-image.sh 
|| die
+
+       # Use emutos package rather than bundled ROM.
+       rm src/tos.img || die
+       cat <<-EOF > hatari.cfg || die
+               [ROM]
+               szTosImageFileName = ${EPREFIX}/usr/share/emutos/etos512k.img
+       EOF
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_SHARED_LIBS=OFF
+               -DCMAKE_DISABLE_FIND_PACKAGE_CapsImage=$(usex !capsimage)
+               -DCMAKE_DISABLE_FIND_PACKAGE_PNG=$(usex !png)
+               -DCMAKE_DISABLE_FIND_PACKAGE_PortAudio=$(usex !microphone)
+               -DCMAKE_DISABLE_FIND_PACKAGE_PortMidi=$(usex !portmidi)
+               -DCMAKE_DISABLE_FIND_PACKAGE_Readline=$(usex !readline)
+               -DCMAKE_DISABLE_FIND_PACKAGE_Udev=$(usex !udev)
+               -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=$(usex !zlib)
+               -DDOCDIR="${EPREFIX}"/usr/share/doc/${PF}
+               -DETCDIR="${EPREFIX}"/etc
+               $(usex gui '' -DPYTHON_EXECUTABLE=false) # disables python-ui/
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+
+       insinto /etc
+       doins hatari.cfg
+
+       python_fix_shebang "${ED}"/usr/bin
+       use gui && python_fix_shebang "${ED}"/usr/share/${PN}/${PN}ui
+}

Reply via email to