1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

Add duke3d 20012306, icculus Duke Nukem 3D port for various Operating

Systems.

WWW:  http://www.icculus.org/duke3d/

PR:		ports/63082
Submitted by:	arundel@gmx.net
This commit is contained in:
Clement Laforet 2004-04-18 19:22:45 +00:00
parent f890ae4b23
commit 45886ec3a1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=107476
14 changed files with 301 additions and 0 deletions

View File

@ -97,6 +97,7 @@
SUBDIR += dopewars
SUBDIR += drm
SUBDIR += dsnake
SUBDIR += duke3d
SUBDIR += dungeon
SUBDIR += dungeoncrawl
SUBDIR += easysok

86
games/duke3d/Makefile Normal file
View File

@ -0,0 +1,86 @@
# New ports collection makefile for: duke3d
# Date Created: 18 September 2003
# Whom: <arundel@gmx.net>
#
# $FreeBSD$
PORTNAME= duke3d
PORTVERSION= 20012306
CATEGORIES= games
MASTER_SITES= http://sheepkiller.nerim.net/ports/${PORTNAME}/
#DISTNAME= ${PORTNAME}-${PORTVERSION}
MAINTAINER= arundel@gmx.net
COMMENT= Icculus Duke Nukem 3D port for various Operating Systems
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
NO_CDROM= yes
USE_XLIB= yes
USE_GMAKE= yes
USE_SDL= mixer sdl
NO_PACKAGE= yes
USE_REINPLACE= yes
REINPLACE_ARGS=
WRKSRC= ${WRKDIR}/${PORTNAME}
TARGET_DIR= ${LOCALBASE}/${PORTNAME}
DATA_FILES= defs.con game.con user.con
PROG_FILES= ${WRKSRC}/source/${PORTNAME} ${WRKSRC}/source/buildengine/build
DOC_FILES1= README BUILDLIC.TXT CONTRIB TODO CHANGELOG ../../readme.txt ../../gnu.txt
pre-everything::
.ifndef(WITHOUT_DOSBOX)
@${ECHO_MSG} ""
@${ECHO_MSG} "Define WITHOUT_DOSBOX to disable the dependency on dosbox."
@${ECHO_MSG} "Then however you will not be able to change the Duke3D config."
@${ECHO_MSG} ""
RUN_DEPENDS= ${LOCALBASE}/bin/dosbox:${PORTSDIR}/emulators/dosbox
.endif
post-patch:
@${SED} -e 's|%%DUKEDIR%%|${PREFIX}/${PORTNAME}|g' ${FILESDIR}/fix.sh > \
${WRKDIR}/fix.sh
@${SED} -e 's|%%DUKEDIR%%|${PREFIX}/${PORTNAME}|g' ${FILESDIR}/wrapper.sh > \
${WRKDIR}/wrapper.sh
@${FIND} ${WRKSRC} -name "*.[ch]" | ${XARGS} ${REINPLACE_CMD}-i.bak -e \
's|malloc\.h|stdlib.h|g'
@${FIND} ${WRKSRC} -name "Makefile" | ${XARGS} ${REINPLACE_CMD}-i.bak -e \
's|sdl-config|${SDL_CONFIG}|g ; s|%%X11BASE%%|${X11BASE}|g ; \
s|%%CFLAGS%%|${CFLAGS} -I${X11BASE}/include|g'
do-build:
cd ${WRKSRC}/source/buildengine && ${GMAKE}
cd ${WRKSRC}/source && ${GMAKE}
do-install:
${INSTALL} -d ${TARGET_DIR}
${INSTALL_PROGRAM} ${PROG_FILES} ${TARGET_DIR}
${INSTALL_SCRIPT} ${WRKDIR}/fix.sh ${TARGET_DIR}
${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${TARGET_DIR}/duke.sh
${INSTALL} -d ${TARGET_DIR}/testdata
.for file in ${DATA_FILES}
${INSTALL_DATA} ${WRKSRC}/testdata/${file} ${TARGET_DIR}/testdata
.endfor
${LN} -s ${TARGET_DIR}/duke.sh ${LOCALBASE}/bin/duke3d
post-install:
.if !defined(NOPORTDOCS)
${INSTALL} -d ${DOCSDIR}
.for file in ${DOC_FILES1}
${INSTALL_MAN} ${WRKSRC}/source/buildengine/${file} ${DOCSDIR}
.endfor
${REINPLACE_CMD}-e 's|%%DUKEDIR%%|${PREFIX}/${PORTNAME}|g' ${FILESDIR}/README.bsd > \
${DOCSDIR}/README.bsd
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

2
games/duke3d/distinfo Normal file
View File

@ -0,0 +1,2 @@
MD5 (duke3d-20012306.tar.gz) = 943f283602acf4569d66fcef3135f11f
SIZE (duke3d-20012306.tar.gz) = 1787957

View File

@ -0,0 +1,20 @@
You need to copy the following files from the Duke Nukem 3D CD-ROM or from the Sharware
release to %%DUKEDIR%%:
DUKE3D.GRP
DUKE3D.CFG
SETUP.EXE
SETMAIN.EXE
Afterwards you have to run %%DUKEDIR%%/fix.sh
If you want to edit your config run dosbox, mount %%DUKEDIR%%
and run SETUP.EXE. Be sure you have write permission. Otherwise your
changes will get lost.
WARNING: Icculus Duke3D port is still in alpha stage and runs very slowly!
Thx go out to
mezz @ bsdforums.org for cleaning up the code and testing it on -CURRENT
clement for his problem reports

42
games/duke3d/files/fix.sh Normal file
View File

@ -0,0 +1,42 @@
#!/bin/sh
cd %%DUKEDIR%%
if [ ! -d %%DUKEDIR%% ] || [ ! -w %%DUKEDIR%% ]
then
echo You do not have permission to write to %%DUKEDIR%%.
exit
fi
if [ ! -d testdata ]
then
echo testdata directory is missing
exit
fi
if [ ! -f testdata/defs.con ] || [ ! -f testdata/game.con ] || [ ! -f testdata/user.con ]
then
echo At least one resource file in testdata is missing
exit
fi
if [ -f DEFS.CON ]
then
echo Backing up original DEFS.CON to DEFS.BAK
cp DEFS.CON DEFS.BAK
fi
if [ -f GAME.CON ]
then
echo Backing up original GAME.CON to GAME.BAK
cp GAME.CON GAME.BAK
fi
if [ -f USER.CON ]
then
echo Backing up original USER.CON to USER.BAK
cp USER.CON USER.BAK
fi
cp -f testdata/defs.con ./DEFS.CON
cp -f testdata/game.con ./GAME.CON
cp -f testdata/user.con ./USER.CON

View File

@ -0,0 +1,24 @@
--- source/buildengine/Makefile.orig Sat Mar 13 22:12:13 2004
+++ source/buildengine/Makefile Sat Mar 13 22:46:31 2004
@@ -100,7 +100,7 @@
SDL_LDFLAGS := $(shell sdl-config --libs)
endif
-CC = gcc
+#CC = gcc
# Uncomment to use the Intel compiler (v6.0)
# Note: Version 6.0 Build 020312Z fails to compile engine.c
@@ -194,9 +194,9 @@
ENGINEDIR = .
ASMFLAGS = -f $(ASMOBJFMT) $(ASMDEFS)
-LINKER = gcc
-CFLAGS += $(USE_ASM) -funsigned-char -O2 -DPLATFORM_UNIX -g -Wall $(SDL_CFLAGS) -fno-omit-frame-pointer
-LDFLAGS += -g $(SDL_LDFLAGS)
+LINKER = $(CC)
+CFLAGS += %%CFLAGS%% $(USE_ASM) -funsigned-char -DPLATFORM_UNIX -Wall $(SDL_CFLAGS) -fno-omit-frame-pointer
+LDFLAGS += -L%%X11BASE%%/lib $(SDL_LDFLAGS)
# Rules for turning source files into .o files
%.o: %.c

View File

@ -0,0 +1,20 @@
*** source/buildengine/mmulti.c.orig Sat Jun 7 08:58:45 2003
--- source/buildengine/mmulti.c Thu Sep 18 02:24:25 2003
***************
*** 916,929 ****
if (!set_socket_blockmode(0))
return(0);
- #if !PLATFORM_WIN32 && !PLATFORM_MACOSX
- {
- /* Linux-specific. */
- int flags = 1;
- setsockopt(udpsocket, SOL_IP, IP_RECVERR, &flags, sizeof (flags));
- }
- #endif
-
memset(&addr, '\0', sizeof (addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl(ip);
--- 916,921 ----

View File

@ -0,0 +1,30 @@
--- source/Makefile.orig Sat Mar 13 22:51:27 2004
+++ source/Makefile Sat Mar 13 22:53:11 2004
@@ -86,15 +86,14 @@
BUILDOBJS += buildengine/a.o
endif
-CC = gcc
-CFLAGS = -c -g $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -W -Wall -Wno-unused $(EXTRACFLAGS) -funsigned-char
-OPTIMIZE = -O2
+#CC = gcc
+CFLAGS = -c %%CFLAGS%% $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -W -Wall -Wno-unused $(EXTRACFLAGS) -funsigned-char
# Uncomment this to compile with the Intel compiler (v6.0)
#CC = icc
#CFLAGS = -g $(SDL_CFLAGS) -DUSE_SDL=1 -DPLATFORM_UNIX=1 -DUSE_I386_ASM=1 $(EXTRACFLAGS) -O2
-LDLIBS = $(SDL_LDFLAGS) -lSDL -lSDL_mixer $(EXTRALDFLAGS)
+LDLIBS = $(SDL_LDFLAGS) -lSDL_mixer $(EXTRALDFLAGS) -L%%X11BASE%%/lib
# !!! FIXME: Do we even need this? It doesn't fly on MacOS X. --ryan.
#LDLIBS += -Wl,-E
@@ -103,7 +102,7 @@
%.o : %.c
- $(CC) $(CFLAGS) $(OPTIMIZE) -o $@ $<
+ $(CC) $(CFLAGS) -o $@ $<
# Animation playback crashes due to optimization error on MacOS X. --ryan.
ifeq ($(strip $(macosx)),true)

View File

@ -0,0 +1,15 @@
--- source/audiolib/Makefile.orig Sat Mar 13 22:54:17 2004
+++ source/audiolib/Makefile Sat Mar 13 23:06:25 2004
@@ -1,8 +1,8 @@
-CC=gcc
-AR=ar
+#CC=gcc
+#AR=ar
RANLIB=ranlib
-CFLAGS=-g -O2
-LDLIBS=
+CFLAGS= %%CFLAGS%%
+LDLIBS= -L%%X11BASE%%/lib
CFLAGS += $(shell sdl-config --cflags)
LDLIBS += $(shell sdl-config --libs)

View File

@ -0,0 +1,12 @@
--- source/buildengine/tests/Makefile.orig Sat Mar 13 18:29:03 2004
+++ source/buildengine/tests/Makefile Sat Mar 13 18:29:36 2004
@@ -1,7 +1,7 @@
BINARIES=sartest kreciptest
OBJS=kreciptest.o krecip.o sartest.o sar.o
-CFLAGS=-g -Wall
-CC=gcc
+CFLAGS+= %%CFLAGS%% -Wall
+#CC=gcc
ASM=nasm
all: kreciptest sartest

View File

@ -0,0 +1,6 @@
#!/bin/sh
# Needed to make symlinks/shortcuts work.
# Wrap lsdldoom binary
cd %%DUKEDIR%%
./duke3d $*
exit $?

19
games/duke3d/pkg-descr Normal file
View File

@ -0,0 +1,19 @@
Duke3D for Linux
This port was done by Dan Olson, Steven Fuller, and Ryan C. Gordon,
with contributions from David Koenig, Dave Watson, among others.
The real nasty part (porting the Build Engine) was the work of:
* Ryan C. Gordon
* Dan Olson
* Andrew Henderson
* Christian Zander
* Adrian Neill
* Matt Helsley
* Nicholas Vining
* Matt Saettler
* Steven Fuller
* A cast of thousands.
WWW: http://www.icculus.org/duke3d/

5
games/duke3d/pkg-message Normal file
View File

@ -0,0 +1,5 @@
-----------------------------------------------------------------
Duke Nukem 3D is successfully installed.
Please copy your Duke 3D data to ${PREFIX}/duke3d directory and
read http://www.icculus.org/duke3d/
-----------------------------------------------------------------

19
games/duke3d/pkg-plist Normal file
View File

@ -0,0 +1,19 @@
duke3d/duke3d
duke3d/duke.sh
duke3d/build
duke3d/fix.sh
duke3d/testdata/defs.con
duke3d/testdata/game.con
duke3d/testdata/user.con
bin/duke3d
%%PORTDOCS%%%%DOCSDIR%%/README.bsd
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/BUILDLIC.TXT
%%PORTDOCS%%%%DOCSDIR%%/CONTRIB
%%PORTDOCS%%%%DOCSDIR%%/TODO
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
%%PORTDOCS%%%%DOCSDIR%%/readme.txt
%%PORTDOCS%%%%DOCSDIR%%/gnu.txt
@dirrm share/doc/duke3d
@dirrm duke3d/testdata
@unexec rmdir duke3d 2> /dev/null || true