Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions FINISHED
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ net/p5-POE-Component-IRC sent to ports@
net/p5-POE-Component-IRC-Plugin-RSS-Headlines sent to ports@
games/brogue sent to ports@ (waiting for upstream to accept patches) (bcallah)
games/openhexagon sent to ports@ (bcallah)
games/rbdoom3bfg ready for import, sent to ports@ (tx00100xt)
lang/voc ready to import (bcallah)
graphics/photoflare ready to import (bcallah)
x11/reddit-wallpaper ready to import (bcallah)
Expand Down
82 changes: 82 additions & 0 deletions games/rbdoom3bfg/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
COMMENT= Doom 3 BFG Edition source port

N= rbdoom3bfg
V= 1.4.0
P= RBDOOM-3-BFG

DIST_TUPLE = github RobertBeckebans ${P} v${V} .
PKGNAME = ${N}-${V}

CATEGORIES= games

MAINTAINER= Alexander Pavlov <[email protected]>


# GPL-3 - Main Code
# BSD - msinttypes, TinyEXR, OpenEXR
# BSD-1 - Mesa
# BSD-2 - Base64, binpack2d, SSAO, SSGI
# CC0-1.0 - Replacement Textures
# MIT - ImGui, stb
# RSA - MD4
# ZLIB - Minizip, CRC32i irrxml, mikktspace
# public-domain - MD5, stb
# GPL-2 - timidity
# LGPL-2 - timidity
# Artistic - timidity
PERMIT_PACKAGE= Yes

WRKDIST= ${WRKDIR}/${P}-${V}/neo

WANTLIB += ${COMPILER_LIBCXX} SDL2 c m pthread png
WANTLIB += ${COMPILER_LIBCXX} jpeg openal z

MODULES = devel/cmake

# c++17
COMPILER = base-clang ports-gcc
CXXFLAGS += -I${X11BASE}/include

CONFIGURE_ARGS += -DUSE_INTRINSICS_SSE=ON -DSDL2=ON
CONFIGURE_ARGS += -DUSE_SYSTEM_ZLIB=ON -DUSE_SYSTEM_LIBPNG=ON
CONFIGURE_ARGS += -DUSE_SYSTEM_LIBJPEG=ON -DUSE_SYSTEM_LIBGLEW=ON
CONFIGURE_ARGS += -DUSE_SYSTEM_RAPIDJSON=ON -DUSE_VULKAN=OFF
CONFIGURE_ARGS += -DUSE_PRECOMPILED_HEADERS=OFF
CONFIGURE_ARGS += -DCMAKE_BUILD_TYPE=Release -DSDL2=ON
CONFIGURE_ARGS += -DSPIRV_SHADERC=OFF -DFFMPEG=ON
CONFIGURE_ARGS += -DCMAKE_SKIP_RPATH=ON

BUILD_DEPENDS = devel/ninja \
graphics/glslang \
graphics/spirv-tools \
audio/openal \
graphics/ffmpeg \
devel/sdl2 \
graphics/png \
graphics/glew \
graphics/jpeg \
textproc/rapidjson

LIB_DEPENDS = graphics/glslang \
audio/openal \
graphics/ffmpeg \
devel/sdl2 \
graphics/png \
graphics/glew \
graphics/jpeg \
textproc/rapidjson

NO_TEST = Yes


post-install:
${INSTALL_PROGRAM} ${WRKDIR}/build-${MACHINE_ARCH}/${N} \
${PREFIX}/bin/${N}
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/${N}
${INSTALL_DATA} ${WRKDIR}/${P}-${V}/README.md \
${PREFIX}/share/doc/${N}
${INSTALL_DATA_DIR} ${PREFIX}/share/${N}
cp -R ${WRKDIR}/${P}-${V}/base ${PREFIX}/share/${N}


.include <bsd.port.mk>
2 changes: 2 additions & 0 deletions games/rbdoom3bfg/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SHA256 (RobertBeckebans-RBDOOM-3-BFG-v1.4.0.tar.gz) = a+Nde3uyKyKTeDwxjEDdxvGSyTdrVgdeG380cBaZ27E=
SIZE (RobertBeckebans-RBDOOM-3-BFG-v1.4.0.tar.gz) = 12676150
148 changes: 148 additions & 0 deletions games/rbdoom3bfg/patches/patch-CMakeLists_txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.2)

-project(RBDoom3BFG)
+project(rbdoom3bfg)

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(CMAKE_MAJOR_VERSION EQUAL 3 AND CMAKE_MINOR_VERSION GREATER_EQUAL 6)
# set MSVC startup project
- set_property (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT RBDoom3BFG)
+ set_property (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT rbdoom3bfg)
endif()

option(STANDALONE
@@ -141,15 +141,15 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATC
add_definitions(-Werror=format-security)
add_definitions(-Werror=format)

- # Compiler check (needs -std=c++11 flag)
+ # Compiler check (needs -std=c++14 flag)
include(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
- if(COMPILER_SUPPORTS_CXX11)
- set(CMAKE_CXX_STANDARD 11)
+ CHECK_CXX_COMPILER_FLAG("-std=c++17" COMPILER_SUPPORTS_CXX17)
+ if(COMPILER_SUPPORTS_CXX17)
+ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
else()
- message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+ message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++17 support. Please use a different C++ compiler.")
endif()

if(CPU_TYPE)
@@ -178,7 +178,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATC
# add clang-specific settings for warnings (the second one make sure clang doesn't complain
# about unknown -W flags, like -Wno-unused-but-set-variable)
# SRS - Add -Wno-deprecated-register and -Wno-expansion-to-defined to list of warning settings
- add_definitions(-Wno-local-type-template-args -Wno-unknown-warning-option -Wno-inline-new-delete -Wno-switch-enum -Wno-deprecated-register -Wno-expansion-to-defined)
+ add_definitions(-Wno-dev -Wno-deprecated-declarations -Wno-local-type-template-args -Wno-unknown-warning-option -Wno-inline-new-delete -Wno-switch-enum -Wno-deprecated-register -Wno-expansion-to-defined)
endif()

if(NOT CMAKE_CROSSCOMPILING AND ONATIVE)
@@ -385,6 +385,9 @@ if(USE_VULKAN)
endif()

else()
+ find_package(glslang)
+ find_package(SPIRV-Tools REQUIRED)
+ if(NOT (${glslang_FOUND} AND ${SPIRV-Tools_FOUND}))
# override Glslang build options

# options required by November 2018 release
@@ -408,6 +411,7 @@ if(USE_VULKAN)
include_directories(${GLSLANG_DIR})

#link_directories($ENV{VULKAN_SDK}/Lib)
+ endif()
endif()

# Use FindVulkan module added with CMAKE 3.7
@@ -1648,10 +1652,10 @@ if(MSVC)

list(APPEND RBDOOM3_SOURCES ${WIN32_RESOURCES})

- add_executable(RBDoom3BFG WIN32 ${RBDOOM3_INCLUDES} ${RBDOOM3_SOURCES})
+ add_executable(rbdoom3bfg WIN32 ${RBDOOM3_INCLUDES} ${RBDOOM3_SOURCES})

- add_dependencies(RBDoom3BFG idlib)
- target_link_libraries(RBDoom3BFG
+ add_dependencies(rbdoom3bfg idlib)
+ target_link_libraries(rbdoom3bfg
idlib
${DirectX_LIBRARIES}
dbghelp
@@ -1672,15 +1676,15 @@ if(MSVC)

# set MSVC default debug directory on executable
if(CMAKE_MAJOR_VERSION EQUAL 3 AND CMAKE_MINOR_VERSION GREATER_EQUAL 8)
- set_target_properties(RBDoom3BFG PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/..")
+ set_target_properties(rbdoom3bfg PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/..")
endif()

#CMAKE_BINARY_DIR
if(CMAKE_CL_64)
- install(TARGETS RBDoom3BFG
+ install(TARGETS rbdoom3bfg
RUNTIME DESTINATION .)
else()
- install(TARGETS RBDoom3BFG
+ install(TARGETS rbdoom3bfg
RUNTIME DESTINATION .)
endif()

@@ -1809,13 +1813,13 @@ else()
SEPARATE_ARGUMENTS(_compiler_FLAGS)

if(USE_PRECOMPILED_HEADERS)
- # we need to recreate the precompiled header for RBDoom3BFG
+ # we need to recreate the precompiled header for rbdoom3bfg
# (i.e. can't use the one created for idlib before)
# because some definitions (e.g. -D__IDLIB__ -D__DOOM_DLL__) differ
add_custom_target(precomp_header_rbdoom3bfg ALL
COMMAND ${CMAKE_CXX_COMPILER} ${_compiler_FLAGS} -x c++-header idlib/precompiled.h -o idlib/precompiled.h.gch
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMENT "Creating idlib/precompiled.h.gch for RBDoom3BFG"
+ COMMENT "Creating idlib/precompiled.h.gch for rbdoom3bfg"
)
endif()

@@ -1839,14 +1843,14 @@ else()
add_dependencies(precomp_header_rbdoom3bfg idlib)
endif()

- add_executable(RBDoom3BFG WIN32 ${RBDOOM3_SOURCES})
+ add_executable(rbdoom3bfg WIN32 ${RBDOOM3_SOURCES})

if (USE_PRECOMPILED_HEADERS)
# make sure precompiled header is created before executable is compiled
- add_dependencies(RBDoom3BFG precomp_header_rbdoom3bfg)
+ add_dependencies(rbdoom3bfg precomp_header_rbdoom3bfg)

# make sure precompiled header is deleted after executable is compiled
- add_dependencies(rm_precomp_header RBDoom3BFG)
+ add_dependencies(rm_precomp_header rbdoom3bfg)
endif()

if(NOT WIN32)
@@ -1854,12 +1858,12 @@ else()
set(RT_LIBRARY rt)
endif()

- target_link_libraries(RBDoom3BFG
+ target_link_libraries(rbdoom3bfg
idlib
${Vulkan_LIBRARIES}
${OPENGL_LIBRARIES}
pthread
- ${RT_LIBRARY}
+ #${RT_LIBRARY}
${SDLx_LIBRARY}
${OPENAL_LIBRARY}
${FFMPEG_LIBRARIES}
17 changes: 17 additions & 0 deletions games/rbdoom3bfg/patches/patch-idlib_DataQueue_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Index: idlib/DataQueue.h
--- idlib/DataQueue.h.orig
+++ idlib/DataQueue.h
@@ -109,8 +109,11 @@ bool idDataQueue< maxItems, maxBuffer >::Append( int s
item.dataOffset = dataLength;
memcpy( data + dataLength, b1, b1Len );
dataLength += b1Len;
- memcpy( data + dataLength, b2, b2Len );
- dataLength += b2Len;
+ if( b2 != NULL )
+ {
+ memcpy( data + dataLength, b2, b2Len );
+ dataLength += b2Len;
+ }
return true;
}

21 changes: 21 additions & 0 deletions games/rbdoom3bfg/patches/patch-idlib_math_Simd_cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Index: idlib/math/Simd.cpp
--- idlib/math/Simd.cpp.orig
+++ idlib/math/Simd.cpp
@@ -61,7 +61,7 @@ idSIMD::InitProcessor
*/
void idSIMD::InitProcessor( const char* module, bool forceGeneric )
{
- cpuid_t cpuid;
+ doom3_cpuid_t cpuid;
idSIMDProcessor* newProcessor;

cpuid = idLib::sys->GetProcessorId();
@@ -1384,7 +1384,7 @@ void idSIMD::Test_f( const idCmdArgs& args )

if( idStr::Length( args.Argv( 1 ) ) != 0 )
{
- cpuid_t cpuid = idLib::sys->GetProcessorId();
+ doom3_cpuid_t cpuid = idLib::sys->GetProcessorId();
idStr argString = args.Args();

argString.Replace( " ", "" );
12 changes: 12 additions & 0 deletions games/rbdoom3bfg/patches/patch-idlib_math_Simd_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Index: idlib/math/Simd.h
--- idlib/math/Simd.h.orig
+++ idlib/math/Simd.h
@@ -92,7 +92,7 @@ class idSIMDProcessor (public)
cpuid = CPUID_NONE;
}

- cpuid_t cpuid;
+ doom3_cpuid_t cpuid;

virtual ~idSIMDProcessor() {} // SRS - Added virtual destructor

12 changes: 12 additions & 0 deletions games/rbdoom3bfg/patches/patch-libs_zlib_minizip_ioapi_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Index: libs/zlib/minizip/ioapi.h
--- libs/zlib/minizip/ioapi.h Sun Mar 6 13:28:12 2022
+++ libs/zlib/minizip/ioapi.h Sun May 11 22:31:05 2025
@@ -53,7 +53,7 @@
#define ftello64 ftell
#define fseeko64 fseek
#else
-#ifdef __FreeBSD__
+#ifdef __OpenBSD__
#define fopen64 fopen
#define ftello64 ftello
#define fseeko64 fseeko
12 changes: 12 additions & 0 deletions games/rbdoom3bfg/patches/patch-renderer_BufferObject_cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Index: renderer/BufferObject.cpp
--- renderer/BufferObject.cpp.orig
+++ renderer/BufferObject.cpp
@@ -135,7 +135,7 @@ idBufferObject::idBufferObject()
#endif

#else
- apiObject = NULL;
+ apiObject = (long)NULL;
buffer = NULL;
#endif
}
Loading