From b9f5dab6c51570aa6cea9418b76e8748324d4a58 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Thu, 5 Sep 2019 23:11:35 +1000 Subject: [PATCH] PPSSPP: fix working directory --- .../ppsspp/patches/ppsspp-1.8.0.patchset | 101 +++++++++++++++++- games-emulation/ppsspp/ppsspp-1.8.0.recipe | 4 +- 2 files changed, 100 insertions(+), 5 deletions(-) diff --git a/games-emulation/ppsspp/patches/ppsspp-1.8.0.patchset b/games-emulation/ppsspp/patches/ppsspp-1.8.0.patchset index 217c215a4..8c450727a 100644 --- a/games-emulation/ppsspp/patches/ppsspp-1.8.0.patchset +++ b/games-emulation/ppsspp/patches/ppsspp-1.8.0.patchset @@ -1,4 +1,4 @@ -From abc5fcacf3d90c1d0869e3dae6094226a02ccfda Mon Sep 17 00:00:00 2001 +From a816dbba1b7a1f74a1f8be1b815ec896359bb0f1 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Thu, 4 Apr 2019 19:44:46 +1000 Subject: Fixes for Haiku @@ -167,7 +167,7 @@ index 7c4ae40..dd17922 100644 #if PPSSPP_PLATFORM(RPI) diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp -index 38e9466..e17e08c 100644 +index 38e9466..838b839 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -475,6 +475,9 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch @@ -193,5 +193,100 @@ index b259a6f..601ac45 100644 add_subdirectory(discord-rpc-build) endif() -- -2.19.1 +2.23.0 + + +From 76cfba09f1e6c34b7bb10949c8db22b8bcfc0502 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 5 Sep 2019 22:00:26 +1000 +Subject: Fix for endian + + +diff --git a/Common/Swap.h b/Common/Swap.h +index 3a5d8ac..f68142f 100644 +--- a/Common/Swap.h ++++ b/Common/Swap.h +@@ -68,6 +68,8 @@ inline unsigned short bswap16(unsigned short x) { return _byteswap_ushort(x); } + #elif defined(__DragonFly__) || defined(__FreeBSD__) || \ + defined(__NetBSD__) || defined(__OpenBSD__) + #include ++#elif defined(__HAIKU__) ++#include + # ifdef __OpenBSD__ + #define bswap16 swap16 + #define bswap32 swap32 +-- +2.23.0 + + +From 96c24d549b9d8caa90f6e18d96484ee5ae6993fd Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 5 Sep 2019 22:00:41 +1000 +Subject: Fix for ffmpeg 4.2 + + +diff --git a/cmake/Modules/FindFFmpeg.cmake b/cmake/Modules/FindFFmpeg.cmake +index a8c482d..a1b76e1 100644 +--- a/cmake/Modules/FindFFmpeg.cmake ++++ b/cmake/Modules/FindFFmpeg.cmake +@@ -33,7 +33,6 @@ set(_FFmpeg_ALL_COMPONENTS + avfilter + avformat + avutil +- postproc + swresample + swscale + ) +@@ -42,7 +41,6 @@ set(_FFmpeg_DEPS_avcodec avutil) + set(_FFmpeg_DEPS_avdevice avcodec avformat avutil) + set(_FFmpeg_DEPS_avfilter avutil) + set(_FFmpeg_DEPS_avformat avcodec avutil) +-set(_FFmpeg_DEPS_postproc avutil) + set(_FFmpeg_DEPS_swresample avutil) + set(_FFmpeg_DEPS_swscale avutil) + +-- +2.23.0 + + +From 8205838ddc6c9de037406c2f45f5b7f91e59628f Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 5 Sep 2019 22:48:49 +1000 +Subject: Resolve symlink + + +diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp +index dd17922..19b8d51 100644 +--- a/SDL/SDLMain.cpp ++++ b/SDL/SDLMain.cpp +@@ -345,20 +345,13 @@ int main(int argc, char *argv[]) { + } + + #ifdef __HAIKU__ +- char abs_exe_path[PATH_MAX]; +- char path_save[PATH_MAX]; +- char *p; +- +- if(!(p = strrchr(argv[0], '/'))) { +- getcwd(abs_exe_path, sizeof(abs_exe_path)); +- } else { +- *p = '\0'; +- getcwd(path_save, sizeof(path_save)); +- chdir(argv[0]); +- getcwd(abs_exe_path, sizeof(abs_exe_path)); +- chdir(path_save); +- } +- chdir(abs_exe_path); ++ char *binpath = realpath(argv[0], NULL); ++ if (binpath != NULL) { ++ char *appdir = strrchr(binpath, '/'); ++ *appdir = '\0'; ++ chdir(binpath); ++ free(binpath); ++ } + #endif + + glslang::InitializeProcess(); +-- +2.23.0 diff --git a/games-emulation/ppsspp/ppsspp-1.8.0.recipe b/games-emulation/ppsspp/ppsspp-1.8.0.recipe index 0ab320eac..31da33526 100644 --- a/games-emulation/ppsspp/ppsspp-1.8.0.recipe +++ b/games-emulation/ppsspp/ppsspp-1.8.0.recipe @@ -5,7 +5,7 @@ Android or PC device." HOMEPAGE="https://www.ppsspp.org/" COPYRIGHT="2012-2019 PPSSPP Project" LICENSE="GNU GPL v2" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/hrydgard/ppsspp/archive/v$portVersion.tar.gz" CHECKSUM_SHA256="a7011feb0480a352d60e6a3c939d88d4d2e3a2e76620886b183aa2cb36f910de" SOURCE_FILENAME="ppsspp-$portVersion.tar.gz" @@ -71,7 +71,7 @@ BUILD_REQUIRES=" " BUILD_PREREQUIRES=" cmd:cmake - cmd:gcc$secondaryArchSuffix + cmd:gcc$secondaryArchSuffix cmd:make cmd:pkg_config$secondaryArchSuffix "