diff --git a/games-emulation/mame/additional-files/mame.sh b/games-emulation/mame/additional-files/mame.sh index f05897cfe..7c5ebc656 100755 --- a/games-emulation/mame/additional-files/mame.sh +++ b/games-emulation/mame/additional-files/mame.sh @@ -1,4 +1,8 @@ #!/bin/bash +if [ "$0" != "`realpath \"$0\"`" ]; then + open "`realpath \"$0\"`" "$@" + exit +fi mame=$(findpaths -r 'cmd:mame' B_FIND_PATH_BIN_DIRECTORY mame) userSettingsDir=$(finddir B_USER_SETTINGS_DIRECTORY) @@ -48,6 +52,7 @@ options and paths before running MAME again." -snapshot_directory "$(gen_mame_dirs snap)" \ -state_directory "$(gen_mame_dirs sta)" \ -video opengl \ + -window \ -createconfig } diff --git a/games-emulation/mame/mame-0.210.recipe b/games-emulation/mame/mame-0.221.recipe similarity index 91% rename from games-emulation/mame/mame-0.210.recipe rename to games-emulation/mame/mame-0.221.recipe index 746db0f3b..f73083fe5 100644 --- a/games-emulation/mame/mame-0.210.recipe +++ b/games-emulation/mame/mame-0.221.recipe @@ -11,11 +11,11 @@ sister-project MESS (Multi Emulator Super System), so MAME now documents a \ wide variety of (mostly vintage) computers, video game consoles and \ calculators, in addition to the arcade video games that were its initial focus." HOMEPAGE="https://www.mamedev.org/" -COPYRIGHT="1997-2019 MAMEDev and contributors" +COPYRIGHT="1997-2020 MAMEDev and contributors" LICENSE="GNU GPL v2" -REVISION="5" +REVISION="1" SOURCE_URI="https://github.com/mamedev/mame/archive/mame${portVersion/./}.tar.gz" -CHECKSUM_SHA256="4d0b23f3c9f9b2f6283ed78d5afc9a6391d2ee6ce5f0f4bcc2a357ec14aa06c4" +CHECKSUM_SHA256="8ead65f2585fc1330215e42db1d691f18497ff6d9e561d3cced54af599da4ac0" SOURCE_FILENAME="mame-$portVersion.tar.gz" SOURCE_DIR="mame-mame${portVersion/./}" PATCHES="mame-$portVersion.patchset" @@ -124,11 +124,7 @@ defineDebugInfoPackage mame$secondaryArchSuffix \ $commandBinDir/pngcmp \ $commandBinDir/regrep \ $commandBinDir/romcmp \ - $commandBinDir/split \ - $commandBinDir/src2html \ - $commandBinDir/srcclean \ - $commandBinDir/testkeys \ - $commandBinDir/unidasm + $commandBinDir/split BUILD() { @@ -174,15 +170,14 @@ INSTALL() # Install the binaries mkdir -p "$commandBinDir" for _i in castool chdman floptool imgtool jedutil ldresample ldverify \ - mame nltool nlwav pngcmp regrep romcmp split src2html srcclean \ - testkeys unidasm; do + mame nltool nlwav pngcmp regrep romcmp split; do install -m755 $_i -t "$commandBinDir" strip "$commandBinDir"/$_i done # Create the startscript - cp $portDir/additional-files/mame.sh "$commandBinDir"/mame.sh - chmod +x "$commandBinDir"/mame.sh + cp $portDir/additional-files/mame.sh "$commandBinDir"/MAME + chmod +x "$commandBinDir"/MAME # Add extra attributes to the binaries... local APP_SIGNATURE="application/x-vnd.mame" @@ -202,10 +197,10 @@ INSTALL() # ...and to our startscript, but we can't use addResourcesToBinaries here rc mame.rdef - resattr -o "$commandBinDir"/mame.sh mame.rsrc + resattr -o "$commandBinDir"/MAME mame.rsrc # Creating icon in Haiku's leaf-menu - addAppDeskbarSymlink "$commandBinDir"/mame.sh "MAME" + addAppDeskbarSymlink "$commandBinDir"/MAME # Install the extra bits install -Dm644 src/osd/modules/opengl/shader/glsl*.*h -t "$libDir/"/mame/shader/ diff --git a/games-emulation/mame/patches/mame-0.210.patchset b/games-emulation/mame/patches/mame-0.221.patchset similarity index 84% rename from games-emulation/mame/patches/mame-0.210.patchset rename to games-emulation/mame/patches/mame-0.221.patchset index 3ecda914c..60fd1004e 100644 --- a/games-emulation/mame/patches/mame-0.210.patchset +++ b/games-emulation/mame/patches/mame-0.221.patchset @@ -1,36 +1,11 @@ -From 10e90efe1df231765209973799a86338acc11d6d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Sun, 9 Jun 2019 18:07:46 +0200 -Subject: [PATCH] Haiku patches +From 7a53a630ae5505b90d6455ddfa593f3926461ca3 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Wed, 10 Jun 2020 22:35:16 +1000 +Subject: Haiku patches ---- - 3rdparty/asio/include/asio/detail/config.hpp | 4 + - .../3rdparty/dear-imgui/widgets/file_list.inl | 2 + - 3rdparty/bx/include/bx/platform.h | 10 +- - 3rdparty/bx/scripts/toolchain.lua | 1 + - 3rdparty/bx/src/file.cpp | 3 +- - 3rdparty/bx/src/mutex.cpp | 1 + - 3rdparty/bx/src/os.cpp | 5 + - 3rdparty/bx/src/thread.cpp | 1 + - 3rdparty/genie/build/gmake.haiku/Makefile | 34 ++ - 3rdparty/genie/build/gmake.haiku/genie.make | 488 ++++++++++++++++++ - 3rdparty/genie/makefile | 8 +- - 3rdparty/genie/scripts/genie.lua | 5 + - 3rdparty/genie/scripts/release.lua | 1 + - 3rdparty/genie/src/base/cmdline.lua | 1 + - 3rdparty/genie/src/base/os.lua | 3 + - 3rdparty/genie/src/host/premake.h | 3 + - makefile | 27 + - scripts/toolchain.lua | 9 + - src/osd/modules/file/posixfile.cpp | 4 +- - src/osd/modules/file/posixptty.cpp | 4 + - src/osd/modules/render/drawbgfx.cpp | 2 +- - 21 files changed, 610 insertions(+), 6 deletions(-) - create mode 100644 3rdparty/genie/build/gmake.haiku/Makefile - create mode 100644 3rdparty/genie/build/gmake.haiku/genie.make diff --git a/3rdparty/asio/include/asio/detail/config.hpp b/3rdparty/asio/include/asio/detail/config.hpp -index 64a80abd..93e53406 100644 +index 0c651be..aebab8c 100644 --- a/3rdparty/asio/include/asio/detail/config.hpp +++ b/3rdparty/asio/include/asio/detail/config.hpp @@ -1080,6 +1080,8 @@ @@ -52,7 +27,7 @@ index 64a80abd..93e53406 100644 # endif // defined(ASIO_HAS_THREADS) #endif // !defined(ASIO_HAS_PTHREADS) diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/file_list.inl b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/file_list.inl -index 75f1fc59..c44be054 100644 +index 75f1fc5..c44be05 100644 --- a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/file_list.inl +++ b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/file_list.inl @@ -32,6 +32,7 @@ namespace ImGui @@ -72,10 +47,10 @@ index 75f1fc59..c44be054 100644 } diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h -index e0031ec2..c6db687a 100644 +index d4445d3..80124be 100644 --- a/3rdparty/bx/include/bx/platform.h +++ b/3rdparty/bx/include/bx/platform.h -@@ -59,6 +59,7 @@ +@@ -61,6 +61,7 @@ #define BX_PLATFORM_WINDOWS 0 #define BX_PLATFORM_WINRT 0 #define BX_PLATFORM_XBOXONE 0 @@ -83,42 +58,23 @@ index e0031ec2..c6db687a 100644 // http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers #if defined(__clang__) -@@ -213,6 +214,9 @@ - #elif defined(__NX__) - # undef BX_PLATFORM_NX - # define BX_PLATFORM_NX 1 -+#elif defined(__HAIKU__) -+# undef BX_PLATFORM_HAIKU -+# define BX_PLATFORM_HAIKU 1 - #endif // - - #if !BX_CRT_NONE -@@ -229,7 +233,7 @@ - # elif defined(__MINGW32__) || defined(__MINGW64__) - # undef BX_CRT_MINGW - # define BX_CRT_MINGW 1 --# elif defined(__apple_build_version__) || defined(__ORBIS__) || defined(__EMSCRIPTEN__) || defined(__llvm__) -+# elif defined(__apple_build_version__) || defined(__ORBIS__) || defined(__EMSCRIPTEN__) || defined(__llvm__) || defined(__HAIKU__) - # undef BX_CRT_LIBCXX - # define BX_CRT_LIBCXX 1 - # endif // -@@ -258,6 +262,7 @@ +@@ -275,6 +276,7 @@ || BX_PLATFORM_PS4 \ || BX_PLATFORM_RPI \ || BX_PLATFORM_STEAMLINK \ + || BX_PLATFORM_HAIKU \ ) - #define BX_PLATFORM_NONE !(0 \ -@@ -275,6 +280,7 @@ + /// +@@ -294,6 +296,7 @@ || BX_PLATFORM_WINDOWS \ || BX_PLATFORM_WINRT \ || BX_PLATFORM_XBOXONE \ + || BX_PLATFORM_HAIKU \ ) - #if BX_COMPILER_GCC -@@ -339,6 +345,8 @@ + /// +@@ -398,6 +401,8 @@ # define BX_PLATFORM_NAME "WinRT" #elif BX_PLATFORM_XBOXONE # define BX_PLATFORM_NAME "Xbox One" @@ -127,25 +83,13 @@ index e0031ec2..c6db687a 100644 #else # error "Unknown BX_PLATFORM!" #endif // BX_PLATFORM_ -diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua -index 03f97089..45c457c1 100644 ---- a/3rdparty/bx/scripts/toolchain.lua -+++ b/3rdparty/bx/scripts/toolchain.lua -@@ -73,6 +73,7 @@ function toolchain(_buildDir, _libDir) - { "orbis", "Orbis" }, - { "riscv", "RISC-V" }, - { "rpi", "RaspberryPi" }, -+ { "haiku", "Haiku" }, - }, - } - diff --git a/3rdparty/bx/src/file.cpp b/3rdparty/bx/src/file.cpp -index 8a282cab..d287f067 100644 +index aea285e..c158af0 100644 --- a/3rdparty/bx/src/file.cpp +++ b/3rdparty/bx/src/file.cpp -@@ -65,7 +65,8 @@ namespace bx - || BX_PLATFORM_ANDROID \ +@@ -76,7 +76,8 @@ namespace bx || BX_PLATFORM_BSD \ + || BX_PLATFORM_HAIKU \ || BX_PLATFORM_IOS \ - || BX_PLATFORM_OSX + || BX_PLATFORM_OSX \ @@ -154,10 +98,10 @@ index 8a282cab..d287f067 100644 # define ftello64 ftello # elif BX_PLATFORM_PS4 diff --git a/3rdparty/bx/src/mutex.cpp b/3rdparty/bx/src/mutex.cpp -index 27c6b63b..63b900b5 100644 +index 2fe5eaf..c9ce444 100644 --- a/3rdparty/bx/src/mutex.cpp +++ b/3rdparty/bx/src/mutex.cpp -@@ -16,6 +16,7 @@ +@@ -18,6 +18,7 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ || BX_PLATFORM_PS4 \ @@ -165,44 +109,11 @@ index 27c6b63b..63b900b5 100644 || BX_PLATFORM_RPI # include #elif BX_PLATFORM_WINDOWS \ -diff --git a/3rdparty/bx/src/os.cpp b/3rdparty/bx/src/os.cpp -index 0e925bb2..ffbe402e 100644 ---- a/3rdparty/bx/src/os.cpp -+++ b/3rdparty/bx/src/os.cpp -@@ -27,12 +27,14 @@ - || BX_PLATFORM_PS4 \ - || BX_PLATFORM_RPI \ - || BX_PLATFORM_STEAMLINK \ -+ || BX_PLATFORM_HAIKU \ - || BX_PLATFORM_NX - # include // sched_yield - # if BX_PLATFORM_BSD \ - || BX_PLATFORM_IOS \ - || BX_PLATFORM_OSX \ - || BX_PLATFORM_PS4 \ -+ || BX_PLATFORM_HAIKU \ - || BX_PLATFORM_STEAMLINK - # include // mach_port_t - # endif // BX_PLATFORM_* -@@ -46,10 +48,13 @@ - # include // mallinfo - # elif BX_PLATFORM_LINUX \ - || BX_PLATFORM_RPI \ -+ || BX_PLATFORM_HAIKU \ - || BX_PLATFORM_STEAMLINK - # include // fopen - # include // syscall -+#ifndef __HAIKU__ - # include -+#endif - # elif BX_PLATFORM_OSX - # include // mach_task_basic_info - # elif BX_PLATFORM_HURD diff --git a/3rdparty/bx/src/thread.cpp b/3rdparty/bx/src/thread.cpp -index f52e0bdc..ef3ca5bb 100644 +index 9525105..cebcb82 100644 --- a/3rdparty/bx/src/thread.cpp +++ b/3rdparty/bx/src/thread.cpp -@@ -15,6 +15,7 @@ +@@ -21,6 +21,7 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_OSX \ || BX_PLATFORM_PS4 \ @@ -212,7 +123,7 @@ index f52e0bdc..ef3ca5bb 100644 # if defined(__FreeBSD__) diff --git a/3rdparty/genie/build/gmake.haiku/Makefile b/3rdparty/genie/build/gmake.haiku/Makefile new file mode 100644 -index 00000000..be9880cf +index 0000000..be9880c --- /dev/null +++ b/3rdparty/genie/build/gmake.haiku/Makefile @@ -0,0 +1,34 @@ @@ -252,7 +163,7 @@ index 00000000..be9880cf + @echo "For more information, see https://github.com/bkaradzic/genie" diff --git a/3rdparty/genie/build/gmake.haiku/genie.make b/3rdparty/genie/build/gmake.haiku/genie.make new file mode 100644 -index 00000000..73f650c7 +index 0000000..73f650c --- /dev/null +++ b/3rdparty/genie/build/gmake.haiku/genie.make @@ -0,0 +1,488 @@ @@ -745,7 +656,7 @@ index 00000000..73f650c7 + -include $(OBJDIR)/$(notdir $(PCH))_objc.d +endif diff --git a/3rdparty/genie/makefile b/3rdparty/genie/makefile -index 1653c27b..e4f22adc 100644 +index 48f6fb8..b844440 100644 --- a/3rdparty/genie/makefile +++ b/3rdparty/genie/makefile @@ -4,7 +4,7 @@ @@ -772,29 +683,34 @@ index 1653c27b..e4f22adc 100644 else OS=windows endif -@@ -42,6 +46,7 @@ projgen: - $(SILENT) $(GENIE) --to=../build/gmake.linux --os=linux gmake - $(SILENT) $(GENIE) --to=../build/gmake.darwin --os=macosx --platform=universal32 gmake - $(SILENT) $(GENIE) --to=../build/gmake.freebsd --os=bsd gmake -+ $(SILENT) $(GENIE) --to=../build/gmake.haiku --os=haiku gmake +@@ -43,6 +47,7 @@ projgen: + $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).linux --os=linux $(PROJECT_TYPE) + $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).darwin --os=macosx --platform=universal32 $(PROJECT_TYPE) + $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).freebsd --os=bsd $(PROJECT_TYPE) ++ $(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).haiku --os=haiku $(PROJECT_TYPE) rebuild: - $(SILENT) $(MAKE) -C build/gmake.$(OS) clean all + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean all @@ -56,6 +61,7 @@ release-linux: $(GENIE) - $(SILENT) $(MAKE) -C build/gmake.darwin clean all CC=x86_64-apple-darwin15-clang - $(SILENT) $(MAKE) -C build/gmake.linux clean all - $(SILENT) $(MAKE) -C build/gmake.windows clean all CC=i686-w64-mingw32-gcc -+ $(SILENT) $(MAKE) -C build/gmake.haiku clean all + $(SILENT) $(GENIE) release + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin15-clang + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).linux clean all ++ $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).haiku clean all + $(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).windows clean all CC=x86_64-w64-mingw32-gcc $(SILENT) git checkout src/host/version.h - release: release-$(OS) +@@ -65,3 +71,4 @@ dist: release + cp bin/linux/genie ../bx/tools/bin/linux/ + cp bin/windows/genie.exe ../bx/tools/bin/windows/ + cp bin/darwin/genie ../bx/tools/bin/darwin/ ++ cp bin/haiku/genie ../bx/tools/bin/haiku/ diff --git a/3rdparty/genie/scripts/genie.lua b/3rdparty/genie/scripts/genie.lua -index 144b5cf3..54c42a58 100644 +index 7e64ad9..fefb444 100644 --- a/3rdparty/genie/scripts/genie.lua +++ b/3rdparty/genie/scripts/genie.lua -@@ -86,6 +86,11 @@ - buildoptions { "-mmacosx-version-min=10.4" } - linkoptions { "-mmacosx-version-min=10.4" } +@@ -88,6 +88,11 @@ + + configuration {} + configuration "haiku" + targetdir "../bin/haiku" @@ -805,7 +721,7 @@ index 144b5cf3..54c42a58 100644 -- -- A more thorough cleanup. diff --git a/3rdparty/genie/scripts/release.lua b/3rdparty/genie/scripts/release.lua -index f3200916..15aa0738 100644 +index d1173d5..39bcaa5 100644 --- a/3rdparty/genie/scripts/release.lua +++ b/3rdparty/genie/scripts/release.lua @@ -40,6 +40,7 @@ function dorelease() @@ -817,7 +733,7 @@ index f3200916..15aa0738 100644 print("") print( "Finished.") diff --git a/3rdparty/genie/src/base/cmdline.lua b/3rdparty/genie/src/base/cmdline.lua -index c3357b70..dcdc6373 100644 +index c3357b7..dcdc637 100644 --- a/3rdparty/genie/src/base/cmdline.lua +++ b/3rdparty/genie/src/base/cmdline.lua @@ -57,6 +57,7 @@ @@ -829,7 +745,7 @@ index c3357b70..dcdc6373 100644 } diff --git a/3rdparty/genie/src/base/os.lua b/3rdparty/genie/src/base/os.lua -index 7d9351ea..11fc5818 100644 +index ae88c0a..b2c1cfa 100644 --- a/3rdparty/genie/src/base/os.lua +++ b/3rdparty/genie/src/base/os.lua @@ -66,6 +66,9 @@ @@ -843,7 +759,7 @@ index 7d9351ea..11fc5818 100644 formats = { "lib%s.so", "%s.so" } path = os.getenv("LD_LIBRARY_PATH") or "" diff --git a/3rdparty/genie/src/host/premake.h b/3rdparty/genie/src/host/premake.h -index f0782db4..5a3a636f 100644 +index f0782db..5a3a636 100644 --- a/3rdparty/genie/src/host/premake.h +++ b/3rdparty/genie/src/host/premake.h @@ -27,6 +27,9 @@ @@ -857,10 +773,10 @@ index f0782db4..5a3a636f 100644 #define PLATFORM_WINDOWS (1) #define PLATFORM_STRING "windows" diff --git a/makefile b/makefile -index 29935190..740b3d53 100644 +index 2a4c4a1..46d87b5 100644 --- a/makefile +++ b/makefile -@@ -215,6 +215,7 @@ GENIEOS := darwin +@@ -216,6 +216,7 @@ GENIEOS := darwin endif ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku) OS := haiku @@ -868,7 +784,7 @@ index 29935190..740b3d53 100644 endif ifndef OS $(error Unable to detect OS from uname -a: $(UNAME)) -@@ -445,6 +446,10 @@ endif +@@ -461,6 +462,10 @@ endif ifeq ($(TARGETOS),asmjs) OSD := sdl endif @@ -879,7 +795,7 @@ index 29935190..740b3d53 100644 endif #------------------------------------------------- -@@ -1552,6 +1557,28 @@ endif +@@ -1628,6 +1633,28 @@ endif $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG) precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG) @@ -909,7 +825,7 @@ index 29935190..740b3d53 100644 # cmake #------------------------------------------------- diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua -index e596c06b..483c2832 100644 +index 3eb2acf..7c919c9 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -41,6 +41,7 @@ newoption { @@ -920,7 +836,7 @@ index e596c06b..483c2832 100644 }, } -@@ -252,6 +253,10 @@ function toolchain(_buildDir, _subDir) +@@ -253,6 +254,10 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ci20") end @@ -931,7 +847,7 @@ index e596c06b..483c2832 100644 if "mingw32-gcc" == _OPTIONS["gcc"] then if not os.getenv("MINGW32") then print("Set MINGW32 envrionment variable.") -@@ -342,6 +347,10 @@ function toolchain(_buildDir, _subDir) +@@ -329,6 +334,10 @@ function toolchain(_buildDir, _subDir) if "ci20" == _OPTIONS["gcc"] then location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ci20") end @@ -943,15 +859,15 @@ index e596c06b..483c2832 100644 if (_ACTION .. "-clang") == _OPTIONS["vs"] then diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp -index 832b6810..5e124096 100644 +index 4f56a84..6b0c3a0 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -93,7 +93,7 @@ public: { ssize_t result; --#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(__ANDROID__) -+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(__ANDROID__) || defined(__HAIKU__) +-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) ++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) || defined(__HAIKU__) result = ::pread(m_fd, buffer, size_t(count), off_t(std::make_unsigned_t(offset))); #elif defined(WIN32) || defined(SDLMAME_NO64BITIO) if (lseek(m_fd, off_t(std::make_unsigned_t(offset)), SEEK_SET) < 0) @@ -959,18 +875,18 @@ index 832b6810..5e124096 100644 { ssize_t result; --#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(__ANDROID__) -+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(EMSCRIPTEN) || defined(__ANDROID__) || defined(__HAIKU__) +-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) ++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) || defined(__HAIKU__) result = ::pwrite(m_fd, buffer, size_t(count), off_t(std::make_unsigned_t(offset))); #elif defined(WIN32) || defined(SDLMAME_NO64BITIO) if (lseek(m_fd, off_t(std::make_unsigned_t(offset)), SEEK_SET) < 0) diff --git a/src/osd/modules/file/posixptty.cpp b/src/osd/modules/file/posixptty.cpp -index 4a4bc9d8..64c3b4c6 100644 +index 5b38acc..89442f6 100644 --- a/src/osd/modules/file/posixptty.cpp +++ b/src/osd/modules/file/posixptty.cpp @@ -19,6 +19,10 @@ #include - #include + #include +#ifdef __HAIKU__ +#define _BSD_SOURCE @@ -980,10 +896,10 @@ index 4a4bc9d8..64c3b4c6 100644 #include #include diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp -index 0c483d9e..e2c58920 100644 +index e9ca64e..b1b1cf5 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp -@@ -161,7 +161,7 @@ static void* sdlNativeWindowHandle(SDL_Window* _window) +@@ -176,7 +176,7 @@ static void* sdlNativeWindowHandle(SDL_Window* _window) return wmi.info.win.window; # elif BX_PLATFORM_STEAMLINK return wmi.info.vivante.window; @@ -993,5 +909,69 @@ index 0c483d9e..e2c58920 100644 # endif // BX_PLATFORM_ } -- -2.21.0 +2.26.0 + + +From 98d0df9123729b1f5b0a0e9a7cee6136c52ac522 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 11 Jun 2020 08:59:34 +1000 +Subject: Use stat Haiku + + +diff --git a/3rdparty/bx/src/file.cpp b/3rdparty/bx/src/file.cpp +index c158af0..2d6aa3e 100644 +--- a/3rdparty/bx/src/file.cpp ++++ b/3rdparty/bx/src/file.cpp +@@ -650,7 +650,14 @@ namespace bx + break; + } + ++#ifdef __HAIKU__ ++ struct stat sp; ++ stat(item->d_name, &sp); ++ ++ if (S_ISDIR(sp.st_mode)) ++#else + if (0 != (item->d_type & DT_DIR) ) ++#endif + { + _out.type = FileType::Dir; + _out.size = UINT64_MAX; +@@ -658,7 +665,11 @@ namespace bx + return true; + } + ++#ifdef __HAIKU__ ++ if (S_ISREG(sp.st_mode)) ++#else + if (0 != (item->d_type & DT_REG) ) ++#endif + { + _out.type = FileType::File; + _out.size = UINT64_MAX; +-- +2.26.0 + + +From 614ce521d7ba9b4ef512653b478d1930e70f199d Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Thu, 11 Jun 2020 09:00:11 +1000 +Subject: Disable ptty + + +diff --git a/src/osd/modules/file/posixptty.cpp b/src/osd/modules/file/posixptty.cpp +index 89442f6..f012e7b 100644 +--- a/src/osd/modules/file/posixptty.cpp ++++ b/src/osd/modules/file/posixptty.cpp +@@ -113,7 +113,7 @@ bool posix_check_ptty_path(std::string const &path) + + osd_file::error posix_open_ptty(std::uint32_t openflags, osd_file::ptr &file, std::uint64_t &filesize, std::string &name) + { +-#if defined(__ANDROID__) ++#if defined(__ANDROID__) || defined(__HAIKU__) + return osd_file::error::FAILURE; + #else // defined(__ANDROID__) + #if (defined(sun) || defined(__sun)) && (defined(__SVR4) || defined(__svr4__)) +-- +2.26.0