Import NBlood

Reverse-engineered ports of Build games using EDuke32 engine technology
and development principles.

NBlood: Blood port based on EDuke32
Rednukem: Redneck Rampage port based on EDuke32
PCExhumed: A port of the PC version of Exhumed based on EDuke32

Based on eduke32 port.  ok solene@ on an earlier version.
This commit is contained in:
jsg 2020-01-01 02:28:07 +00:00
parent 3ef7cb530d
commit 3ba2d875a6
11 changed files with 353 additions and 0 deletions

80
games/nblood/Makefile Normal file
View File

@ -0,0 +1,80 @@
# $OpenBSD: Makefile,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
COMMENT = reverse-engineered ports of Build games
DISTNAME = nblood-1.01.20191231
GH_ACCOUNT = nukeykt
GH_PROJECT = NBlood
GH_COMMIT = a8b09ac222c38f41c6e4c0b18e744c2a40ce80e2
CATEGORIES = games x11
# GPLv2, BUILD license and shareware data
PERMIT_PACKAGE = "BUILD engine license is not compatible with GPLv2."
PERMIT_DISTFILES = "BUILD engine license is not compatible with GPLv2."
BUILD_DEPENDS = archivers/unzip \
graphics/gdk-pixbuf2
WANTLIB += c m ogg pthread vorbis vorbisfile vpx lz4 xmp
WANTLIB += SDL2 FLAC execinfo ${COMPILER_LIBCXX}
LIB_DEPENDS = archivers/lz4 \
audio/libxmp \
audio/libvorbis \
audio/flac \
devel/sdl2 \
devel/libexecinfo \
multimedia/libvpx
# dlopen()'d; shows as Extra in check-lib-depends but it is used
LIB_DEPENDS += x11/gtk+2
WANTLIB += gtk-x11-2.0
COMPILER = base-clang ports-gcc
# make sure we can see compilation output, respect CC/CXX, don't strip!
MAKE_FLAGS += PRETTY_OUTPUT=0 \
CC="${CC}" \
CXX="${CXX}" \
STRIP=true \
PACKAGE_REPOSITORY=1 \
NOASM=1
MAKE_FILE = GNUmakefile
USE_GMAKE = Yes
NO_TEST = Yes
.include <bsd.port.arch.mk>
.if !${PROPERTIES:Mlld}
MAKE_FLAGS += LTO=0
.endif
post-extract:
# check for data files in correct location
@sed -i "s,/usr/share/games/eduke32,${TRUEPREFIX}/share/rednukem," \
${WRKSRC}/source/rr/src/common.cpp
@sed -i "s,/usr/share/games/nblood,${TRUEPREFIX}/share/nblood," \
${WRKSRC}/source/blood/src/common.cpp
rm ${WRKSRC}/source/build/include/lz4.h ${WRKSRC}/source/build/src/lz4.c
do-install:
${INSTALL_PROGRAM} ${WRKBUILD}/nblood ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKBUILD}/rednukem ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKBUILD}/pcexhumed ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/share/nblood
${INSTALL_DATA_DIR} ${PREFIX}/share/rednukem
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/nblood
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/nblood
${INSTALL_DATA} ${WRKDIST}/{AUTHORS,README}.md \
${PREFIX}/share/doc/nblood/
# eduke32/mapster32 licenses
${INSTALL_DATA} ${WRKDIST}/package/common/gpl-2.0.txt \
${PREFIX}/share/doc/nblood/
${INSTALL_DATA} ${WRKDIST}/package/common/buildlic.txt \
${PREFIX}/share/doc/nblood/
# sample game mapping/modding data files
${INSTALL_DATA} ${WRKDIST}/package/sdk/samples/* \
${PREFIX}/share/examples/nblood/
.include <bsd.port.mk>

2
games/nblood/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (nblood-1.01.20191231-a8b09ac2.tar.gz) = pYkLeAhPz8PB2tRZ3jwy4fM5xLlIK+R9gTyCGhzCDqM=
SIZE (nblood-1.01.20191231-a8b09ac2.tar.gz) = 47632849

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-Common_mak,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
Index: Common.mak
--- Common.mak.orig
+++ Common.mak
@@ -714,7 +714,7 @@ ifeq (0,$(RELEASE))
F_NO_STACK_PROTECTOR :=
else
ifeq (0,$(CLANG))
- COMMONFLAGS += -funswitch-loops
+ #COMMONFLAGS += -funswitch-loops
endif
ifeq (0,$(FORCEDEBUG))

View File

@ -0,0 +1,58 @@
$OpenBSD: patch-GNUmakefile,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
Index: GNUmakefile
--- GNUmakefile.orig
+++ GNUmakefile
@@ -260,7 +260,6 @@ engine_objs := \
hightile.cpp \
klzw.cpp \
kplib.cpp \
- lz4.c \
md4.cpp \
mhk.cpp \
miniz.c \
@@ -423,8 +422,8 @@ ifeq ($(RENDERTYPE),SDL)
endif
ifneq (0,$(HAVE_XMP))
- audiolib_cflags += -I$(libxmplite_inc)
- audiolib_deps += libxmplite
+ audiolib_cflags += `$(PKG_CONFIG) --cflags libxmp`
+ audiolib_deps +=
endif
@@ -704,7 +703,7 @@ ifeq ($(SUBPLATFORM),LINUX)
endif
ifeq ($(PLATFORM),BSD)
- LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo
+ LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo -llz4 -lxmp
endif
ifeq ($(PLATFORM),DARWIN)
@@ -1232,7 +1231,7 @@ endif
#### Final setup
-COMPILERFLAGS += \
+COMPILERFLAGS := \
-I$(engine_inc) \
-I$(mact_inc) \
-I$(audiolib_inc) \
@@ -1240,6 +1239,7 @@ COMPILERFLAGS += \
-I$(voidwrap_inc) \
-I$(libsmackerdec_inc) \
-MP -MMD \
+ $(COMPILERFLAGS)
ifneq (0,$(USE_PHYSFS))
COMPILERFLAGS += -I$(physfs_inc) -DUSE_PHYSFS
@@ -1260,7 +1260,6 @@ libraries := \
audiolib \
engine \
glad \
- libxmplite \
lpeg \
mact \
voidwrap \

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-source_audiolib_src_multivoc_cpp,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
use packaged libxmp instead of bundled libxmp-lite, works around
build issue when libxmp package is installed
Index: source/audiolib/src/multivoc.cpp
--- source/audiolib/src/multivoc.cpp.orig
+++ source/audiolib/src/multivoc.cpp
@@ -45,7 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Bos
#ifdef HAVE_XMP
# define BUILDING_STATIC
-# include "libxmp-lite/xmp.h"
+# include <xmp.h>
int MV_XMPInterpolation = XMP_INTERP_SPLINE;
#endif

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-source_audiolib_src_xmp_cpp,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
use packaged libxmp instead of bundled libxmp-lite, works around
build issue when libxmp package is installed
Index: source/audiolib/src/xmp.cpp
--- source/audiolib/src/xmp.cpp.orig
+++ source/audiolib/src/xmp.cpp
@@ -9,7 +9,7 @@
#include "pragmas.h"
#define BUILDING_STATIC
-#include "libxmp-lite/xmp.h"
+#include <xmp.h>
typedef struct {
void * ptr;

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-source_blood_src_blood_cpp,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
store log file in ~/.config/nblood/
Index: source/blood/src/blood.cpp
--- source/blood/src/blood.cpp.orig
+++ source/blood/src/blood.cpp
@@ -1536,6 +1536,9 @@ static int32_t check_filename_casing(void)
int app_main(int argc, char const * const * argv)
{
char buffer[BMAX_PATH];
+ char logpath[BMAX_PATH];
+ char *homedir;
+ int r;
margc = argc;
margv = argv;
#ifdef _WIN32
@@ -1562,7 +1565,22 @@ int app_main(int argc, char const * const * argv)
#endif
#endif
- OSD_SetLogFile(APPBASENAME ".log");
+ homedir = Bgethomedir();
+ if (!g_useCwd && homedir != NULL)
+ {
+ Bsnprintf(logpath, sizeof(logpath), "%s/.config/%s", homedir, APPBASENAME);
+ r = Bmkdir(logpath, S_IRWXU);
+ if (r == 0 || (r == -1 && errno == EEXIST))
+ {
+ Bsnprintf(logpath, sizeof(logpath), "%s/.config/%s/%s.log", homedir, APPBASENAME, APPBASENAME);
+ OSD_SetLogFile(logpath);
+ }
+ else
+ OSD_SetLogFile(APPBASENAME ".log");
+ }
+ else
+ OSD_SetLogFile(APPBASENAME ".log");
+ Bfree(homedir);
OSD_SetFunctions(NULL,
NULL,

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-source_exhumed_src_exhumed_cpp,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
store log file in ~/.config/pcexhumed/
Index: source/exhumed/src/exhumed.cpp
--- source/exhumed/src/exhumed.cpp.orig
+++ source/exhumed/src/exhumed.cpp
@@ -2216,6 +2216,9 @@ static int32_t nonsharedtimer;
int app_main(int argc, char const* const* argv)
{
char tempbuf[256];
+ char logpath[BMAX_PATH];
+ char *homedir;
+ int r;
#ifdef _WIN32
#ifndef DEBUGGINGAIDS
if (!G_CheckCmdSwitch(argc, argv, "-noinstancechecking") && !windowsCheckAlreadyRunning())
@@ -2240,7 +2243,22 @@ int app_main(int argc, char const* const* argv)
G_ExtPreInit(argc, argv);
- OSD_SetLogFile(APPBASENAME ".log");
+ homedir = Bgethomedir();
+ if (!g_useCwd && homedir != NULL)
+ {
+ Bsnprintf(logpath, sizeof(logpath), "%s/.config/%s", homedir, APPBASENAME);
+ r = Bmkdir(logpath, S_IRWXU);
+ if (r == 0 || (r == -1 && errno == EEXIST))
+ {
+ Bsnprintf(logpath, sizeof(logpath), "%s/.config/%s/%s.log", homedir, APPBASENAME, APPBASENAME);
+ OSD_SetLogFile(logpath);
+ }
+ else
+ OSD_SetLogFile(APPBASENAME ".log");
+ }
+ else
+ OSD_SetLogFile(APPBASENAME ".log");
+ Bfree(homedir);
OSD_SetFunctions(NULL,
NULL,

View File

@ -0,0 +1,51 @@
$OpenBSD: patch-source_rr_src_game_cpp,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
store log file in ~/.config/rednukem/
Index: source/rr/src/game.cpp
--- source/rr/src/game.cpp.orig
+++ source/rr/src/game.cpp
@@ -7785,6 +7785,9 @@ EDUKE32_STATIC_ASSERT(sizeof(DukePlayer_t)%4 == 0);
int app_main(int argc, char const * const * argv)
{
+ char logpath[BMAX_PATH];
+ char *homedir;
+ int r;
#ifndef NETCODE_DISABLE
if (enet_initialize() != 0)
initprintf("An error occurred while initializing ENet.\n");
@@ -7815,21 +7818,22 @@ int app_main(int argc, char const * const * argv)
G_ExtPreInit(argc, argv);
-#ifdef __APPLE__
- if (!g_useCwd)
+ homedir = Bgethomedir();
+ if (!g_useCwd && homedir != NULL)
{
- char cwd[BMAX_PATH];
- char *homedir = Bgethomedir();
- if (homedir)
- Bsnprintf(cwd, sizeof(cwd), "%s/Library/Logs/" APPBASENAME ".log", homedir);
+ Bsnprintf(logpath, sizeof(logpath), "%s/.config/%s", homedir, APPBASENAME);
+ r = Bmkdir(logpath, S_IRWXU);
+ if (r == 0 || (r == -1 && errno == EEXIST))
+ {
+ Bsnprintf(logpath, sizeof(logpath), "%s/.config/%s/%s.log", homedir, APPBASENAME, APPBASENAME);
+ OSD_SetLogFile(logpath);
+ }
else
- Bstrcpy(cwd, APPBASENAME ".log");
- OSD_SetLogFile(cwd);
- Bfree(homedir);
+ OSD_SetLogFile(APPBASENAME ".log");
}
else
-#endif
- OSD_SetLogFile(APPBASENAME ".log");
+ OSD_SetLogFile(APPBASENAME ".log");
+ Bfree(homedir);
OSD_SetFunctions(GAME_drawosdchar,
GAME_drawosdstr,

6
games/nblood/pkg/DESCR Normal file
View File

@ -0,0 +1,6 @@
Reverse-engineered ports of Build games using EDuke32 engine technology
and development principles.
NBlood: Blood port based on EDuke32
Rednukem: Redneck Rampage port based on EDuke32
PCExhumed: A port of the PC version of Exhumed based on EDuke32

26
games/nblood/pkg/PLIST Normal file
View File

@ -0,0 +1,26 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2020/01/01 02:28:07 jsg Exp $
@bin bin/nblood
@bin bin/pcexhumed
@bin bin/rednukem
share/doc/nblood/
share/doc/nblood/AUTHORS.md
share/doc/nblood/README.md
share/doc/nblood/buildlic.txt
share/doc/nblood/gpl-2.0.txt
share/examples/nblood/
share/examples/nblood/_clipshape0.map
share/examples/nblood/a.m32
share/examples/nblood/aspect.map
share/examples/nblood/dump_used_assets.m32
share/examples/nblood/m32script_ex.map
share/examples/nblood/r_usenewshading.map
share/examples/nblood/ror.map
share/examples/nblood/splitscr.con
share/examples/nblood/spriteclip.txt
share/examples/nblood/startpos.m32
share/examples/nblood/test_tileoffsets.map
share/examples/nblood/tests.m32
share/examples/nblood/trueror1.map
share/examples/nblood/weapons.sample.con
share/nblood/
share/rednukem/