minetest: bump version (#9668)

This commit is contained in:
TheZeldakatze
2023-10-24 08:06:57 +02:00
committed by GitHub
parent e8b9588530
commit fdadbbac96
5 changed files with 328 additions and 140 deletions

View File

@@ -1,19 +1,23 @@
SUMMARY="An InfiniMiner/Minecraft inspired game"
DESCRIPTION="Minetest, an open source infinite-world block sandbox game engine with support for survival and crafting."
HOMEPAGE="https://www.minetest.net/"
COPYRIGHT="2021 The Minetest Team"
COPYRIGHT="2023 The Minetest Team"
LICENSE="GNU LGPL v2.1
Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/minetest/minetest/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="de9e4410583c845c104b4be25f9d0b8743d8573c120149b8910ae2519f9ab14e"
CHECKSUM_SHA256="0cd0fd48a97f76e337a2e1284599a054f8f92906a84a4ef2122ed321e1b75fa7"
SOURCE_FILENAME="minetest-$portVersion.tar.gz"
SOURCE_DIR="minetest-$portVersion"
SOURCE_URI_2="https://github.com/minetest/minetest_game/archive/$portVersion.tar.gz"
CHECKSUM_SHA256_2="b4bfa0755b88230cf4bdb6af6a0951dd1248f6cdf87fecc340e43ac12c80b0b2"
CHECKSUM_SHA256_2="0787b24cf7b340a8a2be873ca3744cec60c2683011f1d658350a031d1bd5976d"
SOURCE_FILENAME_2="minetest_game-$portVersion.tar.gz"
SOURCE_DIR_2="minetest_game-$portVersion"
SOURCE_URI_3="https://github.com/minetest/irrlicht/archive/refs/tags/1.9.0mt10.tar.gz"
CHECKSUM_SHA256_3="6d00348d8ff513f6a7cee5c930908ef67428ff637e6a9e4d5688409bdb6d547d"
SOURCE_DIR_3="irrlicht-1.9.0mt10"
PATCHES="minetest-$portVersion.patchset"
PATCHES_3="minetest-$portVersion-source3.patchset"
ADDITIONAL_FILES="minetest.rdef.in"
ARCHITECTURES="all !x86_gcc2"
@@ -29,10 +33,10 @@ REQUIRES="
lib:libcurl$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libGLU$secondaryArchSuffix
lib:libgmp$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libIrrlicht$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libjsoncpp$secondaryArchSuffix
lib:libluajit_5.1$secondaryArchSuffix
@@ -40,9 +44,11 @@ REQUIRES="
lib:libogg$secondaryArchSuffix
lib:libopenal$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libvorbis$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libzstd$secondaryArchSuffix
"
BUILD_REQUIRES="
@@ -51,10 +57,10 @@ BUILD_REQUIRES="
devel:libcurl$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libGL$secondaryArchSuffix
devel:libGLU$secondaryArchSuffix
devel:libgmp$secondaryArchSuffix
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libIrrlicht$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libjsoncpp$secondaryArchSuffix
devel:libluajit_5.1$secondaryArchSuffix
@@ -62,9 +68,11 @@ BUILD_REQUIRES="
devel:libogg$secondaryArchSuffix
devel:libopenal$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libSDL2_2.0$secondaryArchSuffix
devel:libsqlite3$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:libzstd$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
@@ -77,10 +85,12 @@ BUILD_PREREQUIRES="
BUILD()
{
rm -rf $sourceDir/games/minetest_game
rm -rf $sourceDir/lib/irrlichtmt
cp -rf $sourceDir2 $sourceDir/games/minetest_game
ln -sf $sourceDir3 $sourceDir/lib/irrlichtmt
echo $includeDir
cmake . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
-DCUSTOM_BINDIR="$appsDir/Minetest" \
-DCUSTOM_DOCDIR="$docDir" \
-DCUSTOM_MANDIR="$docDir" \
@@ -100,7 +110,14 @@ BUILD()
-DENABLE_REDIS=OFF \
-DENABLE_SPATIAL=OFF \
-DENABLE_SOUND=ON \
-DENABLE_SYSTEM_JSONCPP=ON
-DENABLE_SYSTEM_JSONCPP=ON \
-DUSE_SDL2=true \
-D_IRR_COMPILE_WITH_SDL_DEVICE_=1 \
-DNO_IRR_COMPILE_WITH_X11_=1 \
-DNO_IRR_COMPILE_WITH_X11_DEVICE_=1 \
-DNO_IRR_COMPILE_WITH_OPENGL_=1 \
-DNO_IRR_COMPILE_WITH_OGLES1_=1 \
-D_IRR_POSIX_API_=1
make $jobArgs
}

View File

@@ -0,0 +1,56 @@
From 78336f3a3c4c820eed445176c6f504f35ae7ad70 Mon Sep 17 00:00:00 2001
From: Maite Gamper <victor@wenzeslaus.de>
Date: Thu, 19 Oct 2023 05:55:57 +0200
Subject: fix for haiku (copied from irrlicht recipe)
diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h
index 30ce67e..0e2d471 100644
--- a/include/IrrCompileConfig.h
+++ b/include/IrrCompileConfig.h
@@ -30,4 +30,15 @@
#define IRRLICHT_API
#endif
+// haiku-specific options
+#ifdef __HAIKU__
+ #define _IRR_COMPILE_WITH_SDL_DEVICE_
+
+ #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_
+#endif
+
#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__
diff --git a/source/Irrlicht/CFileSystem.h b/source/Irrlicht/CFileSystem.h
index bb87d37..ba720d0 100644
--- a/source/Irrlicht/CFileSystem.h
+++ b/source/Irrlicht/CFileSystem.h
@@ -4,6 +4,8 @@
#pragma once
+#include <unistd.h>
+
#include "IFileSystem.h"
#include "irrArray.h"
diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt
index 62115c6..e53644f 100644
--- a/source/Irrlicht/CMakeLists.txt
+++ b/source/Irrlicht/CMakeLists.txt
@@ -99,6 +99,9 @@ elseif(EMSCRIPTEN)
elseif(SOLARIS)
add_definitions(-D_IRR_SOLARIS_PLATFORM_ -D_IRR_POSIX_API_)
set(DEVICE "X11")
+elseif(HAIKU)
+ add_definitions(-D_IRR_POSIX_API_)
+ set(DEVICE "SDL")
else()
add_definitions(-D_IRR_POSIX_API_)
set(LINUX_PLATFORM TRUE)
--
2.37.3

View File

@@ -1,132 +0,0 @@
From 0923ec70cbaed6b87069bbccef77c9d142f34481 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 28 Feb 2021 17:54:22 +1000
Subject: Add haiku support
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6a0d22..3b71804 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -184,7 +184,7 @@ install(FILES "doc/texture_packs.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT HAIKU)
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}")
diff --git a/cmake/Modules/FindIrrlicht.cmake b/cmake/Modules/FindIrrlicht.cmake
index 6f361e8..15d6f87 100644
--- a/cmake/Modules/FindIrrlicht.cmake
+++ b/cmake/Modules/FindIrrlicht.cmake
@@ -42,6 +42,7 @@ else()
PATHS
/usr/local/include/irrlicht
/usr/include/irrlicht
+ /system/develop/headers/x86/irrlicht #Haiku hybrid
/system/develop/headers/irrlicht #Haiku
PATH_SUFFIXES "include/irrlicht"
)
@@ -50,6 +51,7 @@ else()
PATHS
/usr/local/lib
/usr/lib
+ /system/develop/lib/x86 #Haiku hybrid
/system/develop/lib # Haiku
)
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7bcf8d6..2b2db7d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -312,7 +312,11 @@ else()
endif(BUILD_CLIENT)
find_package(ZLIB REQUIRED)
- set(PLATFORM_LIBS -lpthread ${CMAKE_DL_LIBS})
+ if(HAIKU)
+ set(PLATFORM_LIBS ${PLATFORM_LIBS} -lintl -lnetwork -lbe)
+ else()
+ set(PLATFORM_LIBS -lpthread ${CMAKE_DL_LIBS})
+ endif(HAIKU)
if(APPLE)
set(PLATFORM_LIBS "-framework CoreFoundation" ${PLATFORM_LIBS})
else()
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index cda9530..eaf7c1e 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -456,6 +456,11 @@ void set_default_settings()
settings->setDefault("fps_max", "0");
#endif
+#ifdef __HAIKU__
+ settings->setDefault("enable_shaders", "false");
+ settings->setDefault("video_driver", "burningsvideo");
+#endif
+
// Altered settings for Android
#ifdef __ANDROID__
settings->setDefault("screen_w", "0");
diff --git a/src/porting.cpp b/src/porting.cpp
index 4c87bdd..334d4d3 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -60,6 +60,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <FindDirectory.h>
#endif
+#if defined(__HAIKU__)
+#include <Application.h>
+#include <FindDirectory.h>
+#include <Path.h>
+#include <Roster.h>
+#include <OS.h>
+#endif
+
#include "config.h"
#include "debug.h"
#include "filesys.h"
@@ -248,7 +256,16 @@ bool getCurrentWorkingDir(char *buf, size_t len)
bool getExecPathFromProcfs(char *buf, size_t buflen)
{
-#ifndef _WIN32
+#if defined(__HAIKU__)
+ app_info appInfo;
+ if (be_app->GetAppInfo(&appInfo) == B_OK) {
+ BPath path(&appInfo.ref);
+ sprintf(buf, path.Path());
+ } else {
+ sprintf(buf, "/system/apps/Minetest/Minetest");
+ }
+ return true;
+#elif defined(_WIN32)
buflen--;
ssize_t len;
@@ -506,6 +523,19 @@ bool setSystemPaths()
return true;
}
+//// Haiku
+#elif defined(__HAIKU__)
+
+bool setSystemPaths()
+{
+ path_share = STATIC_SHAREDIR;
+ static char dir[PATH_MAX] = "";
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) != B_OK)
+ sprintf(dir, "/boot/home/config/settings");
+ dir[sizeof(dir) - 1] = 0;
+ path_user = std::string(dir) + "/" + lowercase(PROJECT_NAME);
+ return true;
+}
#else
--
2.30.0

View File

@@ -0,0 +1,93 @@
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

View File

@@ -0,0 +1,154 @@
From e79490d2547d34aaa3f677640bf1230cf814ad79 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 28 Feb 2021 17:54:22 +1000
Subject: Add haiku support
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 539169b..48002da 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,7 +274,7 @@ install(FILES "doc/texture_packs.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT HAIKU)
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}")
diff --git a/cmake/Modules/MinetestFindIrrlichtHeaders.cmake b/cmake/Modules/MinetestFindIrrlichtHeaders.cmake
index e434b58..e697f51 100644
--- a/cmake/Modules/MinetestFindIrrlichtHeaders.cmake
+++ b/cmake/Modules/MinetestFindIrrlichtHeaders.cmake
@@ -5,6 +5,7 @@ find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
PATHS
/usr/local/include/irrlichtmt
/usr/include/irrlichtmt
+ /system/develop/headers/x86/irrlichtmt #Haiku hybrid
/system/develop/headers/irrlichtmt #Haiku
PATH_SUFFIXES "include/irrlichtmt"
)
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 29449d9..c639bf6 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -207,11 +207,15 @@ void set_default_settings()
settings->setDefault("lighting_boost_spread", "0.2");
settings->setDefault("texture_path", "");
settings->setDefault("shader_path", "");
+#ifdef __HAIKU__
+ settings->setDefault("video_driver", "ogles2");
+#else
#if ENABLE_GLES
settings->setDefault("video_driver", "ogles2");
#else
settings->setDefault("video_driver", "opengl");
#endif
+#endif // __HAIKU__
settings->setDefault("cinematic", "false");
settings->setDefault("camera_smoothing", "0");
settings->setDefault("cinematic_camera_smoothing", "0.7");
@@ -246,7 +250,11 @@ void set_default_settings()
settings->setDefault("texture_clean_transparent", "false");
settings->setDefault("texture_min_size", "64");
settings->setDefault("ambient_occlusion_gamma", "1.8");
+#ifdef __HAIKU__
+ settings->setDefault("enable_shaders", "false");
+#else
settings->setDefault("enable_shaders", "true");
+#endif
settings->setDefault("enable_particles", "true");
settings->setDefault("arm_inertia", "true");
settings->setDefault("show_nametag_backgrounds", "true");
--
2.37.3
From cdf3859e16ba20feabfcce2612d0a8031a5a39b3 Mon Sep 17 00:00:00 2001
From: Maite Gamper <victor@wenzeslaus.de>
Date: Tue, 10 Oct 2023 07:17:36 +0200
Subject: fix 3dEye's patch
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index afe0083..8f5d50e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -252,9 +252,13 @@ endif()
# Use cmake_config.h
add_definitions(-DUSE_CMAKE_CONFIG_H)
-set(THREADS_PREFER_PTHREAD_FLAG ON)
-find_package(Threads REQUIRED)
-set(PLATFORM_LIBS Threads::Threads)
+if(HAIKU)
+ set(PLATFORM_LIBS ${PLATFORM_LIBS} intl be)
+else()
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+ set(PLATFORM_LIBS Threads::Threads)
+endif(HAIKU)
if(WIN32)
# Windows
diff --git a/src/porting.cpp b/src/porting.cpp
index 629f00c..c3076b4 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -61,6 +61,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <FindDirectory.h>
#endif
+#if defined(__HAIKU__)
+#include <Application.h>
+#include <FindDirectory.h>
+#include <Path.h>
+#include <Roster.h>
+#include <OS.h>
+#endif
+
#include "config.h"
#include "debug.h"
#include "filesys.h"
@@ -258,7 +266,16 @@ bool getCurrentWorkingDir(char *buf, size_t len)
bool getExecPathFromProcfs(char *buf, size_t buflen)
{
-#ifndef _WIN32
+#if defined(__HAIKU__)
+ app_info appInfo;
+ if (be_app->GetAppInfo(&appInfo) == B_OK) {
+ BPath path(&appInfo.ref);
+ sprintf(buf, path.Path());
+ } else {
+ sprintf(buf, "/system/apps/Minetest/Minetest");
+ }
+ return true;
+#elif defined(_WIN32)
buflen--;
ssize_t len;
@@ -533,6 +550,19 @@ bool setSystemPaths()
return true;
}
+//// Haiku
+#elif defined(__HAIKU__)
+
+bool setSystemPaths()
+{
+ path_share = STATIC_SHAREDIR;
+ static char dir[PATH_MAX] = "";
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) != B_OK)
+ sprintf(dir, "/boot/home/config/settings");
+ dir[sizeof(dir) - 1] = 0;
+ path_user = std::string(dir) + "/" + lowercase(PROJECT_NAME);
+ return true;
+}
#else
--
2.37.3