From b4aa4c627f6bb0380dc3647dfc40967f1e838392 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Sun, 21 Jul 2024 10:00:48 +0200 Subject: [PATCH] gsplus, new recipe (#10714) --- app-emulation/gsplus/gsplus-0.14.recipe | 71 +++++++++++++++++++ .../gsplus/patches/gsplus-0.14.patchset | 61 ++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 app-emulation/gsplus/gsplus-0.14.recipe create mode 100644 app-emulation/gsplus/patches/gsplus-0.14.patchset diff --git a/app-emulation/gsplus/gsplus-0.14.recipe b/app-emulation/gsplus/gsplus-0.14.recipe new file mode 100644 index 000000000..322cb0022 --- /dev/null +++ b/app-emulation/gsplus/gsplus-0.14.recipe @@ -0,0 +1,71 @@ +SUMMARY="Modern cross-platform Apple IIgs emulator" +DESCRIPTION="GSplus is an Apple IIgs emulator. It's an open-source project based on the KEGS and \ +GSPort emulators. It supports fullscreen, joysticks and audio through the SDL2 library across \ +platforms." +HOMEPAGE="https://apple2.gs/plus/" +COPYRIGHT="2003 Kent Dickey + 2010-2014 GSport contributors + 2016-2018 Dagen Brock" +LICENSE="GNU GPL v2" +REVISION="1" +srcGitRev="480572054518112647c8fae5d7ea7046a6d6ecfb" +SOURCE_URI="https://github.com/digarok/gsplus/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="0b5d7cc83d66625f55f2c0518ec65f697a5a02af94fca018eb692d6a7eb87d2c" +SOURCE_DIR="gsplus-$srcGitRev" +PATCHES="gsplus-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + gsplus = $portVersion + cmd:GSplus = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libedit$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_image_2.0$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libedit$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix + devel:libpcap$secondaryArchSuffix + devel:libSDL2_2.0$secondaryArchSuffix + devel:libSDL2_image_2.0$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:perl + cmd:pkg_config$secondaryArchSuffix + cmd:re2c + " + +BUILD() +{ + cmake -Bbuild -S. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$prefix \ + -DREADLINE=LIBEDIT + make -Cbuild +} + +INSTALL() +{ + mkdir -p $prefix/bin $dataDir/gsplus $docDir + cp build/bin/GSplus $prefix/bin + cp src/assets/* $dataDir/gsplus + # cleanup + rm -rf $dataDir/gsplus/{*.ico,*.icns} + cp doc/{*.pdf,README.txt} $docDir +} + +TEST() +{ + make check +} diff --git a/app-emulation/gsplus/patches/gsplus-0.14.patchset b/app-emulation/gsplus/patches/gsplus-0.14.patchset new file mode 100644 index 000000000..03faa2f8e --- /dev/null +++ b/app-emulation/gsplus/patches/gsplus-0.14.patchset @@ -0,0 +1,61 @@ +From 318175fb1955c08f9fd0ce6f3b812e417f78ffaf Mon Sep 17 00:00:00 2001 +From: coolcoder613eb <96163908+coolcoder613eb@users.noreply.github.com> +Date: Fri, 19 Jul 2024 09:13:48 +0200 +Subject: Add Haiku support + + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 6ae49e4..250f6e9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -256,6 +256,10 @@ if (WIN32) + ) + endif() + ++if (CMAKE_SYSTEM_NAME MATCHES "Haiku") ++ target_link_libraries(GSplus network gnu) ++endif() ++ + if (DRIVER MATCHES "SDL") + target_link_libraries(GSplus ${SDL2_LDFLAGS} ${FREETYPE2_LDFLAGS} SDL2_image) + target_compile_options(GSplus PUBLIC ${SDL2_CFLAGS} ${FREETYPE2_CFLAGS} -DHAVE_SDL) +diff --git a/src/sound.h b/src/sound.h +index 3b5ad44..65f8029 100644 +--- a/src/sound.h ++++ b/src/sound.h +@@ -7,8 +7,10 @@ + + #if !defined(_WIN32) && !defined(__CYGWIN__) + # include ++#ifndef __HAIKU__ + # include + #endif ++#endif + + #define SOUND_SHM_SAMP_SIZE (32*1024) + +diff --git a/src/unix_host_common.c b/src/unix_host_common.c +index 30523c0..83bc2ce 100644 +--- a/src/unix_host_common.c ++++ b/src/unix_host_common.c +@@ -16,7 +16,7 @@ + #include + #endif + +-#ifdef __linux__ ++#if defined(__linux__) || defined(__HAIKU__) + #include + #endif + +@@ -394,7 +394,7 @@ word32 host_set_file_info(const char *path, struct file_info *fi) { + } + return 0; + } +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__HAIKU__) + word32 host_set_file_info(const char *path, struct file_info *fi) { + + if (fi->has_fi && fi->storage_type != 0x0d) { +-- +2.45.2 +