Skip to content

Commit

Permalink
Add games/gnukem, a Duke Nukem-inspired game.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibara committed Apr 26, 2019
1 parent ea432ad commit e51e3a3
Show file tree
Hide file tree
Showing 10 changed files with 234 additions and 0 deletions.
1 change: 1 addition & 0 deletions FINISHED
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ games/openhexagon sent to ports@ (bcallah)
math/ebc ready to import (bcallah)
lang/voc ready to import (bcallah)
games/freesynd ready to import (bcallah)
games/gnukem ready to import (bcallah)
38 changes: 38 additions & 0 deletions games/gnukem/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# $OpenBSD$

COMMENT = open source retro-style 2D scrolling platform shooter game
DISTNAME = gnukem-1.0
CATEGORIES = games x11

HOMEPAGE = https://djoffe.com/gnukem/
MAINTAINER = Brian Callahan <bcallah@openbsd.org>

# Dual licensed: MIT or GPLv2 only
PERMIT_PACKAGE_CDROM = Yes

WANTLIB += ${COMPILER_LIBCXX} SDL SDL_mixer c m

# Upstream data fetching is ugh...
MASTER_SITES = https://mirrors.nycbug.org/pub/distfiles/

LIB_DEPENDS = devel/sdl-mixer

USE_GMAKE = Yes
ALL_TARGET = default
MAKE_FLAGS = CC="${CC}" CPP="${CXX}" \
CXXFLAGS="${CXXFLAGS}"

NO_TEST = Yes

# No install routine
do-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/gnukem/data
cd ${WRKSRC}/data && find * -type d -exec ${INSTALL_DATA_DIR} \
"${PREFIX}/share/gnukem/data/{}" \;
cd ${WRKSRC}/data && find * -type f -exec ${INSTALL_DATA} \
"{}" "${PREFIX}/share/gnukem/data/{}" \;
echo "#!/bin/sh\ncd ${TRUEPREFIX}/share/gnukem && ./davegnukem \"\$$@\"" >> ${WRKSRC}/gnukem.sh
${INSTALL_PROGRAM} ${WRKSRC}/davegnukem ${PREFIX}/share/gnukem
${INSTALL_SCRIPT} ${WRKSRC}/gnukem.sh ${PREFIX}/bin/davegnukem

.include <bsd.port.mk>
2 changes: 2 additions & 0 deletions games/gnukem/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SHA256 (gnukem-1.0.tar.gz) = KOX8oFvgtUKGmrP9x8J2dNr9VvfPFmzFp+2dFDxMDKs=
SIZE (gnukem-1.0.tar.gz) = 20553539
30 changes: 30 additions & 0 deletions games/gnukem/patches/patch-Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$OpenBSD$

Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -8,8 +8,8 @@
# 2017-07-29: Remove obsolete standalone-editor-related stuff, and add new thing_monsters.o
#

-CPP = g++
-CC = gcc
+CPP ?= g++
+CC ?= gcc


# dj2016-10 Add L -I/usr/local/include/SDL in process of getting this working on Mac OS X - not sure if this is 'bad' to just have both /usr/include and /usr/local/include??
@@ -21,11 +21,11 @@ INCLUDEDIRS= -I/usr/include/SDL -I/usr/local/include/S
# If you don't -DDATA_DIR to a valid dir, then data files will be assumed
# to be in current directory
#CCFLAGS = -Wall -I/usr/local/include -DHAVE_SOUND -DDEBUG -O -m486
-CCFLAGS = -Wall -Wno-switch -DDEBUG $(INCLUDEDIRS)
+CCFLAGS = ${CXXFLAGS} -Wall -Wno-switch -I${LOCALBASE}/include/SDL
#Release version:
#CCFLAGS = -O -Wall -I/usr/local/include -DHAVE_SOUND $(INCLUDEDIRS)

-LIBS = -lSDL -lSDLmain -lSDL_mixer -lpthread
+LIBS = -L${LOCALBASE}/lib -lSDL -lSDLmain -lSDL_mixer -lpthread
BIN = davegnukem


14 changes: 14 additions & 0 deletions games/gnukem/patches/patch-src_datadir_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$OpenBSD$

Index: src/datadir.h
--- src/datadir.h.orig
+++ src/datadir.h
@@ -10,6 +10,8 @@ Copyright (C) 1999-2018 David Joffe
#define _DATADIR_H_

//! Data directory [dj2017-08 should this move to config.h?]
+#ifndef DATA_DIR
#define DATA_DIR "data/"
+#endif

#endif
14 changes: 14 additions & 0 deletions games/gnukem/patches/patch-src_game_cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$OpenBSD$

Index: src/game.cpp
--- src/game.cpp.orig
+++ src/game.cpp
@@ -2014,7 +2014,7 @@ bool HeroIsHurting()
void DrawHealth()
{
// Build a string representing health bars (which are in the 8x8 font)
- char szHealth[MAX_HEALTH+1]={0};
+ unsigned char szHealth[MAX_HEALTH+1]={0};
for ( unsigned int i=0; i<MAX_HEALTH; ++i )
{
// 170 = health; 169 = not health
14 changes: 14 additions & 0 deletions games/gnukem/patches/patch-src_sdl_djsound_cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$OpenBSD$

Index: src/sdl/djsound.cpp
--- src/sdl/djsound.cpp.orig
+++ src/sdl/djsound.cpp
@@ -13,7 +13,7 @@ Copyright (C) 1999-2018 David Joffe and Kent Mein
#include <SDL_mixer.h>
#endif

-#ifdef __APPLE__
+#ifdef __OpenBSD__
#include <stdlib.h>//Fixing malloc.h 'not found' error compiling on Mac [dj2016-10]
#else
#include <malloc.h>
14 changes: 14 additions & 0 deletions games/gnukem/patches/patch-src_sys_defs_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$OpenBSD$

Index: src/sys_defs.h
--- src/sys_defs.h.orig
+++ src/sys_defs.h
@@ -21,7 +21,7 @@ extern "C"
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
-#ifdef __APPLE__
+#ifdef __OpenBSD__
#include <stdlib.h>//Fixing malloc.h 'not found' error compiling on Mac [dj2016-10]
#else
#include <malloc.h>
5 changes: 5 additions & 0 deletions games/gnukem/pkg/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dave Gnukem is an open source retro-style 2D scrolling platform shooter,
inspired by and similar to Duke Nukem 1 (a famous original 1991 game
that launched the Duke Nukem series). It features an integrated level
editor. (Please note this is not a 'clone' or a 're-make'; it is
probably most akin to a parody.)
102 changes: 102 additions & 0 deletions games/gnukem/pkg/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
@comment $OpenBSD: PLIST,v$
bin/davegnukem
share/gnukem/
share/gnukem/data/
share/gnukem/data/credits.tga
share/gnukem/data/default.gam
share/gnukem/data/editor/
share/gnukem/data/editor/macros.txt
share/gnukem/data/emh/
share/gnukem/data/emh/nextm1.lev
share/gnukem/data/emh/nextm2.lev
share/gnukem/data/font.tga
share/gnukem/data/fonts/
share/gnukem/data/fonts/simple_6x8.tga
share/gnukem/data/fonts/simple_6x8_shadow.tga
share/gnukem/data/gameskin.tga
share/gnukem/data/hiscores.tga
share/gnukem/data/icon/
share/gnukem/data/icon.bmp
share/gnukem/data/icon/application_icon.ico
share/gnukem/data/levels/
share/gnukem/data/levels/bg1.tga
share/gnukem/data/levels/bg2.tga
share/gnukem/data/levels/citybackdrop.tga
share/gnukem/data/levels/d_lev1.lev
share/gnukem/data/levels/dj0.lev
share/gnukem/data/levels/example.lev
share/gnukem/data/levels/foo.lev
share/gnukem/data/levels/kevin.lev
share/gnukem/data/levels/level1.lev
share/gnukem/data/levels/level2.lev
share/gnukem/data/levels/level3.lev
share/gnukem/data/levels/sjm001.lev
share/gnukem/data/levels/sjm2.lev
share/gnukem/data/levels/template.lev
share/gnukem/data/main.tga
share/gnukem/data/menucharbackground.tga
share/gnukem/data/missions.txt
share/gnukem/data/music/
share/gnukem/data/music/eric_matyas/
share/gnukem/data/music/eric_matyas/8-Bit-Mayhem.ogg
share/gnukem/data/music/eric_matyas/Dystopic-Mayhem.ogg
share/gnukem/data/music/eric_matyas/Escape_Looping.ogg
share/gnukem/data/music/eric_matyas/Funky-Gameplay_Looping.ogg
share/gnukem/data/music/eric_matyas/Insane-Gameplay_Looping.ogg
share/gnukem/data/music/eric_matyas/Mad-Scientist_Looping.ogg
share/gnukem/data/music/eric_matyas/Monkey-Drama.ogg
share/gnukem/data/music/eric_matyas/Monster-Street-Fighters.ogg
share/gnukem/data/music/eric_matyas/Monsters-in-Bell-Bottoms_Looping.ogg
share/gnukem/data/music/eric_matyas/Retro-Frantic_V001_Looping.ogg
share/gnukem/data/music/eric_matyas/Techno-Caper.ogg
share/gnukem/data/music/eric_matyas/Techno-Gameplay_Looping.ogg
share/gnukem/data/music/eric_matyas/The-Darkness-Below_Looping.ogg
share/gnukem/data/sample.gam
share/gnukem/data/shadows.tga
share/gnukem/data/simplefont.tga
share/gnukem/data/sounds/
share/gnukem/data/sounds/cardflip.wav
share/gnukem/data/sounds/exit.ogg
share/gnukem/data/sounds/explode.wav
share/gnukem/data/sounds/jump.wav
share/gnukem/data/sounds/jump_landing.wav
share/gnukem/data/sounds/key_pickup.wav
share/gnukem/data/sounds/laser.wav
share/gnukem/data/sounds/laser2.wav
share/gnukem/data/sounds/lightmag.wav
share/gnukem/data/sounds/pickup.wav
share/gnukem/data/sounds/sfx_weapon_singleshot7.wav
share/gnukem/data/sounds/shoot_cg1_modified.wav
share/gnukem/data/sounds/soft_explode.wav
share/gnukem/data/sounds/wooeep.wav
share/gnukem/data/sprites/
share/gnukem/data/sprites/def0spr.dat
share/gnukem/data/sprites/def1spr.dat
share/gnukem/data/sprites/def2spr.dat
share/gnukem/data/sprites/def3spr.dat
share/gnukem/data/sprites/def4spr.dat
share/gnukem/data/sprites/def5spr.dat
share/gnukem/data/sprites/def6spr.dat
share/gnukem/data/sprites/def7spr.dat
share/gnukem/data/sprites/sprites00.tga
share/gnukem/data/sprites/sprites01.tga
share/gnukem/data/sprites/sprites02.tga
share/gnukem/data/sprites/sprites03.tga
share/gnukem/data/sprites/sprites04.tga
share/gnukem/data/sprites/sprites05.tga
share/gnukem/data/sprites/sprites06.tga
share/gnukem/data/sprites/sprites07.tga
share/gnukem/data/sprites/sprites16.tga
share/gnukem/data/sprites/sprites16_metadata.dat
share/gnukem/data/tog/
share/gnukem/data/tog/tog-bg-black.tga
share/gnukem/data/tog/tog-lev_0.lev
share/gnukem/data/tog/tog-lev_1.lev
share/gnukem/data/tog/tog-lev_2.lev
share/gnukem/data/tog/tog-lev_3.lev
share/gnukem/data/tog/tog-spr_16.bmp
share/gnukem/data/tog/tog-spr_16.dat
share/gnukem/data/tog/tog-spr_16.tga
share/gnukem/data/tog/tog.gam
share/gnukem/data/tog/zz-empty.lev
@bin share/gnukem/davegnukem

0 comments on commit e51e3a3

Please # to comment.