diff options
author | jylefort <jylefort@FreeBSD.org> | 2005-10-29 22:17:01 +0800 |
---|---|---|
committer | jylefort <jylefort@FreeBSD.org> | 2005-10-29 22:17:01 +0800 |
commit | cabba717084031d98525e4bee311cb773c460ab3 (patch) | |
tree | 6b965ccc4c5c63642cf7e0df35232689864857c5 /games/dangerdeep | |
parent | 3a4bdad1c1f50e8ef1f99c115b8287774128d781 (diff) | |
download | freebsd-ports-gnome-cabba717084031d98525e4bee311cb773c460ab3.tar.gz freebsd-ports-gnome-cabba717084031d98525e4bee311cb773c460ab3.tar.zst freebsd-ports-gnome-cabba717084031d98525e4bee311cb773c460ab3.zip |
Add dangerdeep.
Danger from the deep (aka dangerdeep) is a Free / Open Source World War II
German submarine simulation. It is currently available for FreeBSD, Linux/i386
and Windows, but since it uses SDL/OpenGL it should be portable to other
operating systems or platforms.
WWW: http://dangerdeep.sourceforge.net/
PR: ports/88168
Submitted by: Jose Alonso Cardenas Marquez <acardenas@bsd.org.pe>
Diffstat (limited to 'games/dangerdeep')
-rw-r--r-- | games/dangerdeep/Makefile | 72 | ||||
-rw-r--r-- | games/dangerdeep/distinfo | 2 | ||||
-rw-r--r-- | games/dangerdeep/files/patch-SConstruct | 72 | ||||
-rw-r--r-- | games/dangerdeep/files/patch-src_coastmap.cpp | 11 | ||||
-rw-r--r-- | games/dangerdeep/pkg-descr | 6 |
5 files changed, 163 insertions, 0 deletions
diff --git a/games/dangerdeep/Makefile b/games/dangerdeep/Makefile new file mode 100644 index 000000000000..19393e42bb53 --- /dev/null +++ b/games/dangerdeep/Makefile @@ -0,0 +1,72 @@ +# New ports collection makefile for: dangerdeep +# Date created: 2005-10-28 +# Whom: Jose Alonso Cardenas Marquez <acardenas@bsd.org.pe> +# +# $FreeBSD$ +# + +PORTNAME= dangerdeep +PORTVERSION= 0.1.0 +CATEGORIES= games +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= dangerdeep + +MAINTAINER= acardenas@bsd.org.pe +COMMENT= Open source World War II German submarine simulation + +BUILD_DEPENDS= scons:${PORTSDIR}/devel/scons +LIB_DEPENDS= fftw3.3:${PORTSDIR}/math/fftw3 + +USE_X_PREFIX= yes +USE_GL= yes +USE_SDL= sdl mixer image net +USE_REINPLACE= yes + +MAKE_ENV= CC="${CC}" CXX="${CXX}" +SCONS_ARGS= installbindir=${PREFIX}/bin installdatadir=${DATADIR} + +PLIST= ${WRKDIR}/pkg-plist +PLIST_FILES= bin/dangerdeep +PLIST_DIRS= %%DATADIR%% + +MAN6= dangerdeep.6 +PORTDOCS= CREDITS README + +.include <bsd.port.pre.mk> + +.if ${OSVERSION} < 500000 +IGNORE= does not build on FreeBSD 4.x +.endif + +.if defined(PACKAGE_BUILDING) +SCONS_ARGS+= usex86sse=-1 # disable MMX/SSE on the build cluster +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|/usr/share/games/dangerdeep|${DATADIR}|; \ + s|Linux|"Danger from the Deep"|' ${WRKSRC}/doc/man/dangerdeep.6 + +do-build: + @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} scons ${SCONS_ARGS} + +pre-install: + @${RM} -f ${PLIST} + @cd ${WRKSRC}/data && \ + ${FIND} * -type f | ${SORT} | ${SED} -e 's|^|%%DATADIR%%/|' >> ${PLIST} && \ + ${FIND} * -type d | ${SORT} -r | ${SED} -e 's|^|@dirrm %%DATADIR%%/|' >> ${PLIST} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/build/freebsd/dangerdeep ${PREFIX}/bin + + cd ${WRKSRC}/data && \ + ${FIND} * -type d -exec ${MKDIR} "${DATADIR}/{}" \; && \ + ${FIND} * -type f -exec ${INSTALL_DATA} "{}" "${DATADIR}/{}" \; + + ${INSTALL_MAN} ${WRKSRC}/doc/man/dangerdeep.6 ${PREFIX}/man/man6 + +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${DOCSDIR} +.endif + +.include <bsd.port.post.mk> diff --git a/games/dangerdeep/distinfo b/games/dangerdeep/distinfo new file mode 100644 index 000000000000..e8622d79d26d --- /dev/null +++ b/games/dangerdeep/distinfo @@ -0,0 +1,2 @@ +MD5 (dangerdeep-0.1.0.tar.gz) = 7e95d871b929a5e322d0a6bde37e7151 +SIZE (dangerdeep-0.1.0.tar.gz) = 12429406 diff --git a/games/dangerdeep/files/patch-SConstruct b/games/dangerdeep/files/patch-SConstruct new file mode 100644 index 000000000000..6185b0867f40 --- /dev/null +++ b/games/dangerdeep/files/patch-SConstruct @@ -0,0 +1,72 @@ +--- SConstruct.orig Mon Oct 17 20:45:59 2005 ++++ SConstruct Sat Oct 29 14:30:06 2005 +@@ -2,6 +2,11 @@ + import os + import sys + ++################ FreeBSD port variables ++LOCALBASE = os.environ['LOCALBASE'] ++X11BASE = os.environ['X11BASE'] ++SDL_CONFIG = os.environ['SDL_CONFIG'] ++ + ################ global config values + version = '0.1.0' + if ARGUMENTS.get('version', 0): +@@ -67,10 +72,12 @@ + else: + print "Compiling for Unix/Posix/Linux Environment" + env = Environment(ENV = os.environ) +- env.Append(CPPPATH = ['/usr/include/SDL', '/usr/include/GL']) +- libpath = ['/usr/X11R6/lib'] ++ env.Replace(CC = os.environ['CC']) ++ env.Replace(CXX = os.environ['CXX']) ++ env.Append(CPPPATH = [LOCALBASE + '/include', LOCALBASE + '/include/SDL11', X11BASE + '/include', X11BASE + '/include/GL']) ++ libpath = [LOCALBASE + '/lib', X11BASE + '/lib'] + gllibs = ['GL', 'GLU'] +- sdllibs = ['SDL', 'SDL_image'] ++ sdllibs = ['SDL_image'] + ccflags = '-Wall `sdl-config --cflags`' + if (debug >= 3): + ccflags += ' -g -pg -O3' # profiling +@@ -92,31 +99,28 @@ + if (cvedit == 1): + env.Append(CPPDEFINES = ['CVEDIT']) + # check for mmx/sse support +- cpuinfof = open('/proc/cpuinfo', 'r') ++ cpuinfof = os.popen('sysctl -n hw.instruction_sse') + cpuinfol = cpuinfof.readlines() + mmxsupported = False + ssesupported = False + for i in cpuinfol: +- if i.startswith('flags'): +- m = Split(i) +- for j in m: +- if j == 'mmx': +- mmxsupported = True +- elif j == 'sse': +- ssesupported = True +- break ++ if i == '1\n': ++ mmxsupported = True ++ ssesupported = True + if (usex86sse == 0) and (mmxsupported and ssesupported): + usex86sse = 1 + if usex86sse >= 1: + env.Append(CPPDEFINES = ['USE_SSE']) + osspecificsrc += ['water_sse.cpp'] + print 'Using x86 SSE/MMX optimizations.' +- env.Append(CCFLAGS = ccflags) ++ env.Replace(CCFLAGS = os.environ['CFLAGS']) ++ env.Replace(CXXFLAGS = os.environ['CXXFLAGS'] + ' `' + SDL_CONFIG + ' --cflags`') ++ env.Append(LINKFLAGS = '`' + SDL_CONFIG + ' --libs`') + datadir = installdatadir +- build_dir = 'linux' ++ build_dir = 'freebsd' + # check for broken libGL, ignore undefined symbols then +- if (os.system('grep glBindProgram /usr/include/GL/gl*.h > /dev/null') == 0): +- gllibdirs = ['/usr/X11R6/lib/', '/usr/lib/', '/usr/local/lib/'] ++ if (os.system('grep glBindProgram ' + X11BASE + '/include/GL/gl*.h > /dev/null') == 0): ++ gllibdirs = [X11BASE + '/lib/', '/usr/lib/', LOCALBASE + '/lib/'] + gllibdir = '' + for i in gllibdirs: + if (os.system('test -f '+i+'libGL.so') == 0): diff --git a/games/dangerdeep/files/patch-src_coastmap.cpp b/games/dangerdeep/files/patch-src_coastmap.cpp new file mode 100644 index 000000000000..3d225aa265fc --- /dev/null +++ b/games/dangerdeep/files/patch-src_coastmap.cpp @@ -0,0 +1,11 @@ +--- src/coastmap.cpp Mon Jul 18 16:19:30 2005 ++++ src/coastmap.cpp Fri Oct 28 15:30:30 2005 +@@ -1316,7 +1316,7 @@ + maph = surf->h; + pixelw_real = realwidth/mapw; + realheight = maph*realwidth/mapw; +- pixels_per_seg = 1 << unsigned(ceil(log2(60000/pixelw_real))); ++ pixels_per_seg = 1 << unsigned(ceil(log(60000/pixelw_real))); + segsx = mapw/pixels_per_seg; + segsy = maph/pixels_per_seg; + segw_real = pixelw_real * pixels_per_seg; diff --git a/games/dangerdeep/pkg-descr b/games/dangerdeep/pkg-descr new file mode 100644 index 000000000000..5d14b30a85b7 --- /dev/null +++ b/games/dangerdeep/pkg-descr @@ -0,0 +1,6 @@ +Danger from the deep (aka dangerdeep) is a Free / Open Source World War II +German submarine simulation. It is currently available for FreeBSD, Linux/i386 +and Windows, but since it uses SDL/OpenGL it should be portable to other +operating systems or platforms. + +WWW: http://dangerdeep.sourceforge.net/ |