Files
haikuports/games-action/minetest/patches/minetest-5.7.0-source3.patchset
2023-10-24 08:06:57 +02:00

94 lines
2.7 KiB
Plaintext

From 72b136fb0d644a39ed03ee9fb458ee7012ac9e03 Mon Sep 17 00:00:00 2001
From: Maite Gamper <victor@wenzeslaus.de>
Date: Thu, 19 Oct 2023 08:36:46 +0200
Subject: fix for haiku (copied from irrlicht recipe)
diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h
index 0d308e9..8c54d12 100644
--- a/include/IrrCompileConfig.h
+++ b/include/IrrCompileConfig.h
@@ -45,11 +45,19 @@
//! Example: NO_IRR_COMPILE_WITH_X11_ would disable X11
//! Uncomment this line to compile with the SDL device
-//#define _IRR_COMPILE_WITH_SDL_DEVICE_
+#define _IRR_COMPILE_WITH_SDL_DEVICE_
#ifdef NO_IRR_COMPILE_WITH_SDL_DEVICE_
#undef _IRR_COMPILE_WITH_SDL_DEVICE_
#endif
+#ifdef __HAIKU__
+#define _IRR_POSIX_API_
+#define _IRR_COMPILE_WITH_SDL_DEVICE_
+
+#define NO_IRR_COMPILE_WITH_X11_
+#define NO_IRR_COMPILE_WITH_X11_DEVICE_
+#endif
+
//! WIN32 for Windows32
//! WIN64 for Windows64
// The windows platform and API support SDL and WINDOW device
@@ -469,5 +477,16 @@ ones. */
#endif
#endif
+// haiku-specific options
+#ifdef __HAIKU__
+ #undef _IRR_COMPILE_WITH_X11_
+ #undef _IRR_COMPILE_WITH_X11_DEVICE_
+ #undef _IRR_USE_NON_SYSTEM_JPEG_LIB_
+ #undef _IRR_USE_NON_SYSTEM_LIB_PNG_
+ #undef _IRR_USE_NON_SYSTEM_ZLIB_
+
+ #define _IRR_COMPILE_WITH_SDL_DEVICE_
+#endif // __HAIKU__
+
#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__
diff --git a/source/Irrlicht/CFileSystem.cpp b/source/Irrlicht/CFileSystem.cpp
index 45e8680..021d171 100644
--- a/source/Irrlicht/CFileSystem.cpp
+++ b/source/Irrlicht/CFileSystem.cpp
@@ -799,7 +799,7 @@ IFileList* CFileSystem::createFileList()
size = buf.st_size;
isDirectory = S_ISDIR(buf.st_mode);
}
- #if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__)
+ #if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) && !defined(__HAIKU__)
// only available on some systems
else
{
diff --git a/source/Irrlicht/CFileSystem.h b/source/Irrlicht/CFileSystem.h
index bc04fd8..ef0f780 100644
--- a/source/Irrlicht/CFileSystem.h
+++ b/source/Irrlicht/CFileSystem.h
@@ -5,6 +5,8 @@
#ifndef __C_FILE_SYSTEM_H_INCLUDED__
#define __C_FILE_SYSTEM_H_INCLUDED__
+#include <unistd.h>
+
#include "IFileSystem.h"
#include "irrArray.h"
diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt
index 208b573..adc93bc 100644
--- a/source/Irrlicht/CMakeLists.txt
+++ b/source/Irrlicht/CMakeLists.txt
@@ -108,8 +108,10 @@ if(ANDROID)
elseif(APPLE)
find_library(COCOA_LIB Cocoa REQUIRED)
find_library(IOKIT_LIB IOKit REQUIRED)
-
+ add_definitions(-D_IRR_POSIX_API_)
add_definitions(-DGL_SILENCE_DEPRECATION)
+elseif(HAIKU)
+ add_definitions(-D_IRR_POSIX_API_)
else()
# Unix probably
find_package(X11 REQUIRED)
--
2.37.3