update to fs2open 21.4.1

update requested, tested, and ok by rsadowski@
rsadowski@ helped with WANTLIB update, cmake options, and vulkan-hpp patch
also tested by me briefly including in-game gameplay without issues.

note on my testing OpenGL backend is still the default on amd64 with intel
GPU. I can't find documentation on a switch to enable Vulkan backend yet.

Best place to view changelogs is the Hard Light fs2open forums:
https://www.hard-light.net/forums/index.php?board=50.0

Upstream isn't packaging source tarballs anymore, so now using GH with
the cmake module and librocket pulled in additionally similar to what
emulators/ppsspp and other ports do.
This commit is contained in:
thfr 2021-12-18 05:10:57 +00:00
parent 5e3ad6def1
commit 32ad89751c
21 changed files with 123 additions and 330 deletions

View File

@ -1,31 +1,40 @@
# $OpenBSD: Makefile,v 1.11 2021/02/25 22:26:02 sthen Exp $
# $OpenBSD: Makefile,v 1.12 2021/12/18 05:10:57 thfr Exp $
# Requires OpenGL>=3.2, could run on powerpc64 once there is drm support
ONLY_FOR_ARCHS = aarch64 amd64 i386
COMMENT = open source game engine based on FreeSpace 2
V = 19.0.0
DISTNAME = fs2_open_${V:S/./_/g}-source-Unix
PKGNAME = fs2open-${V}
REVISION = 0
V = 21.4.1
DISTNAME = fs2open-${V}
GH_ACCOUNT = scp-fs2open
GH_PROJECT = fs2open.github.com
GH_TAGNAME = release_${V:S/./_/g}
CATEGORIES = games
HOMEPAGE = https://github.com/scp-fs2open/fs2open.github.com
MAINTAINER = Thomas Frohwein <thfr@openbsd.org>
# Volition custom license (non-commercial, not really a license)
PERMIT_PACKAGE = no license at all
PERMIT_DISTFILES = no license at all
WANTLIB += ${COMPILER_LIBCXX} c m z
WANTLIB += SDL2 ${MODLUA_WANTLIB} openal
WANTLIB += avcodec avformat avutil freetype jpeg swresample swscale
WANTLIB += jansson png
# if running with vulkan backend, dlopen's vulkan in vulkan.hpp
WANTLIB += ${COMPILER_LIBCXX} SDL2 avcodec avformat avutil c freetype
WANTLIB += jansson jpeg ${MODLUA_WANTLIB} m openal png swresample swscale
WANTLIB += vulkan z
MASTER_SITES = https://github.com/scp-fs2open/fs2open.github.com/releases/download/release_${V:S/./_/g}/
RPAVLIK_CMAKE_MOD = 7cef9577d6fc35057ea57f46b4986a8a28aeff50
LIBROCKET = ecd648a43aff8a9f3daf064d75ca5725237d5b38
MASTER_SITES0 = https://github.com/asarium/cmake-modules/archive/
MASTER_SITES1 = https://github.com/asarium/libRocket/archive/
DISTFILES = ${DISTNAME}${EXTRACT_SUFX} \
${RPAVLIK_CMAKE_MOD}.tar.gz:0 \
${LIBROCKET}.tar.gz:1
DIST_SUBDIR = fs2open-${V}
# c++11
COMPILER = base-clang ports-gcc
@ -35,20 +44,24 @@ LIB_DEPENDS = audio/openal \
devel/sdl2 \
graphics/ffmpeg \
graphics/png \
graphics/vulkan-loader \
devel/jansson
CONFIGURE_ARGS = -DCMAKE_INSTALL_PREFIX=${LOCALBASE}/share/fs2open \
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen:Bool=Yes
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=On
# currently not building; would be ${WRKBUILD}/bin/unittests
NO_TEST = Yes
WRKDIST = ${WRKDIR}/fs2open.github.com
FIX_CRLF_FILES = code/utils/boost/syncboundedqueue.h
# remove bundled SDL
post-extract:
rm -rf ${WRKSRC}/lib/libsdl
rm -rf ${WRKSRC}/lib/libsdl
rmdir ${WRKSRC}/cmake/external/rpavlik-cmake-modules
ln -s ${WRKDIR}/cmake-modules-${RPAVLIK_CMAKE_MOD} \
${WRKSRC}/cmake/external/rpavlik-cmake-modules
rmdir ${WRKSRC}/lib/libRocket
ln -s ${WRKDIR}/libRocket-${LIBROCKET} \
${WRKSRC}/lib/libRocket
do-gen:
${SUBST_CMD} ${WRKSRC}/CMakeLists.txt

View File

@ -1,2 +1,6 @@
SHA256 (fs2_open_19_0_0-source-Unix.tar.gz) = lRzBrQo8iZ3VNRXrGpfDxxndhL3b3QHdkXeIT5klYo4=
SIZE (fs2_open_19_0_0-source-Unix.tar.gz) = 12195030
SHA256 (fs2open-21.4.1/7cef9577d6fc35057ea57f46b4986a8a28aeff50.tar.gz) = e2kS2gGlbuyljBP4u7B7YSCvjwRyIxZ0fcgTKo7GWso=
SHA256 (fs2open-21.4.1/ecd648a43aff8a9f3daf064d75ca5725237d5b38.tar.gz) = JcjDM2xciQqxzt/90Z17tubwjVy+HASUyiAs+5h/Tfc=
SHA256 (fs2open-21.4.1/fs2open-21.4.1.tar.gz) = llk82AJT8aVxPeKV6dKheA4qi9eZecYQkwlHooNLtiE=
SIZE (fs2open-21.4.1/7cef9577d6fc35057ea57f46b4986a8a28aeff50.tar.gz) = 267464
SIZE (fs2open-21.4.1/ecd648a43aff8a9f3daf064d75ca5725237d5b38.tar.gz) = 2417905
SIZE (fs2open-21.4.1/fs2open-21.4.1.tar.gz) = 10441595

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-CMakeLists_txt,v 1.2 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-CMakeLists_txt,v 1.3 2021/12/18 05:10:57 thfr Exp $
add include and lib directories to find system SDL2
try to avoid get_target_property error
@ -16,7 +16,7 @@ Index: CMakeLists.txt
# Make sure the source and binary directory are not the sample
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(FATAL_ERROR "Binary and source directory can not be the same! Choose another build directory.")
@@ -13,6 +16,7 @@ include(cmake/util.cmake)
@@ -14,6 +17,7 @@ include(cmake/embed_file.cmake)
set_policy(CMP0051 NEW)
set_policy(CMP0053 NEW)
set_policy(CMP0054 NEW)

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-cmake_toolchain-clang_cmake,v 1.2 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-cmake_toolchain-clang_cmake,v 1.3 2021/12/18 05:10:57 thfr Exp $
remove hardcoded -O{0,2} flags
Index: cmake/toolchain-clang.cmake
--- cmake/toolchain-clang.cmake.orig
+++ cmake/toolchain-clang.cmake
@@ -82,9 +82,9 @@ if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
@@ -83,9 +83,9 @@ if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-shift-negative-value")
endif()

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-cmake_toolchain-gcc_cmake,v 1.2 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-cmake_toolchain-gcc_cmake,v 1.3 2021/12/18 05:10:57 thfr Exp $
remove hardcoded -O{0,2} flags
Index: cmake/toolchain-gcc.cmake
--- cmake/toolchain-gcc.cmake.orig
+++ cmake/toolchain-gcc.cmake
@@ -94,9 +94,9 @@ if(SUPPORTS_STRINGOP_TRUNCATION)
@@ -108,9 +108,9 @@ if(SUPPORTS_STRINGOP_TRUNCATION)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-stringop-overflow")
endif()
@ -15,5 +15,5 @@ Index: cmake/toolchain-gcc.cmake
-set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
+set(COMPILER_FLAGS_DEBUG "-g -Wshadow")
# Always use the base flags and add our compiler flags at the bacl
# Always use the base flags and add our compiler flags at the back
set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")

View File

@ -1,16 +1,16 @@
$OpenBSD: patch-code_CMakeLists_txt,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-code_CMakeLists_txt,v 1.2 2021/12/18 05:10:57 thfr Exp $
correct capitalization for libSDL2
Index: code/CMakeLists.txt
--- code/CMakeLists.txt.orig
+++ code/CMakeLists.txt
@@ -26,7 +26,7 @@ TARGET_LINK_LIBRARIES(code PUBLIC ${LUA_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
@@ -28,7 +28,7 @@ TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC lz4)
-TARGET_LINK_LIBRARIES(code PUBLIC sdl2)
+TARGET_LINK_LIBRARIES(code PUBLIC SDL2)
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
if (FSO_BUILD_WITH_FFMPEG)
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-code_inetfile_cftp_h,v 1.1 2021/12/18 05:10:57 thfr Exp $
Index: code/inetfile/cftp.h
--- code/inetfile/cftp.h.orig
+++ code/inetfile/cftp.h
@@ -14,6 +14,7 @@
#ifndef _WIN32
#include "netinet/in.h"
+#include <sys/socket.h>
#endif
#include "globalincs/pstypes.h"

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-code_libs_renderdoc_renderdoc_app_h,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-code_libs_renderdoc_renderdoc_app_h,v 1.2 2021/12/18 05:10:57 thfr Exp $
add to ifdef
@ -12,5 +12,5 @@ Index: code/libs/renderdoc/renderdoc_app.h
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__OpenBSD__)
#define RENDERDOC_CC
#elif defined(__APPLE__)
#elif defined(SCP_BSD)
#define RENDERDOC_CC

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-code_model_modelread_cpp,v 1.1 2020/10/20 17:13:10 cwen Exp $
Fix the build on big endian archs, from:
https://github.com/scp-fs2open/fs2open.github.com/commit/4bb31f4
Index: code/model/modelread.cpp
--- code/model/modelread.cpp.orig
+++ code/model/modelread.cpp
@@ -5341,7 +5341,7 @@ void swap_bsp_sortnorms( polymodel * pm, ubyte * p )
}
#endif // BIG_ENDIAN
-void swap_bsp_data( polymodel * /*pm*/, void * /*model_ptr*/ )
+void swap_bsp_data( polymodel * pm, void * model_ptr )
{
#if BYTE_ORDER == BIG_ENDIAN
ubyte *p = (ubyte *)model_ptr;
@@ -5397,7 +5397,7 @@ void swap_bsp_data( polymodel * /*pm*/, void * /*mode
#endif
}
-void swap_sldc_data(ubyte * /*buffer*/)
+void swap_sldc_data(ubyte * buffer)
{
#if BYTE_ORDER == BIG_ENDIAN
char *type_p = (char *)(buffer);

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-code_network_gtrack_cpp,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-code_network_gtrack_cpp,v 1.2 2021/12/18 05:10:57 thfr Exp $
include sys/socket.h, needed for AF_INET
Index: code/network/gtrack.cpp
--- code/network/gtrack.cpp.orig
+++ code/network/gtrack.cpp
@@ -25,6 +25,9 @@
@@ -27,6 +27,9 @@
#include "network/ptrack.h"
#include "network/multi_fstracker.h"
@ -14,4 +14,4 @@ Index: code/network/gtrack.cpp
+#endif
// check structs for size compatibility
SDL_COMPILE_TIME_ASSERT(game_packet_header, sizeof(game_packet_header) == 529);
SDL_COMPILE_TIME_ASSERT(game_packet_header, sizeof(game_packet_header) == 1529);

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-code_network_psnet2_cpp,v 1.1 2021/12/18 05:10:57 thfr Exp $
missing define
note this is separately defined with same value in
code/network/multi_portfwd.cpp and
lib/libpcp/src/net/sock_ntop.c
if those change for some reason, so should this one
Index: code/network/psnet2.cpp
--- code/network/psnet2.cpp.orig
+++ code/network/psnet2.cpp
@@ -8,7 +8,7 @@
*/
-
+#define AI_V4MAPPED 0x00000800
#ifdef _WIN32
#include <winsock2.h>

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-code_network_ptrack_cpp,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-code_network_ptrack_cpp,v 1.2 2021/12/18 05:10:57 thfr Exp $
include sys/socket.h needed for AF_INET
Index: code/network/ptrack.cpp
--- code/network/ptrack.cpp.orig
+++ code/network/ptrack.cpp
@@ -25,6 +25,9 @@
@@ -27,6 +27,9 @@
#include "network/psnet2.h"
#include "network/multi_fstracker.h"
@ -14,4 +14,4 @@ Index: code/network/ptrack.cpp
+#endif
// check structs for size compatibility
SDL_COMPILE_TIME_ASSERT(udp_packet_header, sizeof(udp_packet_header) == 497);
SDL_COMPILE_TIME_ASSERT(udp_packet_header, sizeof(udp_packet_header) == 517);

View File

@ -1,11 +1,11 @@
$OpenBSD: patch-code_network_valid_cpp,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-code_network_valid_cpp,v 1.2 2021/12/18 05:10:57 thfr Exp $
include sys/socket.h
Index: code/network/valid.cpp
--- code/network/valid.cpp.orig
+++ code/network/valid.cpp
@@ -27,6 +27,9 @@
@@ -29,6 +29,9 @@
#include "network/multi_fstracker.h"
#include "io/timer.h"

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-code_osapi_dialogs_cpp,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-code_osapi_dialogs_cpp,v 1.2 2021/12/18 05:10:57 thfr Exp $
disable breaking on error with SDL_ShowMessageBox()
this is a backport of a part of commit
@ -7,7 +7,7 @@ this is a backport of a part of commit
Index: code/osapi/dialogs.cpp
--- code/osapi/dialogs.cpp.orig
+++ code/osapi/dialogs.cpp
@@ -403,7 +403,7 @@ namespace os
@@ -332,7 +332,7 @@ namespace os
if (SDL_ShowMessageBox(&boxData, &buttonId) < 0)
{
// Call failed

View File

@ -1,34 +0,0 @@
$OpenBSD: patch-code_utils_boost_syncboundedqueue_h,v 1.1 2020/08/20 17:32:37 thfr Exp $
fix clang 10 build
Index: code/utils/boost/syncboundedqueue.h
--- code/utils/boost/syncboundedqueue.h.orig
+++ code/utils/boost/syncboundedqueue.h
@@ -276,7 +276,7 @@ queue_op_status sync_bounded_queue<ValueType>::try_pul
template <typename ValueType>
queue_op_status sync_bounded_queue<ValueType>::nonblocking_pull_front(ValueType& elem)
{
- std::unique_lock<std::mutex> lk(mtx_, std::try_lock);
+ std::unique_lock<std::mutex> lk(mtx_, std::try_to_lock);
if (!lk.owns_lock())
{
return queue_op_status::busy;
@@ -388,7 +388,7 @@ queue_op_status sync_bounded_queue<ValueType>::wait_pu
template <typename ValueType>
queue_op_status sync_bounded_queue<ValueType>::nonblocking_push_back(const ValueType& elem)
{
- std::unique_lock<std::mutex> lk(mtx_, std::try_lock);
+ std::unique_lock<std::mutex> lk(mtx_, std::try_to_lock);
if (!lk.owns_lock()) return queue_op_status::busy;
return try_push_back(elem, lk);
}
@@ -452,7 +452,7 @@ queue_op_status sync_bounded_queue<ValueType>::wait_pu
template <typename ValueType>
queue_op_status sync_bounded_queue<ValueType>::nonblocking_push_back(ValueType&& elem)
{
- std::unique_lock<std::mutex> lk(mtx_, std::try_lock);
+ std::unique_lock<std::mutex> lk(mtx_, std::try_to_lock);
if (!lk.owns_lock())
{
return queue_op_status::busy;

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-lib_CMakeLists_txt,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-lib_CMakeLists_txt,v 1.2 2021/12/18 05:10:57 thfr Exp $
disable bundled SDL
Index: lib/CMakeLists.txt
--- lib/CMakeLists.txt.orig
+++ lib/CMakeLists.txt
@@ -13,8 +13,6 @@ include(OpenAL.cmake)
add_subdirectory(opengl)
@@ -15,8 +15,6 @@ if (FSO_BUILD_WITH_OPENGL)
add_subdirectory(opengl)
endif()
-ADD_SUBDIRECTORY(libsdl)
-

View File

@ -1,31 +0,0 @@
$OpenBSD: patch-lib_libRocket_Include_Rocket_Core_Lua_Interpreter_h,v 1.1 2020/09/17 12:34:22 thfr Exp $
_L -> _LuaState to avoid clash with macro in ctype.h
Index: lib/libRocket/Include/Rocket/Core/Lua/Interpreter.h
--- lib/libRocket/Include/Rocket/Core/Lua/Interpreter.h.orig
+++ lib/libRocket/Include/Rocket/Core/Lua/Interpreter.h
@@ -103,7 +103,7 @@ class ROCKETLUA_API Interpreter : public Plugin (publi
must call lua_close yourself or if you need to continue to use the lua_State pointer provided here. Internally, it calls
Interpreter::Startup() and registers the "body" tag to generate a LuaDocument rather than a Rocket::Core::ElementDocument.
If the argument provided is NULL, a Lua context is created automatically instead. */
- static void Initialise(lua_State *_L);
+ static void Initialise(lua_State *_LuaState);
/** Stops the plugin by calling lua_close
@remark Shutdown calls lua_Close on the lua_State associated with the Interpreter. If a lua_State was provided in the
@@ -118,12 +118,12 @@ class ROCKETLUA_API Interpreter : public Plugin (publi
@sa Rocket::Core::Plugin::OnShutdown */
virtual void OnShutdown();
private:
- /** Creates a lua_State for @var _L and calls luaL_openlibs, then calls Interpreter::RegisterCoreTypes(lua_State*)
+ /** Creates a lua_State for @var _LuaState and calls luaL_openlibs, then calls Interpreter::RegisterCoreTypes(lua_State*)
@remark called by Interpreter::Initialise() */
void Startup();
/** Lua state that Interpreter::Initialise() creates. */
- static lua_State* _L;
+ static lua_State* _LuaState;
};
}
}

View File

@ -1,181 +0,0 @@
$OpenBSD: patch-lib_libRocket_Source_Core_Lua_Interpreter_cpp,v 1.1 2020/09/17 12:34:22 thfr Exp $
_L -> _LuaState to avoid clash with macro in ctype.h
Index: lib/libRocket/Source/Core/Lua/Interpreter.cpp
--- lib/libRocket/Source/Core/Lua/Interpreter.cpp.orig
+++ lib/libRocket/Source/Core/Lua/Interpreter.cpp
@@ -60,19 +60,19 @@
namespace Rocket {
namespace Core {
namespace Lua {
-lua_State* Interpreter::_L = NULL;
+lua_State* Interpreter::_LuaState = NULL;
//typedefs for nicer Lua names
typedef Rocket::Core::ElementDocument Document;
void Interpreter::Startup()
{
- if(_L == NULL)
+ if(_LuaState == NULL)
{
Log::Message(Log::LT_INFO, "Loading Lua interpreter");
- _L = luaL_newstate();
- luaL_openlibs(_L);
+ _LuaState = luaL_newstate();
+ luaL_openlibs(_LuaState);
}
- RegisterCoreTypes(_L);
+ RegisterCoreTypes(_LuaState);
}
@@ -111,27 +111,27 @@ void Interpreter::LoadFile(const String& file)
Rocket::Core::FileInterface* file_interface = Rocket::Core::GetFileInterface();
Rocket::Core::FileHandle handle = file_interface->Open(file);
if(handle == 0) {
- lua_pushfstring(_L, "LoadFile: Unable to open file: %s", file.CString());
- Report(_L);
+ lua_pushfstring(_LuaState, "LoadFile: Unable to open file: %s", file.CString());
+ Report(_LuaState);
return;
}
size_t size = file_interface->Length(handle);
if(size == 0) {
- lua_pushfstring(_L, "LoadFile: File is 0 bytes in size: %s", file.CString());
- Report(_L);
+ lua_pushfstring(_LuaState, "LoadFile: File is 0 bytes in size: %s", file.CString());
+ Report(_LuaState);
return;
}
char* file_contents = new char[size];
file_interface->Read(file_contents,size,handle);
file_interface->Close(handle);
- if(luaL_loadbuffer(_L,file_contents,size,file.CString()) != 0)
- Report(_L);
+ if(luaL_loadbuffer(_LuaState,file_contents,size,file.CString()) != 0)
+ Report(_LuaState);
else //if there were no errors loading, then the compiled function is on the top of the stack
{
- if(lua_pcall(_L,0,0,0) != 0)
- Report(_L);
+ if(lua_pcall(_LuaState,0,0,0) != 0)
+ Report(_LuaState);
}
delete[] file_contents;
@@ -140,27 +140,27 @@ void Interpreter::LoadFile(const String& file)
void Interpreter::DoString(const Rocket::Core::String& code, const Rocket::Core::String& name)
{
- if(luaL_loadbuffer(_L,code.CString(),code.Length(), name.CString()) != 0)
- Report(_L);
+ if(luaL_loadbuffer(_LuaState,code.CString(),code.Length(), name.CString()) != 0)
+ Report(_LuaState);
else
{
- if(lua_pcall(_L,0,0,0) != 0)
- Report(_L);
+ if(lua_pcall(_LuaState,0,0,0) != 0)
+ Report(_LuaState);
}
}
void Interpreter::LoadString(const Rocket::Core::String& code, const Rocket::Core::String& name)
{
- if(luaL_loadbuffer(_L,code.CString(),code.Length(), name.CString()) != 0)
- Report(_L);
+ if(luaL_loadbuffer(_LuaState,code.CString(),code.Length(), name.CString()) != 0)
+ Report(_LuaState);
}
void Interpreter::BeginCall(int funRef)
{
- lua_settop(_L,0); //empty stack
- //lua_getref(_L,funRef);
- lua_rawgeti(_L, LUA_REGISTRYINDEX, (int)funRef);
+ lua_settop(_LuaState,0); //empty stack
+ //lua_getref(_LuaState,funRef);
+ lua_rawgeti(_LuaState, LUA_REGISTRYINDEX, (int)funRef);
}
int Interpreter::ErrorHandler(lua_State* L) {
@@ -196,8 +196,8 @@ int Interpreter::ErrorHandler(lua_State* L) {
bool Interpreter::ExecuteCall(int params, int res)
{
bool ret = true;
- int top = lua_gettop(_L);
- if(lua_type(_L,top-params) != LUA_TFUNCTION)
+ int top = lua_gettop(_LuaState);
+ if(lua_type(_LuaState,top-params) != LUA_TFUNCTION)
{
ret = false;
//stack cleanup
@@ -205,24 +205,24 @@ bool Interpreter::ExecuteCall(int params, int res)
{
for(int i = top; i >= (top-params); i--)
{
- if(!lua_isnone(_L,i))
- lua_remove(_L,i);
+ if(!lua_isnone(_LuaState,i))
+ lua_remove(_LuaState,i);
}
}
}
else
{
- lua_pushcfunction(_L, ErrorHandler);
- lua_insert(_L, -params - 2);
+ lua_pushcfunction(_LuaState, ErrorHandler);
+ lua_insert(_LuaState, -params - 2);
- if(lua_pcall(_L,params,res,-params - 2) != 0)
+ if(lua_pcall(_LuaState,params,res,-params - 2) != 0)
{
- Report(_L);
+ Report(_LuaState);
ret = false;
res = 0;
}
- lua_remove(_L, -res - 1); // Remove error function from stack
+ lua_remove(_LuaState, -res - 1); // Remove error function from stack
}
return ret;
}
@@ -232,12 +232,12 @@ void Interpreter::EndCall(int res)
//stack cleanup
for(int i = res; i > 0; i--)
{
- if(!lua_isnone(_L,res))
- lua_remove(_L,res);
+ if(!lua_isnone(_LuaState,res))
+ lua_remove(_LuaState,res);
}
}
-lua_State* Interpreter::GetLuaState() { return _L; }
+lua_State* Interpreter::GetLuaState() { return _LuaState; }
//From Plugin
@@ -267,14 +267,14 @@ void Interpreter::Initialise()
void Interpreter::Initialise(lua_State *luaStatePointer)
{
Interpreter *iPtr = new Interpreter();
- iPtr->_L = luaStatePointer;
+ iPtr->_LuaState = luaStatePointer;
Rocket::Core::RegisterPlugin(iPtr);
}
void Interpreter::Shutdown(bool free_state)
{
if (free_state) {
- lua_close(_L);
+ lua_close(_LuaState);
}
}

View File

@ -1,14 +1,14 @@
$OpenBSD: patch-lib_libpcp_src_net_gateway_c,v 1.1 2020/09/17 12:34:22 thfr Exp $
$OpenBSD: patch-lib_libpcp_src_net_gateway_c,v 1.2 2021/12/18 05:10:57 thfr Exp $
Index: lib/libpcp/src/net/gateway.c
--- lib/libpcp/src/net/gateway.c.orig
+++ lib/libpcp/src/net/gateway.c
@@ -62,7 +62,7 @@
#include "pcp_win_defines.h"
#endif
-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/sysctl.h>
#include <net/if_dl.h> //struct sockaddr_dl
#define USE_SOCKET_ROUTE
@@ -50,7 +50,7 @@
#define USE_NETLINK
#elif defined(WIN32)
#define USE_WIN32_CODE
-#elif defined(__APPLE__) || defined(__FreeBSD__)
+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#define USE_SYSCTL_NET_ROUTE
#elif defined(BSD) || defined(__FreeBSD_kernel__)
#define USE_SYSCTL_NET_ROUTE

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-lib_vulkan-hpp_vulkan_vulkan_hpp,v 1.1 2021/12/18 05:10:57 thfr Exp $
Index: lib/vulkan-hpp/vulkan/vulkan.hpp
--- lib/vulkan-hpp/vulkan/vulkan.hpp.orig
+++ lib/vulkan-hpp/vulkan/vulkan.hpp
@@ -67999,7 +67999,7 @@ namespace VULKAN_HPP_NAMESPACE
private:
bool m_success;
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
void *m_library;
#elif defined(_WIN32)
HMODULE m_library;

View File

@ -1,5 +1,6 @@
@comment $OpenBSD: PLIST,v 1.2 2018/09/04 12:46:12 espie Exp $
@comment $OpenBSD: PLIST,v 1.3 2021/12/18 05:10:57 thfr Exp $
bin/fs2open
share/doc/pkg-readmes/${PKGSTEM}
share/fs2open/
share/fs2open/Antlr4_LICENSE.txt
@bin share/fs2open/fs2open