Skip to content

Commit e6a113b

Browse files
committed
Add games/idtech4a-engine
1 parent cecf717 commit e6a113b

40 files changed

+13870
-0
lines changed

FINISHED

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ net/py-netifaces2 ready to import (lcheylus)
134134
devel/gh-gr ready to import (lcheylus)
135135
devel/tokei ready to import (lcheylus)
136136
devel/scc ready to import (lcheylus)
137+
games/idtech4a-engine ready for import, sent to ports@ (tx00100xt)
137138
games/runelite sent to ports@ 2023-02-09 (limero)
138139
games/serioussam ready for import, sent to ports@ (tx00100xt)
139140
games/recoil-rts ready for import, sent to ports@ (thfr)

games/idtech4a-engine/Makefile

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
ONLY_FOR_ARCHS= amd64 i386
2+
3+
COMMENT= idTEch4a Engine provided Doom3/Quake4/Prey source port
4+
5+
N= idtech4a-engine
6+
V= 1.1.0harmattan65
7+
P= com.n0n3m4.diii4a
8+
9+
DIST_TUPLE = github glKarin ${P} v${V} .
10+
PKGNAME = ${N}-${V}
11+
12+
CATEGORIES= games
13+
14+
MAINTAINER= Alexander Pavlov <[email protected]>
15+
16+
17+
# GPL-3 - Main Code, OpenAL Code from dhewm3
18+
# GPL-3 - Doom3/Quake4/Prey SDK for Android idTech4A++
19+
# BSD - msinttypes, TinyEXR, OpenEXR, vorbis, ogg
20+
# BSD-1 - Mesa
21+
# BSD-2 - Base64, binpack2d, SSAO, SSGI
22+
# CC0-1.0 - Replacement Textures
23+
# MIT - ImGui, stb, curl
24+
# RSA - MD4
25+
# ZLIB - Minizip, CRC32i irrxml, mikktspace
26+
# public-domain - MD5, stb
27+
# GPL-2 - timidity
28+
# LGPL-2 - timidity
29+
# Artistic - timidity
30+
# FTL BSD-style - freetype
31+
# Apache-2.0 - soil
32+
PERMIT_PACKAGE= Yes
33+
34+
WRKDIST= ${WRKDIR}/${P}-${V}/Q3E/src/main/jni/doom3/neo
35+
36+
# Extra: ogg.6 vorbis.9 vorbisfile.6 (dlopen)
37+
WANTLIB += ${COMPILER_LIBCXX} SDL2 c m pthread vorbis
38+
WANTLIB += ${COMPILER_LIBCXX} openal z curl ogg vorbisfile
39+
40+
MODULES = devel/cmake
41+
42+
# c++17
43+
COMPILER = base-clang ports-gcc
44+
CFLAGS += -I${X11BASE}/include
45+
CXXFLAGS += -I${X11BASE}/include
46+
47+
CONFIGURE_ARGS += -DUSE_SYSTEM_ZLIB=ON -DOPENAL=TRUE
48+
CONFIGURE_ARGS += -DCMAKE_BUILD_TYPE=Release -DSDL2=ON
49+
CONFIGURE_ARGS += -DUSE_SYSTEM_CURL=ON -DNO_ALSA=ON
50+
51+
52+
BUILD_DEPENDS = devel/ninja \
53+
audio/libogg \
54+
audio/libvorbis \
55+
audio/openal \
56+
net/curl \
57+
devel/sdl2
58+
59+
LIB_DEPENDS = audio/openal \
60+
audio/libogg \
61+
audio/libvorbis \
62+
net/curl \
63+
devel/sdl2
64+
65+
NO_TEST = Yes
66+
67+
post-install:
68+
${INSTALL_PROGRAM} ${WRKDIR}/build-${MACHINE_ARCH}/Doom3 \
69+
${PREFIX}/bin/idtech4a-doom3
70+
${INSTALL_PROGRAM} ${WRKDIR}/build-${MACHINE_ARCH}/Quake4 \
71+
${PREFIX}/bin/idtech4a-quake4
72+
${INSTALL_PROGRAM} ${WRKDIR}/build-${MACHINE_ARCH}/Prey \
73+
${PREFIX}/bin/idtech4a-prey
74+
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/${N}
75+
${INSTALL_DATA} ${WRKDIR}/${P}-${V}/README.md \
76+
${PREFIX}/share/doc/${N}
77+
78+
.include <bsd.port.mk>

games/idtech4a-engine/distinfo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SHA256 (glKarin-com.n0n3m4.diii4a-v1.1.0harmattan65.tar.gz) = KNX8GRwAR6R0ioe25dETT6nF9Lx5rOpfan62+u/9LyQ=
2+
SIZE (glKarin-com.n0n3m4.diii4a-v1.1.0harmattan65.tar.gz) = 388197988
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Index: CMakeLists.txt
2+
--- CMakeLists.txt.orig
3+
+++ CMakeLists.txt
4+
@@ -366,9 +366,12 @@ find_package(ZLIB REQUIRED)
5+
include_directories(${ZLIB_INCLUDE_DIRS})
6+
endif()
7+
8+
+find_package(OpenAL REQUIRED)
9+
+include_directories(${OPENAL_INCLUDE_DIR})
10+
+
11+
# OpenAL using internal OpenAL-soft
12+
#[[find_package(OpenAL REQUIRED)
13+
-include_directories(${OPENAL_INCLUDE_DIR})]]
14+
+#include_directories(${OPENAL_INCLUDE_DIR})]]
15+
16+
17+
if(WIN32)
18+
@@ -615,7 +618,9 @@ elseif(ANDROID)
19+
set(sys_libs ${sys_libs} z)
20+
endif()
21+
else() #TODO linux
22+
- set(sys_libs ${sys_libs} dl pthread)
23+
+ set(sys_libs ${sys_libs} pthread) # TODO OpenBSD fix link
24+
+ set(OPENAL_SOUND_LIBRARY "OpenAL::OpenAL")
25+
+ set(sys_libs ${sys_libs} ${OPENAL_SOUND_LIBRARY})
26+
if(USE_X11)
27+
set(LINUX_SDL FALSE)
28+
message(STATUS "use X11 + EGL")
29+
@@ -1615,8 +1620,8 @@ else()
30+
)
31+
set(src_sys_base
32+
${src_sys_base}
33+
- sys/linux/sound.cpp
34+
- sys/linux/sound_alsa.cpp
35+
+ #sys/linux/sound.cpp
36+
+ #sys/linux/sound_alsa.cpp
37+
sys/linux/sdlmain.cpp
38+
)
39+
set(src_sys_core
40+
@@ -1628,7 +1633,7 @@ else()
41+
sys/linux/main.cpp
42+
sys/linux/input.cpp
43+
sys/linux/sound.cpp
44+
- sys/linux/sound_alsa.cpp
45+
+ ##sys/linux/sound_alsa.cpp
46+
)
47+
set(src_sys_core
48+
sys/linux/gles2.cpp
49+
@@ -1813,6 +1818,7 @@ if(CORE)
50+
idlib
51+
${sys_libs}
52+
${local_libs}
53+
+ ${OPENAL_LIBRARY}
54+
)
55+
56+
if(NOT APPLE AND NOT WIN32 AND NOT ANDROID)
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
Index: SConstruct
2+
--- SConstruct.orig
3+
+++ SConstruct
4+
@@ -12,8 +12,8 @@ import scons_utils
5+
conf_filename='site.conf'
6+
# choose configuration variables which should be saved between runs
7+
# ( we handle all those as strings )
8+
-serialized=['CC', 'CXX', 'JOBS', 'BUILD', 'IDNET_HOST', 'DEDICATED',
9+
- 'DEBUG_MEMORY', 'LIBC_MALLOC', 'ID_NOLANADDRESS', 'ID_MCHECK', 'ALSA',
10+
+serialized=['CC', 'CXX', 'X86', 'JOBS', 'BUILD', 'IDNET_HOST', 'DEDICATED',
11+
+ 'DEBUG_MEMORY', 'LIBC_MALLOC', 'ID_NOLANADDRESS', 'ID_MCHECK',
12+
'TARGET_CORE', 'TARGET_GAME', 'TARGET_D3XP', 'TARGET_MONO', 'TARGET_DEMO', 'NOCURL',
13+
'TARGET_CDOOM',
14+
'TARGET_D3LE',
15+
@@ -29,6 +29,13 @@ serialized=['CC', 'CXX', 'JOBS', 'BUILD', 'IDNET_HOST'
16+
'MULTITHREAD', 'OPENSLES'
17+
]
18+
19+
+
20+
+# global build mode ------------------------------
21+
+
22+
+g_sdk = not os.path.exists( 'sys/scons/SConscript.core' )
23+
+
24+
+# ------------------------------------------------
25+
+
26+
# help -------------------------------------------
27+
28+
help_string = """
29+
@@ -102,12 +109,18 @@ BUILD_GAMEPAK (default 0)
30+
BASEFLAGS (default '')
31+
Add compile flags
32+
33+
-NOCONF (default 0, not saved)
34+
- ignore site configuration and use defaults + command line only
35+
+X86 (default 0)
36+
+ cross compile for x86 (only applicable on x86_64)
37+
38+
SILENT ( default 0, saved )
39+
hide the compiler output, unless error
40+
41+
+NOCONF (default 0, not saved)
42+
+ ignore site configuration and use defaults + command line only
43+
+"""
44+
+
45+
+if ( not g_sdk ):
46+
+ help_string += """
47+
DEDICATED (default 0)
48+
Control regular / dedicated type of build:
49+
0 - client
50+
@@ -155,9 +168,12 @@ ID_MCHECK (default 2)
51+
note that Doom has it's own block allocator/checking
52+
this should not be considered a replacement, but an additional tool
53+
54+
-ALSA (default 1)
55+
- enable ALSA sound backend support
56+
-
57+
+SETUP (default 0, not saved)
58+
+ build a setup. implies release build
59+
+
60+
+SDK (default 0, not saved)
61+
+ build an SDK release
62+
+
63+
NOCURL (default 0)
64+
set to 1 to disable usage of libcurl and http/ftp downloads feature
65+
"""
66+
@@ -175,18 +191,27 @@ EnsureSConsVersion( 0, 96 )
67+
# system detection -------------------------------
68+
69+
# CPU type
70+
-cpu = commands.getoutput('uname -m')
71+
-exp = re.compile('i?86')
72+
-if exp.match(cpu):
73+
- cpu = 'x86'
74+
-else:
75+
- if (commands.getoutput('uname -p') == 'powerpc'):
76+
- cpu = 'ppc'
77+
-g_os = 'Linux'
78+
+g_cpu = ''
79+
80+
-if ARGUMENTS.has_key( 'ARCH' ):
81+
- cpu = ARGUMENTS['ARCH']
82+
+uname = commands.getoutput('uname -m')
83+
+if uname == 'x86_64':
84+
+ g_cpu = 'x86_64'
85+
86+
+if len(g_cpu) < 1:
87+
+ exp = re.compile('.*i?86.*')
88+
+ if exp.match(uname):
89+
+ g_cpu = 'x86'
90+
+
91+
+if len(g_cpu) < 1:
92+
+ uname = commands.getoutput('uname -p')
93+
+ if (uname == 'powerpc'):
94+
+ g_cpu = 'ppc'
95+
+
96+
+if len(g_cpu) < 1:
97+
+ g_cpu = 'cpu'
98+
+
99+
+g_os = commands.getoutput('uname -s')
100+
+
101+
# end system detection ---------------------------
102+
103+
# default settings -------------------------------
104+
@@ -195,6 +220,7 @@ CC = 'gcc'
105+
CXX = 'g++'
106+
JOBS = '16'
107+
BUILD = 'debug'
108+
+X86 = '0'
109+
DEDICATED = '0'
110+
TARGET_CORE = '1'
111+
TARGET_GAME = '1'
112+
@@ -218,7 +244,8 @@ LIBC_MALLOC = '1'
113+
ID_NOLANADDRESS = '0'
114+
ID_MCHECK = '2'
115+
BUILD_ROOT = 'build'
116+
-ALSA = '1'
117+
+SETUP = '0'
118+
+SDK = '0'
119+
NOCONF = '0'
120+
NOCURL = '0'
121+
BUILD_GAMEPAK = '0'
122+
@@ -271,6 +298,21 @@ if ( not ARGUMENTS.has_key( 'NOCONF' ) or ARGUMENTS['N
123+
124+
# end save site configuration ------------------
125+
126+
+# configuration rules --------------------------
127+
+
128+
+if ( SETUP != '0' ):
129+
+ DEDICATED = '2'
130+
+ BUILD = 'release'
131+
+
132+
+if ( g_sdk or SDK != '0' ):
133+
+ TARGET_CORE = '0'
134+
+ TARGET_GAME = '1'
135+
+ TARGET_D3XP = '1'
136+
+ TARGET_MONO = '0'
137+
+ TARGET_DEMO = '0'
138+
+
139+
+# end configuration rules ----------------------
140+
+
141+
# general configuration, target selection --------
142+
143+
g_build = BUILD_ROOT + '/' + BUILD
144+
@@ -297,15 +339,31 @@ CORECPPPATH = [ ]
145+
CORELIBPATH = [ ]
146+
CORECPPFLAGS = [ ]
147+
GAMECPPFLAGS = [ ]
148+
-BASELINKFLAGS = [ '-Wl,--no-undefined' ]
149+
-CORELINKFLAGS = [ '-Wl,--no-undefined' ]
150+
-#//k BASELINKFLAGS = [ '-Wl,--no-undefined', '-static-libstdc++' ]
151+
-#//k CORELINKFLAGS = [ '-Wl,--no-undefined', '-static-libstdc++' ]
152+
+BASELINKFLAGS = [ ]
153+
+CORELINKFLAGS = [ ]
154+
155+
# for release build, further optimisations that may not work on all files
156+
OPTCPPFLAGS = [ ]
157+
158+
-BASECPPFLAGS.append( BASEFLAGS.split() )
159+
+if (g_cpu == 'x86_64' and X86 == '1'):
160+
+ print('cross compiling for x86')
161+
+ g_cpu = 'x86'
162+
+ BASECPPFLAGS.append('-m32')
163+
+ BASELINKFLAGS.append('-m32')
164+
+
165+
+g_build = '%s/%s-%s' % (BUILD_ROOT, g_cpu, BUILD)
166+
+
167+
+SConsignFile( g_build + '/scons.signatures' )
168+
+
169+
+if ( DEBUG_MEMORY != '0' ):
170+
+ g_build += '-debugmem'
171+
+
172+
+if ( LIBC_MALLOC != '1' ):
173+
+ g_build += '-nolibcmalloc'
174+
+
175+
+LINK = CXX
176+
+
177+
+BASECPPFLAGS.extend( BASEFLAGS.split(' ') )
178+
BASECPPFLAGS.append( '-pipe' )
179+
# warn all
180+
BASECPPFLAGS.append( '-Wall' ) # -w
181+
@@ -328,6 +386,13 @@ if ( g_os == 'Linux' ):
182+
#BASECPPFLAGS.append('-D__arm__')
183+
# //k
184+
185+
+if ( "BSD" in g_os ):
186+
+ BASECPPFLAGS.append( '-I/usr/local/include' )
187+
+ BASELINKFLAGS.append('-L/usr/local/lib')
188+
+
189+
+if ( g_sdk or SDK != '0' ):
190+
+ BASECPPFLAGS.append( '-D_D3SDK' )
191+
+
192+
if ( TARGET_ANDROID == '1' ):
193+
BASECPPFLAGS.append( '-D__ANDROID__')
194+
g_os = 'Android'
195+
@@ -353,6 +418,10 @@ elif ( BUILD == 'release' ):
196+
OPTCPPFLAGS = [ '-O3', '-Wl,--no-undefined', '-ffast-math', '-fno-unsafe-math-optimizations', '-fomit-frame-pointer' ]
197+
else:
198+
OPTCPPFLAGS = [ '-O3', '-march=native', '-ffast-math', '-fno-unsafe-math-optimizations', '-fomit-frame-pointer' ]
199+
+
200+
+ if (g_cpu == 'x86'):
201+
+ OPTCPPFLAGS.append('-march=pentium3')
202+
+
203+
if ( ID_MCHECK == '0' ):
204+
ID_MCHECK = '2'
205+
else:
206+
@@ -373,7 +442,12 @@ if ( ID_NOLANADDRESS != '0' ):
207+
208+
if ( ID_MCHECK == '1' ):
209+
BASECPPFLAGS.append( '-DID_MCHECK' )
210+
-
211+
+
212+
+# TODO fix these warnings
213+
+BASECPPFLAGS.append('-Wno-sign-compare')
214+
+BASECPPFLAGS.append('-Wno-switch')
215+
+BASECPPFLAGS.append('-Wno-format-security')
216+
+
217+
# create the build environements
218+
g_base_env = Environment( ENV = os.environ, CC = CC, CXX = CXX, LINK = LINK, CPPFLAGS = BASECPPFLAGS, LINKFLAGS = BASELINKFLAGS, CPPPATH = CORECPPPATH, LIBPATH = CORELIBPATH, NDK = NDK, MULTITHREAD = MULTITHREAD, OPENSLES = OPENSLES )
219+
scons_utils.SetupUtils( g_base_env )
220+
@@ -430,7 +504,7 @@ local_humanhead = 0
221+
# OpenGL
222+
local_opengl = 0
223+
224+
-GLOBALS = 'g_env g_env_noopt g_game_env g_os ID_MCHECK ALSA idlib_objects game_objects local_dedicated local_gamedll local_demo local_idlibpic local_curl local_d3xp local_cdoom local_d3le local_rivensin local_hardcorps local_quake4 local_raven local_prey local_humanhead local_opengl OPTCPPFLAGS NDK MULTITHREAD OPENSLES'
225+
+GLOBALS = 'g_env g_env_noopt g_game_env g_os g_cpu g_build ID_MCHECK idlib_objects game_objects local_dedicated local_gamedll local_demo local_idlibpic local_curl local_d3xp local_cdoom local_d3le local_rivensin local_hardcorps local_quake4 local_raven local_prey local_humanhead local_opengl OPTCPPFLAGS NDK MULTITHREAD OPENSLES'
226+
227+
# end general configuration ----------------------
228+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Index: externlibs/miniz/miniz.c
2+
--- externlibs/miniz/miniz.c.orig
3+
+++ externlibs/miniz/miniz.c
4+
@@ -3171,7 +3171,7 @@ static int mz_stat64(const char *path, struct __stat64
5+
#define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
6+
#define MZ_DELETE_FILE remove
7+
8+
-#elif defined(__APPLE__) || defined(__FreeBSD__)
9+
+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
10+
#ifndef MINIZ_NO_TIME
11+
#include <utime.h>
12+
#endif

0 commit comments

Comments
 (0)