diff --git a/games-emulation/ppsspp/patches/ppsspp-1.17.1.patchset b/games-emulation/ppsspp/patches/ppsspp-1.18.1.patchset similarity index 70% rename from games-emulation/ppsspp/patches/ppsspp-1.17.1.patchset rename to games-emulation/ppsspp/patches/ppsspp-1.18.1.patchset index 3c2a076b4..4996a2f01 100644 --- a/games-emulation/ppsspp/patches/ppsspp-1.17.1.patchset +++ b/games-emulation/ppsspp/patches/ppsspp-1.18.1.patchset @@ -1,11 +1,11 @@ -From 7b8b9dee309369ace97073faf9770ab1776fd5b2 Mon Sep 17 00:00:00 2001 +From 08ae0dddbb35169bb3afad02198f707de81a3306 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> -Date: Mon, 19 Feb 2024 23:32:42 +1000 +Date: Sat, 25 Jan 2025 14:21:51 +1000 Subject: Fix for Haiku diff --git a/CMakeLists.txt b/CMakeLists.txt -index bfd5e69..f1c3c32 100644 +index a355317..077294a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Android") @@ -17,16 +17,47 @@ index bfd5e69..f1c3c32 100644 set(VULKAN ON) endif() -@@ -174,7 +174,7 @@ option(USE_SYSTEM_MINIUPNPC "Dynamically link against system miniUPnPc" ${USE_SY - option(USE_ASAN "Use address sanitizer" OFF) - option(USE_UBSAN "Use undefined behaviour sanitizer" OFF) +@@ -192,7 +192,7 @@ if(USE_CCACHE) + include(ccache) + endif() -if(UNIX AND NOT (APPLE OR ANDROID) AND VULKAN) +if(UNIX AND NOT (APPLE OR ANDROID OR HAIKU) AND VULKAN) if(USING_X11_VULKAN) message("Using X11 for Vulkan") find_package(X11) -@@ -1523,7 +1523,7 @@ add_library(native STATIC +@@ -956,7 +956,7 @@ if(USE_FFMPEG) + endif() + elseif(MACOSX) + set(PLATFORM_ARCH "macosx/universal") +- elseif(LINUX) ++ elseif(LINUX) + if(ARMV7) + set(PLATFORM_ARCH "linux/armv7") + elseif(ARM64) +@@ -974,6 +974,12 @@ if(USE_FFMPEG) + elseif(X86) + set(PLATFORM_ARCH "linux/x86") + endif() ++ elseif(HAIKU) ++ if(X86_64) ++ set(PLATFORM_ARCH "haiku/x86_64") ++ elseif(X86) ++ set(PLATFORM_ARCH "haiku/x86") ++ endif() + elseif(WIN32) + if(X86_64) + set(PLATFORM_ARCH "Windows/x86_64") +@@ -1345,7 +1351,7 @@ elseif(IOS AND NOT LIBRETRO) + set(nativeExtraLibs ${nativeExtraLibs} "-weak_framework GameController") + endif() + +- if(NOT ICONV_LIBRARY) ++ if(NOT ICONV_LIBRARY OR HAIKU) + set(nativeExtraLibs ${nativeExtraLibs} iconv) + endif() + +@@ -1609,7 +1615,7 @@ add_library(native STATIC ext/jpge/jpge.h ) @@ -35,7 +66,7 @@ index bfd5e69..f1c3c32 100644 set(RT_LIB rt) endif() -@@ -1541,6 +1541,8 @@ if(ANDROID) +@@ -1627,6 +1633,8 @@ if(ANDROID) target_link_libraries(native log EGL OpenSLES) elseif(WIN32) target_link_libraries(native ws2_32 winmm) @@ -44,18 +75,7 @@ index bfd5e69..f1c3c32 100644 elseif(${CMAKE_SYSTEM_NAME} MATCHES "^(DragonFly|FreeBSD|NetBSD)$") target_link_libraries(native execinfo) endif() -@@ -2334,8 +2336,8 @@ else() - set(ZSTD_BUILD_PROGRAMS OFF CACHE BOOL "we don't need zstd programs" FORCE) - set(ZSTD_LEGACY_SUPPORT OFF CACHE BOOL "we don't use any old zstd files" FORCE) - add_subdirectory(ext/zstd/build/cmake EXCLUDE_FROM_ALL) -- set(CoreExtraLibs ${CoreExtraLibs} libzstd_static) -- include_directories(ext/zstd/lib) -+ set(CoreExtraLibs ${CoreExtraLibs} zstd) -+# include_directories(ext/zstd/lib) - endif() - - include_directories(ext/libchdr/include) -@@ -2367,12 +2369,15 @@ if(FFmpeg_FOUND) +@@ -2466,12 +2474,15 @@ if(FFmpeg_FOUND) endif() # Discord integration @@ -72,7 +92,7 @@ index bfd5e69..f1c3c32 100644 if(USE_MINIUPNPC) if(USE_SYSTEM_MINIUPNPC) find_package(MINIUPNPC REQUIRED) -@@ -2449,6 +2454,7 @@ if(USE_MINIUPNPC) +@@ -2551,6 +2562,7 @@ if(USE_MINIUPNPC) endif() endif() endif() @@ -80,7 +100,7 @@ index bfd5e69..f1c3c32 100644 setup_target_project(${CoreLibName} Core) -@@ -2574,6 +2580,10 @@ set(WindowsFiles +@@ -2676,6 +2688,10 @@ set(WindowsFiles list(APPEND LinkCommon ${CoreLibName} ${CMAKE_THREAD_LIBS_INIT}) @@ -89,7 +109,7 @@ index bfd5e69..f1c3c32 100644 +endif() + if(WIN32) - list(APPEND LinkCommon kernel32 user32 gdi32 shell32 comctl32 dsound xinput d3d9 winmm dinput8 ole32 winspool ksuser mf uxtheme mfplat mfreadwrite mfuuid shlwapi) + list(APPEND LinkCommon kernel32 user32 gdi32 shell32 comctl32 dsound xinput d3d9 winmm dinput8 ole32 winspool ksuser dwmapi mf uxtheme mfplat mfreadwrite mfuuid shlwapi) #setup_target_project(${TargetBin} Windows) diff --git a/Common/Swap.h b/Common/Swap.h index 3a5d8ac..f68142f 100644 @@ -105,7 +125,7 @@ index 3a5d8ac..f68142f 100644 #define bswap16 swap16 #define bswap32 swap32 diff --git a/Common/Thread/ThreadUtil.cpp b/Common/Thread/ThreadUtil.cpp -index 338dfa1..41c9175 100644 +index 0e0badb..a380710 100644 --- a/Common/Thread/ThreadUtil.cpp +++ b/Common/Thread/ThreadUtil.cpp @@ -57,8 +57,10 @@ void RegisterAttachDetach(AttachDetachFunc attach, AttachDetachFunc detach) { @@ -120,19 +140,19 @@ index 338dfa1..41c9175 100644 #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) #include diff --git a/Core/Config.cpp b/Core/Config.cpp -index 008ef0c..7b6aa4b 100644 +index 14a8c98..3683de8 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp -@@ -354,7 +354,7 @@ static const ConfigSetting cpuSettings[] = { +@@ -360,7 +360,7 @@ static const ConfigSetting cpuSettings[] = { static int DefaultInternalResolution() { - // Auto on Windows and Linux, 2x on large screens, 1x elsewhere. + // Auto on Windows and Linux, 2x on large screens and iOS, 1x elsewhere. -#if defined(USING_WIN_UI) || defined(USING_QT_UI) +#if defined(USING_WIN_UI) || defined(USING_QT_UI) || defined(__HAIKU__) return 0; - #else - if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_VR) { -@@ -615,7 +615,11 @@ static const ConfigSetting graphicsSettings[] = { + #elif PPSSPP_PLATFORM(IOS) + return 2; +@@ -624,7 +624,11 @@ static const ConfigSetting graphicsSettings[] = { ConfigSetting("InternalResolution", &g_Config.iInternalResolution, &DefaultInternalResolution, CfgFlag::PER_GAME | CfgFlag::REPORT), ConfigSetting("AndroidHwScale", &g_Config.iAndroidHwScale, &DefaultAndroidHwScale, CfgFlag::DEFAULT), ConfigSetting("HighQualityDepth", &g_Config.bHighQualityDepth, true, CfgFlag::PER_GAME | CfgFlag::REPORT), @@ -144,7 +164,7 @@ index 008ef0c..7b6aa4b 100644 ConfigSetting("FrameSkipType", &g_Config.iFrameSkipType, 0, CfgFlag::PER_GAME | CfgFlag::REPORT), ConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, IsVREnabled(), CfgFlag::PER_GAME | CfgFlag::REPORT), ConfigSetting("StereoRendering", &g_Config.bStereoRendering, false, CfgFlag::PER_GAME), -@@ -629,10 +633,17 @@ static const ConfigSetting graphicsSettings[] = { +@@ -638,10 +642,17 @@ static const ConfigSetting graphicsSettings[] = { #endif // Most low-performance (and many high performance) mobile GPUs do not support aniso anyway so defaulting to 4 is fine. @@ -164,10 +184,10 @@ index 008ef0c..7b6aa4b 100644 #ifndef MOBILE_DEVICE diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp -index 5c99439..946e895 100644 +index 759e3a9..f4bb38a 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp -@@ -2070,7 +2070,7 @@ int setUDPConnReset(int udpsock, bool enabled) { +@@ -2086,7 +2086,7 @@ int setUDPConnReset(int udpsock, bool enabled) { return -1; } @@ -176,7 +196,7 @@ index 5c99439..946e895 100644 #define TCP_KEEPIDLE TCP_KEEPALIVE //TCP_KEEPIDLE on Linux is equivalent to TCP_KEEPALIVE on macOS #endif // VS 2017 compatibility -@@ -2090,12 +2090,14 @@ int setSockKeepAlive(int sock, bool keepalive, const int keepinvl, const int kee +@@ -2106,12 +2106,14 @@ int setSockKeepAlive(int sock, bool keepalive, const int keepinvl, const int kee if (result == 0 && keepalive) { if (getsockopt(sock, SOL_SOCKET, SO_TYPE, (char*)&optval, (socklen_t*)&optlen) == 0 && optval == SOCK_STREAM) { optlen = sizeof(optval); @@ -193,7 +213,7 @@ index 5c99439..946e895 100644 } #endif // !PPSSPP_PLATFORM(SWITCH) && !PPSSPP_PLATFORM(OPENBSD) diff --git a/Core/Instance.cpp b/Core/Instance.cpp -index b8ecfd8..6ddd9eb 100644 +index fcb350f..746ff83 100644 --- a/Core/Instance.cpp +++ b/Core/Instance.cpp @@ -81,7 +81,7 @@ static bool UpdateInstanceCounter(void (*callback)(volatile InstanceInfo *)) { @@ -206,10 +226,10 @@ index b8ecfd8..6ddd9eb 100644 return false; #else diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp -index 50489bb..78c4734 100644 +index c172f43..d537540 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp -@@ -374,6 +374,9 @@ void System_LaunchUrl(LaunchUrlType urlType, const char *url) { +@@ -393,6 +393,9 @@ void System_LaunchUrl(LaunchUrlType urlType, const char *url) { ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL); #elif defined(__APPLE__) OSXOpenURL(url); @@ -219,7 +239,7 @@ index 50489bb..78c4734 100644 #else std::string command = std::string("xdg-open ") + url; int err = system(command.c_str()); -@@ -393,6 +396,9 @@ void System_LaunchUrl(LaunchUrlType urlType, const char *url) { +@@ -412,6 +415,9 @@ void System_LaunchUrl(LaunchUrlType urlType, const char *url) { #elif defined(__APPLE__) std::string mailToURL = std::string("mailto:") + url; OSXOpenURL(mailToURL.c_str()); @@ -229,7 +249,7 @@ index 50489bb..78c4734 100644 #else std::string command = std::string("xdg-email ") + url; int err = system(command.c_str()); -@@ -412,6 +418,8 @@ std::string System_GetProperty(SystemProperty prop) { +@@ -431,6 +437,8 @@ std::string System_GetProperty(SystemProperty prop) { return "SDL:Windows"; #elif __linux__ return "SDL:Linux"; @@ -238,9 +258,9 @@ index 50489bb..78c4734 100644 #elif __APPLE__ return "SDL:macOS"; #elif PPSSPP_PLATFORM(SWITCH) -@@ -1097,6 +1105,16 @@ int main(int argc, char *argv[]) { - } - } +@@ -1145,6 +1153,16 @@ int main(int argc, char *argv[]) { + + TimeInit(); +#ifdef __HAIKU__ + char *binpath = realpath(argv[0], NULL); @@ -256,7 +276,7 @@ index 50489bb..78c4734 100644 socketInitializeDefault(); nxlinkStdio(); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp -index 89ce32f..2e71d77 100644 +index 4c035ca..23ecbb0 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -486,6 +486,9 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch @@ -307,10 +327,10 @@ index 648c0ba..cf5bd49 100644 NO_CMAKE_FIND_ROOT_PATH ) diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt -index fe6b714..63b1f31 100644 +index b0aa7ad..f32cebc 100644 --- a/ext/CMakeLists.txt +++ b/ext/CMakeLists.txt -@@ -34,7 +34,7 @@ add_subdirectory(rcheevos-build) +@@ -36,7 +36,7 @@ add_subdirectory(rcheevos-build) if(NOT HTTPS_NOT_AVAILABLE) add_subdirectory(naett-build) endif() @@ -364,6 +384,118 @@ index aeecc38..34852f7 100644 /* note: use after variable declarations */ #ifndef XXH_STATIC_ASSERT # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */ +diff --git a/ffmpeg/haiku-build.sh b/ffmpeg/haiku-build.sh +new file mode 100755 +index 0000000..b1934b6 +--- /dev/null ++++ b/ffmpeg/haiku-build.sh +@@ -0,0 +1,106 @@ ++#!/bin/sh ++ ++rm -f config.h ++echo "Building for Haiku" ++ ++set -e ++ ++ARCH=$(getarch) ++ ++GENERAL=" ++ --disable-shared \ ++ --enable-static" ++ ++MODULES="\ ++ --disable-avdevice \ ++ --disable-filters \ ++ --disable-programs \ ++ --disable-network \ ++ --disable-avfilter \ ++ --disable-postproc \ ++ --disable-encoders \ ++ --disable-doc \ ++ --disable-ffplay \ ++ --disable-ffprobe \ ++ --disable-ffserver \ ++ --disable-ffmpeg" ++ ++VIDEO_DECODERS="\ ++ --enable-decoder=h264 \ ++ --enable-decoder=mpeg4 \ ++ --enable-decoder=h263 \ ++ --enable-decoder=h263p \ ++ --enable-decoder=mpeg2video \ ++ --enable-decoder=mjpeg \ ++ --enable-decoder=mjpegb" ++ ++AUDIO_DECODERS="\ ++ --enable-decoder=aac \ ++ --enable-decoder=aac_latm \ ++ --enable-decoder=atrac3 \ ++ --enable-decoder=atrac3p \ ++ --enable-decoder=mp3 \ ++ --enable-decoder=pcm_s16le \ ++ --enable-decoder=pcm_s8" ++ ++DEMUXERS="\ ++ --enable-demuxer=h264 \ ++ --enable-demuxer=h263 \ ++ --enable-demuxer=m4v \ ++ --enable-demuxer=mpegps \ ++ --enable-demuxer=mpegvideo \ ++ --enable-demuxer=avi \ ++ --enable-demuxer=mp3 \ ++ --enable-demuxer=aac \ ++ --enable-demuxer=pmp \ ++ --enable-demuxer=oma \ ++ --enable-demuxer=pcm_s16le \ ++ --enable-demuxer=pcm_s8 \ ++ --enable-demuxer=wav" ++ ++VIDEO_ENCODERS="\ ++ --enable-encoder=ffv1 \ ++ --enable-encoder=huffyuv \ ++ --enable-encoder=mpeg4" ++ ++AUDIO_ENCODERS="\ ++ --enable-encoder=pcm_s16le" ++ ++MUXERS="\ ++ --enable-muxer=avi" ++ ++PARSERS="\ ++ --enable-parser=h264 \ ++ --enable-parser=mpeg4video \ ++ --enable-parser=mpegvideo \ ++ --enable-parser=aac \ ++ --enable-parser=aac_latm \ ++ --enable-parser=mpegaudio" ++ ++PROTOCOLS="\ ++ --enable-protocol=file" ++ ++export LDFLAGS="-fPIC" ++ ++./configure \ ++ --prefix=./haiku/${ARCH} \ ++ ${GENERAL} \ ++ --extra-cflags="-O3 -fPIC" \ ++ --extra-cxxflags="-O3 -fPIC" \ ++ --extra-ldflags="-fPIC -liconv" \ ++ --enable-zlib \ ++ --disable-yasm \ ++ --disable-inline-asm \ ++ --disable-everything \ ++ ${MODULES} \ ++ ${VIDEO_DECODERS} \ ++ ${AUDIO_DECODERS} \ ++ ${VIDEO_ENCODERS} \ ++ ${AUDIO_ENCODERS} \ ++ ${DEMUXERS} \ ++ ${MUXERS} \ ++ ${PARSERS} \ ++ ${PROTOCOLS} ++ ++make clean ++make install -- -2.42.1 +2.45.2 diff --git a/games-emulation/ppsspp/ppsspp-1.17.1.recipe b/games-emulation/ppsspp/ppsspp-1.18.1.recipe similarity index 88% rename from games-emulation/ppsspp/ppsspp-1.17.1.recipe rename to games-emulation/ppsspp/ppsspp-1.18.1.recipe index 15586a789..a16967094 100644 --- a/games-emulation/ppsspp/ppsspp-1.17.1.recipe +++ b/games-emulation/ppsspp/ppsspp-1.18.1.recipe @@ -7,7 +7,7 @@ COPYRIGHT="2012-2024 PPSSPP Project" LICENSE="GNU GPL v2" REVISION="1" SOURCE_URI="https://github.com/hrydgard/ppsspp/releases/download/v${portVersion}/ppsspp-${portVersion}.tar.xz" -CHECKSUM_SHA256="23e0b8649cc8124b0c22a62d4d41b592b6bd4064bce8c09b0d4abce895e132ae" +CHECKSUM_SHA256="78c5d17f09443d7ea450fce9fdc0581b520cf206c42095dd855e94be2e09bdcf" SOURCE_FILENAME="ppsspp-$portVersion.tar.xz" SOURCE_DIR="ppsspp-$portVersion" PATCHES="ppsspp-$portVersion.patchset" @@ -22,14 +22,12 @@ PROVIDES=" " REQUIRES=" haiku$secondaryArchSuffix - lib:libavcodec$secondaryArchSuffix - lib:libavformat$secondaryArchSuffix - lib:libavutil$secondaryArchSuffix lib:libfontconfig$secondaryArchSuffix lib:libfreetype$secondaryArchSuffix lib:libGL$secondaryArchSuffix lib:libglew$secondaryArchSuffix lib:libGLU$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix lib:libintl$secondaryArchSuffix lib:libminiupnpc$secondaryArchSuffix lib:libpng16$secondaryArchSuffix @@ -44,14 +42,12 @@ REQUIRES=" BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel - devel:libavcodec$secondaryArchSuffix >= 58 - devel:libavformat$secondaryArchSuffix >= 58 - devel:libavutil$secondaryArchSuffix >= 56 devel:libfontconfig$secondaryArchSuffix devel:libfreetype$secondaryArchSuffix devel:libGL$secondaryArchSuffix devel:libglew$secondaryArchSuffix >= 2.2 devel:libGLU$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix devel:libintl$secondaryArchSuffix devel:libminiupnpc$secondaryArchSuffix devel:libpng16$secondaryArchSuffix @@ -64,7 +60,9 @@ BUILD_REQUIRES=" devel:libzstd$secondaryArchSuffix " BUILD_PREREQUIRES=" + cmd:awk cmd:cmake + cmd:cmp cmd:gcc$secondaryArchSuffix cmd:lrelease$secondaryArchSuffix cmd:make @@ -76,16 +74,21 @@ BUILD() { export DISABLE_ASLR=1 + pushd ffmpeg + haiku-build.sh + popd + cmake -B build -S . \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_SYSTEM_FFMPEG=ON \ + -DUSE_SYSTEM_FFMPEG=OFF \ -DUSE_SYSTEM_SNAPPY=ON \ -DUSE_SYSTEM_LIBZIP=ON \ -DUSE_SYSTEM_ZSTD=ON \ -DUSE_SYSTEM_MINIUPNPC=ON \ -DUSE_DISCORD=OFF \ -DCMAKE_C_FLAGS="-D_BSD_SOURCE" \ - -DCMAKE_CXX_FLAGS="-D_BSD_SOURCE" + -DCMAKE_CXX_FLAGS="-D_BSD_SOURCE" \ + -DCMAKE_EXE_LINKER_FLAGS="-lbsd -liconv -fPIC" make -C build $jobArgs }