From dad17d62ea555b53d8026ffced65667cba68526d Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sat, 22 Sep 2018 15:16:00 +1000 Subject: [PATCH] PPSSPP: add recipe for 1.6.3 version --- .../ppsspp/additional-files/ppsspp.rdef.in | 48 +++ .../ppsspp/patches/ppsspp-1.6.3.patchset | 346 ++++++++++++++++++ games-emulation/ppsspp/ppsspp-1.6.3.recipe | 118 ++++++ 3 files changed, 512 insertions(+) create mode 100644 games-emulation/ppsspp/additional-files/ppsspp.rdef.in create mode 100644 games-emulation/ppsspp/patches/ppsspp-1.6.3.patchset create mode 100644 games-emulation/ppsspp/ppsspp-1.6.3.recipe diff --git a/games-emulation/ppsspp/additional-files/ppsspp.rdef.in b/games-emulation/ppsspp/additional-files/ppsspp.rdef.in new file mode 100644 index 000000000..60c5d63ca --- /dev/null +++ b/games-emulation/ppsspp/additional-files/ppsspp.rdef.in @@ -0,0 +1,48 @@ + +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "PPSSPP", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon { + $"6E6369660A020006023CADF43D104EBF02CA3EA2214AF02046648D0074CFFDFF" + $"00AAFF02000602BC8E1EBFAA3E3B7AF3B86D2649A3E24B65FD00011E2DFF06A1" + $"F103035580020006023A6497BA3F163EBCDC3EEA9146596A43B15700FFF7EAFE" + $"FDD17B02000602B80044B720B73E7690BF26D247B5794BBC6F00C85804FFDC95" + $"2F03A32904020006023AB3673751B2BC59783FD2D64AE3F146F85900C85805FF" + $"F06306020006023CADF43D104EBF02CA3EA2214AF02046648D00FFDB97FFFCAF" + $"29050104017A0F0A05BE5EC418BC05C1E5BA94BCF4BE06BBE7BF7EC1480A04BE" + $"06BBE7BFC2BB89C114C09FBF7EC1490A04BE5EC418BF7DC148C115C09CBFE2C3" + $"620A04C091C242C20EC180C67BC0DEC50AC1B90A04C630C69CC510C1B3C67BC0" + $"DEC7A1C5AF0A05BF20C4B8C091C242C510C1B9C636C6A3C1B7C6DB0A05B867C3" + $"50BBADC2EBBE11C4DEBCE6C707B99FC7330A05B860C350BA23C294BC6EC248BC" + $"ABC27FBBB3C2EB0A07BE0DC4DDBBAEC2ECBCA9C27FBE5EC417BF3CC3B0BF93C3" + $"F7BF7AC4210A05BEC7C578BF86C50CC1B7C6DAC2AEC6CFC12EC7C70A04C26DCC" + $"69C12EC7C7C2ACC6D0C3D1CB3C0A05BF03CC38BDBCC7D4BEC7C574C131C7C7C2" + $"6BCC690A08BCE5C706BE10C4DBBF78C423BF20C4B8BF3AC4CFBEEBC564BECBC5" + $"76BE78C62D0A15223D263B30392F38292636233C2141333F3943375434594654" + $"49474A4B59465E3A5E354E3847334B264B060E2E22A30F475F4D5F4C5F4E5F52" + $"5A5C6052575B4C4C4652465247524235512F583758385837583B5F3B5F3D5F0F" + $"0A09010E000A08010D123FCCBC0000000000003FD1693FE8853FBCE501158502" + $"040A0001000240BD1400000000000040B7D2C8004BC959BF0A0101010240BD14" + $"00000000000040B7D2C8004BC959BF0A0201020240BD1400000000000040B7D2" + $"C8004BC959BF0A0301030240BD1400000000000040B7D2C8004BC959BF0A0601" + $"040240BD1400000000000040B7D2C8004BC959BF0A0701050240BD1400000000" + $"000040B7D2C8004BC959BF0A0701060240BD1400000000000040B7D2C8004BC9" + $"59BF0A0301070240BD1400000000000040B7D2C8004BC959BF0A0401080240BD" + $"1400000000000040B7D2C8004BC959BF0A0101090240BD1400000000000040B7" + $"D2C8004BC959BF0A01010A0240BD1400000000000040B7D2C8004BC959BF0A00" + $"010B0240BD1400000000000040B7D2C8004BC959BF0A06010C0240BD14000000" + $"00000040B7D2C8004BC959BF" +}; diff --git a/games-emulation/ppsspp/patches/ppsspp-1.6.3.patchset b/games-emulation/ppsspp/patches/ppsspp-1.6.3.patchset new file mode 100644 index 000000000..e1c3de20d --- /dev/null +++ b/games-emulation/ppsspp/patches/ppsspp-1.6.3.patchset @@ -0,0 +1,346 @@ +From 498bb436e9d4f9792e8926569e9820b1d55d9620 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Fri, 21 Sep 2018 22:38:59 +1000 +Subject: Fixes for Haiku + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e26ebe2..f0a080b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -74,8 +74,12 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Android") + set(ANDROID ON) + endif() + ++if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku") ++ set(HAIKU ON) ++endif() ++ + # We only support Vulkan on Unix, Android and Windows. +-if(ANDROID OR WIN32 OR (UNIX AND NOT APPLE)) ++if(ANDROID OR WIN32 OR (UNIX AND NOT APPLE AND NOT HAIKU)) + set(VULKAN ON) + else() + add_definitions(-DNO_VULKAN) +@@ -123,7 +127,7 @@ option(USE_SYSTEM_LIBZIP "Dynamically link against system libzip" ${USE_SYSTEM_L + option(USE_WAYLAND_WSI "Set to ON to require Wayland support for Vulkan" ${USE_WAYLAND_WSI}) + option(USE_ADDRESS_SANITIZER "Use Clang memory sanitizer" ${USE_ADDRESS_SANITIZER}) + +-if(UNIX AND NOT (APPLE OR ANDROID) AND VULKAN) ++if(UNIX AND NOT (APPLE OR ANDROID OR HAIKU) AND VULKAN) + add_definitions(-DVK_USE_PLATFORM_XLIB_KHR) + # add_definitions(-DVK_USE_PLATFORM_XCB_KHR) + find_package(Wayland) +@@ -815,12 +819,20 @@ elseif(TARGET SDL2::SDL2) + set(TargetBin PPSSPPSDL) + # Require SDL + add_definitions(-DSDL) +- set(nativeExtra ${nativeExtra} +- SDL/SDLJoystick.h +- SDL/SDLJoystick.cpp +- SDL/SDLMain.cpp +- SDL/SDLGLGraphicsContext.cpp +- SDL/SDLVulkanGraphicsContext.cpp) ++ if(HAIKU) ++ set(nativeExtra ${nativeExtra} ++ SDL/SDLJoystick.h ++ SDL/SDLJoystick.cpp ++ SDL/SDLMain.cpp ++ SDL/SDLGLGraphicsContext.cpp) ++ else() ++ set(nativeExtra ${nativeExtra} ++ SDL/SDLJoystick.h ++ SDL/SDLJoystick.cpp ++ SDL/SDLMain.cpp ++ SDL/SDLGLGraphicsContext.cpp ++ SDL/SDLVulkanGraphicsContext.cpp) ++ endif() + set(nativeExtraLibs ${nativeExtraLibs} SDL2::SDL2) + if(APPLE) + set(nativeExtra ${nativeExtra} SDL/SDLMain.h SDL/SDLMain.mm) +@@ -882,13 +894,15 @@ set(THIN3D_PLATFORMS ext/native/thin3d/thin3d_gl.cpp + ext/native/thin3d/DataFormatGL.cpp + ext/native/thin3d/DataFormatGL.h) + +-set(THIN3D_PLATFORMS ${THIN3D_PLATFORMS} +- ext/native/thin3d/thin3d_vulkan.cpp +- ext/native/thin3d/VulkanRenderManager.cpp +- ext/native/thin3d/VulkanRenderManager.h +- ext/native/thin3d/VulkanQueueRunner.cpp +- ext/native/thin3d/VulkanQueueRunner.h +- ext/native/thin3d/DataFormat.h) ++if(NOT HAIKU) ++ set(THIN3D_PLATFORMS ${THIN3D_PLATFORMS} ++ ext/native/thin3d/thin3d_vulkan.cpp ++ ext/native/thin3d/VulkanRenderManager.cpp ++ ext/native/thin3d/VulkanRenderManager.h ++ ext/native/thin3d/VulkanQueueRunner.cpp ++ ext/native/thin3d/VulkanQueueRunner.h ++ ext/native/thin3d/DataFormat.h) ++endif() + + if(WIN32) + set(THIN3D_PLATFORMS ${THIN3D_PLATFORMS} +@@ -1071,6 +1085,8 @@ if(ANDROID) + target_link_libraries(native log EGL OpenSLES) + elseif(WIN32) + target_link_libraries(native ws2_32 winmm) ++elseif(HAIKU) ++ target_link_libraries(native network) + endif() + setup_target_project(native native) + +diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp +index 6517748..6bcb262 100644 +--- a/SDL/SDLMain.cpp ++++ b/SDL/SDLMain.cpp +@@ -259,7 +259,7 @@ void LaunchBrowser(const char *url) { + #elif defined(_WIN32) + std::wstring wurl = ConvertUTF8ToWString(url); + ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL); +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__HAIKU__) + std::string command = std::string("open ") + url; + system(command.c_str()); + #else +@@ -277,7 +277,7 @@ void LaunchMarket(const char *url) { + #elif defined(_WIN32) + std::wstring wurl = ConvertUTF8ToWString(url); + ShellExecute(NULL, L"open", wurl.c_str(), NULL, NULL, SW_SHOWNORMAL); +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__HAIKU__) + std::string command = std::string("open ") + url; + system(command.c_str()); + #else +@@ -295,7 +295,7 @@ void LaunchEmail(const char *email_address) { + #elif defined(_WIN32) + std::wstring mailto = std::wstring(L"mailto:") + ConvertUTF8ToWString(email_address); + ShellExecute(NULL, L"open", mailto.c_str(), NULL, NULL, SW_SHOWNORMAL); +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__HAIKU__) + std::string command = std::string("open mailto:") + email_address; + system(command.c_str()); + #else +@@ -314,6 +314,8 @@ std::string System_GetProperty(SystemProperty prop) { + return "SDL:Windows"; + #elif __linux__ + return "SDL:Linux"; ++#elif __HAIKU__ ++ return "SDL:Haiku"; + #elif __APPLE__ + return "SDL:OSX"; + #else +@@ -455,6 +457,23 @@ 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); ++#endif ++ + glslang::InitializeProcess(); + + #if PPSSPP_PLATFORM(RPI) +@@ -634,6 +653,7 @@ int main(int argc, char *argv[]) { + printf("GL init error '%s'\n", error_message.c_str()); + } + graphicsContext = ctx; ++#ifndef __HAIKU__ + } else if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { + SDLVulkanGraphicsContext *ctx = new SDLVulkanGraphicsContext(); + if (!ctx->Init(window, x, y, mode, &error_message)) { +@@ -647,6 +667,7 @@ int main(int argc, char *argv[]) { + } else { + graphicsContext = ctx; + } ++#endif + } + + bool useEmuThread = g_Config.iGPUBackend == (int)GPUBackend::OPENGL; +diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp +index 7130c7d..d021b37 100644 +--- a/UI/NativeApp.cpp ++++ b/UI/NativeApp.cpp +@@ -388,6 +388,9 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch + // most sense. + g_Config.memStickDirectory = std::string(external_dir) + "/"; + g_Config.flash0Directory = std::string(external_dir) + "/flash0/"; ++#elif defined(__HAIKU__) ++ g_Config.memStickDirectory = "/boot/home/config/settings/ppsspp/"; ++ g_Config.flash0Directory = File::GetExeDirectory() + "/assets/flash0/"; + #elif defined(IOS) + g_Config.memStickDirectory = user_data_path; + g_Config.flash0Directory = std::string(external_dir) + "/flash0/"; +-- +2.19.0 + + +From 9d1b4021bb324e49785fc4176b3cfd69f91d92de Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Fri, 21 Sep 2018 22:39:43 +1000 +Subject: Upstremed patchset for new ffmpeg support + + +diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp +index cf82e94..62832f6 100644 +--- a/Core/HW/MediaEngine.cpp ++++ b/Core/HW/MediaEngine.cpp +@@ -455,6 +455,14 @@ bool MediaEngine::setVideoStream(int streamNum, bool force) { + return false; + } + AVCodecContext *m_pCodecCtx = m_pFormatCtx->streams[streamNum]->codec; ++#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57,33,100) ++ AVCodecParameters *m_pCodecPar = m_pFormatCtx->streams[streamNum]->codecpar; ++ ++ // Update from deprecated public codec context ++ if (avcodec_parameters_from_context(m_pCodecPar, m_pCodecCtx) < 0) { ++ return false; ++ } ++#endif + + // Find the decoder for the video stream + AVCodec *pCodec = avcodec_find_decoder(m_pCodecCtx->codec_id); +@@ -766,9 +774,8 @@ int MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMo + delete [] imgbuf; + } + +-#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(bufferPtr, true, videoImageSize, currentMIPS->pc); +-#endif ++ + return videoImageSize; + #endif // USE_FFMPEG + return 0; +@@ -822,9 +829,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid + writeVideoLineRGBA(imgbuf, data, width); + data += m_desWidth * sizeof(u32); + imgbuf += videoLineSize; +-#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u32), true, width * sizeof(u32), currentMIPS->pc); +-#endif + } + break; + +@@ -834,9 +839,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid + writeVideoLineABGR5650(imgbuf, data, width); + data += m_desWidth * sizeof(u16); + imgbuf += videoLineSize; +-#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u16), true, width * sizeof(u16), currentMIPS->pc); +-#endif + } + break; + +@@ -846,9 +849,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid + writeVideoLineABGR5551(imgbuf, data, width); + data += m_desWidth * sizeof(u16); + imgbuf += videoLineSize; +-#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u16), true, width * sizeof(u16), currentMIPS->pc); +-#endif + } + break; + +@@ -858,9 +859,7 @@ int MediaEngine::writeVideoImageWithRange(u32 bufferPtr, int frameWidth, int vid + writeVideoLineABGR4444(imgbuf, data, width); + data += m_desWidth * sizeof(u16); + imgbuf += videoLineSize; +-#ifndef MOBILE_DEVICE + CBreakPoints::ExecMemCheck(bufferPtr + y * frameWidth * sizeof(u16), true, width * sizeof(u16), currentMIPS->pc); +-#endif + } + break; + +@@ -954,9 +953,8 @@ int MediaEngine::getAudioSamples(u32 bufferPtr) { + if (!m_audioContext->Decode(audioFrame, frameSize, buffer, &outbytes)) { + ERROR_LOG(ME, "Audio (%s) decode failed during video playback", GetCodecName(m_audioType)); + } +-#ifndef MOBILE_DEVICE ++ + CBreakPoints::ExecMemCheck(bufferPtr, true, outbytes, currentMIPS->pc); +-#endif + } + + return 0x2000; +-- +2.19.0 + + +From 5dcc808fa8bebf4d0edd18b4242e07186c5a0c2d Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sat, 22 Sep 2018 13:01:07 +1000 +Subject: Tune default settings for Haiku + + +diff --git a/Core/Config.cpp b/Core/Config.cpp +index e2bde29..36b8e37 100644 +--- a/Core/Config.cpp ++++ b/Core/Config.cpp +@@ -432,7 +432,7 @@ static int DefaultRenderingMode() { + + static int DefaultInternalResolution() { + // Auto on Windows, 2x on large screens, 1x elsewhere. +-#if defined(USING_WIN_UI) ++#if defined(USING_WIN_UI) || defined(__HAIKU__) + return 0; + #else + int longestDisplaySide = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)); +@@ -516,7 +516,11 @@ static ConfigSetting graphicsSettings[] = { + ReportedConfigSetting("InternalResolution", &g_Config.iInternalResolution, &DefaultInternalResolution, true, true), + ReportedConfigSetting("AndroidHwScale", &g_Config.iAndroidHwScale, &DefaultAndroidHwScale), + ReportedConfigSetting("HighQualityDepth", &g_Config.bHighQualityDepth, true, true, true), ++#ifdef __HAIKU__ ++ ReportedConfigSetting("FrameSkip", &g_Config.iFrameSkip, 1, true, true), ++#else + ReportedConfigSetting("FrameSkip", &g_Config.iFrameSkip, 0, true, true), ++#endif + ReportedConfigSetting("AutoFrameSkip", &g_Config.bAutoFrameSkip, false, true, true), + ConfigSetting("FrameRate", &g_Config.iFpsLimit, 0, true, true), + ConfigSetting("FrameSkipUnthrottle", &g_Config.bFrameSkipUnthrottle, &DefaultFrameskipUnthrottle, true, false), +@@ -526,10 +530,17 @@ static ConfigSetting graphicsSettings[] = { + ReportedConfigSetting("ForceMaxEmulatedFPS", &g_Config.iForceMaxEmulatedFPS, 60, true, true), + + // Most low-performance (and many high performance) mobile GPUs do not support aniso anyway so defaulting to 4 is fine. ++#ifdef __HAIKU__ ++ ConfigSetting("AnisotropyLevel", &g_Config.iAnisotropyLevel, 0, true, true), ++#else + ConfigSetting("AnisotropyLevel", &g_Config.iAnisotropyLevel, 4, true, true), +- ++#endif + ReportedConfigSetting("VertexDecCache", &g_Config.bVertexCache, &DefaultVertexCache, true, true), ++#ifdef __HAIKU__ ++ ReportedConfigSetting("TextureBackoffCache", &g_Config.bTextureBackoffCache, true, true, true), ++#else + ReportedConfigSetting("TextureBackoffCache", &g_Config.bTextureBackoffCache, false, true, true), ++#endif + ReportedConfigSetting("TextureSecondaryCache", &g_Config.bTextureSecondaryCache, false, true, true), + ReportedConfigSetting("VertexDecJit", &g_Config.bVertexDecoderJit, &DefaultCodeGen, false), + +@@ -563,7 +574,11 @@ static ConfigSetting graphicsSettings[] = { + ReportedConfigSetting("PostShader", &g_Config.sPostShaderName, "Off", true, true), + + ReportedConfigSetting("MemBlockTransferGPU", &g_Config.bBlockTransferGPU, true, true, true), ++#ifdef __HAIKU__ ++ ReportedConfigSetting("DisableSlowFramebufEffects", &g_Config.bDisableSlowFramebufEffects, true, true, true), ++#else + ReportedConfigSetting("DisableSlowFramebufEffects", &g_Config.bDisableSlowFramebufEffects, false, true, true), ++#endif + ReportedConfigSetting("FragmentTestCache", &g_Config.bFragmentTestCache, true, true, true), + + ConfigSetting("GfxDebugOutput", &g_Config.bGfxDebugOutput, false, false, false), +-- +2.19.0 + diff --git a/games-emulation/ppsspp/ppsspp-1.6.3.recipe b/games-emulation/ppsspp/ppsspp-1.6.3.recipe new file mode 100644 index 000000000..16b2804cd --- /dev/null +++ b/games-emulation/ppsspp/ppsspp-1.6.3.recipe @@ -0,0 +1,118 @@ +SUMMARY="A PSP emulator written in C++" +DESCRIPTION="PPSSPP is a PSP (PlayStation Portable) emulator capable of playing the \ +majority of the games made for Sony’s first portable console right on your favorite \ +Android or PC device." +HOMEPAGE="https://www.ppsspp.org/" +COPYRIGHT="2012-2018 PPSSPP Project" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://github.com/hrydgard/ppsspp/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="366f8b3c545071d919e1f51a5c4e0da48ba55cf1c15ff8d78a90985b3d5e8eb3" +SOURCE_FILENAME="ppsspp-$portVersion.tar.gz" +SOURCE_DIR="ppsspp-$portVersion" +srcVersion_2="0.10.0" +SOURCE_URI_2="https://github.com/Kingcom/armips/archive/v$srcVersion_2.tar.gz" +CHECKSUM_SHA256_2="73111ea551237dde5ff214c4fcbf6b87ef0b74906b404235b3eb0baa6d6c20b6" +SOURCE_FILENAME_2="armips-$srcVersion_2.tar.gz" +SOURCE_DIR_2="armips-$srcVersion_2" +srcVersion_3="7.9.2888" +SOURCE_URI_3="https://github.com/KhronosGroup/glslang/archive/$srcVersion_3.tar.gz" +CHECKSUM_SHA256_3="cb66779d0e6b5f07f0445bd58289a24e56e12693e71d75c8fae3db31ffacaf8c" +SOURCE_FILENAME_3="glslang-$srcVersion_3.tar.gz" +SOURCE_DIR_3="glslang-$srcVersion_3" +srcVersion_4="2018-08-07" +SOURCE_URI_4="https://github.com/KhronosGroup/SPIRV-Cross/archive/$srcVersion_4.tar.gz" +CHECKSUM_SHA256_4="3c1af25e808f81922c8a6e410b42ff595e02e3fda0b36df3446a393239a50ff7" +SOURCE_FILENAME_4="SPIRV-Cross-$srcVersion_4.tar.gz" +SOURCE_DIR_4="SPIRV-Cross-$srcVersion_4" +srcGitRev_5="2b15416501e64793204fc23fdf94c4365109198e" +SOURCE_URI_5="https://github.com/hrydgard/ppsspp-lang/archive/$srcGitRev_5.tar.gz" +CHECKSUM_SHA256_5="cb2cb6e8290dcee1ede21a73dafb5dabe6aae3d93db0525dc64b528b055a9fb5" +SOURCE_FILENAME_5="ppsspp-lang-$srcGitRev_5.tar.gz" +SOURCE_DIR_5="ppsspp-lang-$srcGitRev_5" + +PATCHES="ppsspp-$portVersion.patchset" +ADDITIONAL_FILES="ppsspp.rdef.in" + +ARCHITECTURES="!x86_gcc2 x86_64" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + ppsspp$secondaryArchSuffix = $portVersion + app:PPSSPP$secondaryArchSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libavcodec$secondaryArchSuffix + lib:libavformat$secondaryArchSuffix + lib:libavutil$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libGLU$secondaryArchSuffix + lib:libglew$secondaryArchSuffix + lib:libintl$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_image_2.0$secondaryArchSuffix + lib:libz$secondaryArchSuffix + lib:libzip$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libavcodec$secondaryArchSuffix + devel:libavformat$secondaryArchSuffix + devel:libavutil$secondaryArchSuffix + devel:libGL$secondaryArchSuffix + devel:libGLU$secondaryArchSuffix + devel:libglew$secondaryArchSuffix + devel:libintl$secondaryArchSuffix + devel:libSDL2_2.0$secondaryArchSuffix + devel:libSDL2_image_2.0$secondaryArchSuffix + devel:libz$secondaryArchSuffix + devel:libzip$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:cmake + cmd:pkg_config$secondaryArchSuffix + " + +BUILD() +{ + rm -rf ext/{armips,glslang,SPIRV-Cross} + ln -s $sourceDir2 ext/armips + ln -s $sourceDir3 ext/glslang + ln -s $sourceDir4 ext/SPIRV-Cross + cp -rf $sourceDir5/*.ini assets/lang + sed -i "s|unknown| $portVersion|" git-version.cmake + + mkdir -p build + cd build + + cmake .. + make $jobArgs +} + +INSTALL() +{ + mkdir -p $appsDir/PPSSPP + cp -f build/PPSSPPSDL $appsDir/PPSSPP/PPSSPP + cp -rf assets $appsDir/PPSSPP + + local APP_SIGNATURE="application/x-vnd.ppsspp" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + local LONG_INFO="$SUMMARY" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/ppsspp.rdef.in > ppsspp.rdef + + addResourcesToBinaries ppsspp.rdef $appsDir/PPSSPP/PPSSPP + mimeset -f $appsDir/PPSSPP/PPSSPP + addAppDeskbarSymlink $appsDir/PPSSPP/PPSSPP +}