mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 15:15:37 +00:00
Added experimental support for building on Haiku
This commit is contained in:
parent
0347a276ea
commit
c15eff8994
|
@ -132,6 +132,15 @@ elseif(WIN32)
|
|||
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/external/pugixml/pugixml.dll)
|
||||
message(FATAL_ERROR "-- You need to build the dependencies in ./external first")
|
||||
endif()
|
||||
elseif(HAIKU)
|
||||
find_package(FreeImage REQUIRED)
|
||||
find_package(Freetype REQUIRED)
|
||||
find_package(HarfBuzz REQUIRED)
|
||||
find_package(ICU REQUIRED)
|
||||
find_package(Intl REQUIRED)
|
||||
find_package(Libgit2 REQUIRED)
|
||||
find_package(Pugixml REQUIRED)
|
||||
find_package(SDL2 REQUIRED)
|
||||
elseif(NOT EMSCRIPTEN AND NOT ANDROID)
|
||||
find_package(CURL REQUIRED)
|
||||
find_package(FFmpeg REQUIRED)
|
||||
|
@ -378,11 +387,7 @@ if(DEINIT_ON_LAUNCH)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(AUR_BUILD OR FLATPAK_BUILD OR RETRODECK OR RPI)
|
||||
set(APPLICATION_UPDATER OFF)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
|
||||
if(AUR_BUILD OR FLATPAK_BUILD OR RETRODECK OR RPI OR HAIKU OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)
|
||||
set(APPLICATION_UPDATER OFF)
|
||||
endif()
|
||||
|
||||
|
@ -510,6 +515,17 @@ elseif(ANDROID)
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/external/libgit2/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/external/pugixml/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/external/SDL_Android)
|
||||
elseif(HAIKU)
|
||||
set(COMMON_INCLUDE_DIRS ${COMMON_INCLUDE_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/external/curl/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/external/FFmpeg
|
||||
${FreeImage_INCLUDE_DIRS}
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
${GIT2_INCLUDE_PATH}
|
||||
${HarfBuzz_INCLUDE_DIRS}
|
||||
${ICU_INCLUDE_DIRS}
|
||||
${PUGIXML_INCLUDE_DIRS}
|
||||
${SDL2_INCLUDE_DIR})
|
||||
else()
|
||||
set(COMMON_INCLUDE_DIRS ${COMMON_INCLUDE_DIRS}
|
||||
${FFMPEG_INCLUDE_DIRS}
|
||||
|
@ -642,6 +658,23 @@ elseif(EMSCRIPTEN)
|
|||
${PROJECT_SOURCE_DIR}/libFreeImage.a
|
||||
${PROJECT_SOURCE_DIR}/libfreetype.a
|
||||
${PROJECT_SOURCE_DIR}/libpugixml.a)
|
||||
elseif(HAIKU)
|
||||
# This is just a temporary hack to get the application to build on Haiku r1beta4.
|
||||
set(COMMON_LIBRARIES /boot/system/lib/libavcodec.so.58
|
||||
/boot/system/lib/libavfilter.so.7
|
||||
/boot/system/lib/libavformat.so.58
|
||||
/boot/system/lib/libavutil.so.56
|
||||
/boot/system/lib/libswresample.so.3
|
||||
/boot/system/lib/libswscale.so.5
|
||||
/boot/system/lib/libcurl.so.4
|
||||
${Intl_LIBRARY}
|
||||
${FreeImage_LIBRARIES}
|
||||
${FREETYPE_LIBRARIES}
|
||||
${GIT2_LIBRARY}
|
||||
${HarfBuzz_LIBRARIES}
|
||||
${ICU_LIBRARIES}
|
||||
${PUGIXML_LIBRARIES}
|
||||
${SDL2_LIBRARY})
|
||||
else()
|
||||
set(COMMON_LIBRARIES ${CURL_LIBRARIES}
|
||||
${FFMPEG_LIBRARIES}
|
||||
|
@ -715,21 +748,29 @@ set(dir ${CMAKE_CURRENT_SOURCE_DIR})
|
|||
set(EXECUTABLE_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
|
||||
set(LIBRARY_OUTPUT_PATH ${dir} CACHE PATH "Build directory" FORCE)
|
||||
|
||||
if (COMPILE_LOCALIZATIONS)
|
||||
if(COMPILE_LOCALIZATIONS)
|
||||
add_subdirectory(locale)
|
||||
endif()
|
||||
|
||||
add_subdirectory(es-pdf-converter)
|
||||
if(NOT HAIKU)
|
||||
add_subdirectory(es-pdf-converter)
|
||||
endif()
|
||||
add_subdirectory(external)
|
||||
add_subdirectory(es-core)
|
||||
add_subdirectory(es-app)
|
||||
|
||||
# Make sure that es-pdf-convert is built first, and then that rlottie is built before es-core.
|
||||
# Also set lottie2gif to not be built.
|
||||
add_dependencies(lunasvg es-pdf-convert)
|
||||
if(NOT HAIKU)
|
||||
add_dependencies(lunasvg es-pdf-convert)
|
||||
endif()
|
||||
|
||||
if (COMPILE_LOCALIZATIONS)
|
||||
add_dependencies(es-pdf-convert localization)
|
||||
if(COMPILE_LOCALIZATIONS)
|
||||
if(NOT HAIKU)
|
||||
add_dependencies(es-pdf-convert localization)
|
||||
else()
|
||||
add_dependencies(lunasvg localization)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_dependencies(es-core rlottie)
|
||||
|
|
|
@ -273,7 +273,9 @@ elseif(APPLE)
|
|||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses DESTINATION ../Resources)
|
||||
elseif(NOT ANDROID)
|
||||
install(TARGETS es-de RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(TARGETS es-pdf-convert RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
if(NOT HAIKU)
|
||||
install(TARGETS es-pdf-convert RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
endif()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/es-de.6.gz
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man6)
|
||||
|
|
|
@ -62,6 +62,9 @@ void FindRules::loadFindRules()
|
|||
#elif defined(__APPLE__)
|
||||
filePath =
|
||||
ResourceManager::getInstance().getResourcePath(":/systems/macos/es_find_rules.xml", false);
|
||||
#elif defined(__HAIKU__)
|
||||
filePath =
|
||||
ResourceManager::getInstance().getResourcePath(":/systems/haiku/es_find_rules.xml", false);
|
||||
#else
|
||||
filePath =
|
||||
ResourceManager::getInstance().getResourcePath(":/systems/unix/es_find_rules.xml", false);
|
||||
|
@ -1006,6 +1009,8 @@ std::vector<std::string> SystemData::getConfigPath()
|
|||
path = ResourceManager::getInstance().getResourcePath(":/systems/windows/es_systems.xml", true);
|
||||
#elif defined(__APPLE__)
|
||||
path = ResourceManager::getInstance().getResourcePath(":/systems/macos/es_systems.xml", true);
|
||||
#elif defined(__HAIKU__)
|
||||
path = ResourceManager::getInstance().getResourcePath(":/systems/haiku/es_systems.xml", true);
|
||||
#else
|
||||
path = ResourceManager::getInstance().getResourcePath(":/systems/unix/es_systems.xml", true);
|
||||
#endif
|
||||
|
|
|
@ -1084,7 +1084,7 @@ void GuiMenu::openSoundOptions()
|
|||
auto s = new GuiSettings(_("SOUND SETTINGS"));
|
||||
|
||||
// TODO: Implement system volume support for macOS and Android.
|
||||
#if !defined(__APPLE__) && !defined(__ANDROID__) && !defined(__FreeBSD__)
|
||||
#if !defined(__APPLE__) && !defined(__ANDROID__) && !defined(__FreeBSD__) && !defined(__HAIKU__)
|
||||
// System volume.
|
||||
// The reason to create the VolumeControl object every time instead of making it a singleton
|
||||
// is that this is the easiest way to detect new default audio devices or changes to the
|
||||
|
@ -1597,7 +1597,7 @@ void GuiMenu::openOtherOptions()
|
|||
auto keyboardQuitShortcut = std::make_shared<OptionListComponent<std::string>>(
|
||||
getHelpStyle(), _("KEYBOARD QUIT SHORTCUT"), false);
|
||||
std::string selectedShortcut {Settings::getInstance()->getString("KeyboardQuitShortcut")};
|
||||
#if defined(_WIN64) || defined(__unix__)
|
||||
#if defined(_WIN64) || defined(__unix__) || defined(__HAIKU__)
|
||||
keyboardQuitShortcut->add("ALT + F4", "AltF4", selectedShortcut == "AltF4");
|
||||
keyboardQuitShortcut->add("CTRL + Q", "CtrlQ", selectedShortcut == "CtrlQ");
|
||||
keyboardQuitShortcut->add("ALT + Q", "AltQ", selectedShortcut == "AltQ");
|
||||
|
|
|
@ -605,6 +605,11 @@ bool VideoFFmpegComponent::setupAudioFilters()
|
|||
|
||||
std::string channelLayout(128, '\0');
|
||||
|
||||
#if defined(__HAIKU__)
|
||||
// This is just a temporary hack to get the application to build on Haiku r1beta4.
|
||||
av_get_channel_layout_string(&channelLayout[0], sizeof(channelLayout),
|
||||
mAudioCodecContext->CHANNELS, mAudioCodecContext->channel_layout);
|
||||
#else
|
||||
#if LIBAVUTIL_VERSION_MAJOR >= 58 || \
|
||||
(LIBAVUTIL_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MINOR >= 28)
|
||||
// FFmpeg 5.1 and above.
|
||||
|
@ -616,6 +621,7 @@ bool VideoFFmpegComponent::setupAudioFilters()
|
|||
av_get_channel_layout_string(&channelLayout[0], sizeof(channelLayout),
|
||||
mAudioCodecContext->CHANNELS, mAudioCodecContext->channel_layout);
|
||||
#endif
|
||||
#endif // __HAIKU__
|
||||
|
||||
std::string filterArguments;
|
||||
filterArguments.append("time_base=")
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
// Disable the CImg display capabilities.
|
||||
#define cimg_display 0
|
||||
|
||||
#if defined(__HAIKU__)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "CImg.h"
|
||||
|
||||
#include <vector>
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__HAIKU__)
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <array>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
@ -84,7 +88,7 @@ namespace Utils
|
|||
const std::string& startDirectory,
|
||||
bool runInBackground)
|
||||
{
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
#if defined(__unix__) || defined(__APPLE__) || defined(__HAIKU__)
|
||||
std::string command = std::string(cmd_utf8) + " 2>&1 &";
|
||||
|
||||
// Launching games while keeping ES-DE running in the background is very crude as for
|
||||
|
|
17
resources/systems/haiku/es_find_rules.xml
Normal file
17
resources/systems/haiku/es_find_rules.xml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This is the ES-DE find rules configuration file for Haiku -->
|
||||
<ruleList>
|
||||
<emulator name="OS-SHELL">
|
||||
<!-- Operating system shell -->
|
||||
<rule type="systempath">
|
||||
<entry>bash</entry>
|
||||
<entry>sh</entry>
|
||||
</rule>
|
||||
</emulator>
|
||||
<emulator name="DOSBOX">
|
||||
<!-- DOS emulator DOSBox -->
|
||||
<rule type="systempath">
|
||||
<entry>DOSBox</entry>
|
||||
</rule>
|
||||
</emulator>
|
||||
</ruleList>
|
13
resources/systems/haiku/es_systems.xml
Normal file
13
resources/systems/haiku/es_systems.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This is the ES-DE Frontend game systems configuration file for Haiku -->
|
||||
<systemList>
|
||||
<system>
|
||||
<name>dos</name>
|
||||
<fullname>DOS (PC)</fullname>
|
||||
<path>%ROMPATH%/dos</path>
|
||||
<extension>.bat .BAT .com .COM .conf .CONF .cue .CUE .dosz .DOSZ .exe .EXE .iso .ISO .7z .7Z .zip .ZIP</extension>
|
||||
<command label="DOSBox (Standalone)">%STARTDIR%=%GAMEDIR% %EMULATOR_DOSBOX% %ROM%</command>
|
||||
<platform>dos</platform>
|
||||
<theme>dos</theme>
|
||||
</system>
|
||||
</systemList>
|
Loading…
Reference in a new issue