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

Add 0ad, real-time strategy (RTS) game of ancient warfare.

Approved by:	crees (mentor)
This commit is contained in:
Guido Falsi 2012-05-25 07:05:33 +00:00
parent 91c1992b0d
commit 8beed3b01c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=297380
14 changed files with 288 additions and 0 deletions

78
games/0ad/Makefile Normal file
View File

@ -0,0 +1,78 @@
# New ports collection makefile for: 0ad
# Date created: 13 Jan 2012
# Whom: Guido Falsi <mad@madpilot.net>
#
# $FreeBSD$
#
PORTNAME= 0ad
DISTVERSION= alpha.10
CATEGORIES= games
MASTER_SITES= SF/zero-ad/releases
DISTFILES= ${PORTNAME}-${SVNREV}-alpha-unix-build.tar.xz \
${PORTNAME}-${SVNREV}-alpha-unix-data.tar.xz
MAINTAINER= madpilot@FreeBSD.org
COMMENT= Real-time strategy (RTS) game of ancient warfare
BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash \
zip:${PORTSDIR}/archivers/zip \
cmake:${PORTSDIR}/devel/cmake
LIB_DEPENDS= boost_thread:${PORTSDIR}/devel/boost-libs \
execinfo:${PORTSDIR}/devel/libexecinfo \
png:${PORTSDIR}/graphics/png \
ogg:${PORTSDIR}/audio/libogg \
vorbis:${PORTSDIR}/audio/libvorbis \
curl:${PORTSDIR}/ftp/curl \
gamin-1:${PORTSDIR}/devel/gamin
WRKSRC= ${WRKDIR}/${PORTNAME}-${SVNREV}-alpha
BUILD_WRKSRC= ${WRKSRC}/build/workspaces/gcc
MAKE_ARGS= config=release
USE_GMAKE= yes
USE_XZ= yes
USE_SDL= sdl
USE_GNOME= libxml2 gtk20
USE_GL= gl
USE_OPENAL= al
USE_DOS2UNIX= yes
DOS2UNIX_REGEX= .*\.[ch]p{0,2}
MAKE_JOBS_SAFE= yes
USE_WX= 2.8
WX_COMPS= wx:lib
WX_UNICODE= yes
MAKE_ENV+= JOBS=${_MAKE_JOBS}
SVNREV= r11863
PORTDATA= *
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 800067
BROKEN= Does not compile on 7.x: Requires wcsnlen(3)
.endif
post-patch:
@${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' \
${WRKSRC}/build/premake/premake4.lua
@${REINPLACE_CMD} 's,^\(Exec=\)/usr/local,\1${PREFIX},' \
${WRKSRC}/build/resources/0ad.desktop
pre-build:
(cd ${WRKSRC}/build/workspaces && ${SETENV} ${MAKE_ENV} ./update-workspaces.sh --bindir=${PREFIX}/bin --datadir=${DATADIR} --libdir=${PREFIX}/lib/${PORTNAME})
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/pyrogenesis ${PREFIX}/bin
${INSTALL_SCRIPT} ${WRKSRC}/build/resources/0ad.sh ${PREFIX}/bin/0ad
${INSTALL_PROGRAM} ${WRKSRC}/binaries/system/ActorEditor ${PREFIX}/bin
${MKDIR} ${PREFIX}/lib/${PORTNAME}
(cd ${WRKSRC}/binaries/system && ${INSTALL_LIB} libAtlasUI.so libCollada.so libenet.so.1 libmozjs185-ps-release.so.1.0 libnvcore.so libnvimage.so libnvmath.so libnvtt.so ${PREFIX}/lib/${PORTNAME})
${MKDIR} ${PREFIX}/share/applications
${INSTALL_DATA} ${WRKSRC}/build/resources/0ad.desktop ${PREFIX}/share/applications
${INSTALL_DATA} ${WRKSRC}/build/resources/0ad.png ${PREFIX}/share/pixmaps
${MKDIR} ${DATADIR}
(cd ${WRKSRC}/binaries/data && ${COPYTREE_SHARE} "config mods tests tools" ${DATADIR})
.include <bsd.port.post.mk>

4
games/0ad/distinfo Normal file
View File

@ -0,0 +1,4 @@
SHA256 (0ad-r11863-alpha-unix-build.tar.xz) = 46c08d380ce098d3d8f577d04d602bb245dfbb7f7da7b1ad009e7a0d4751435f
SIZE (0ad-r11863-alpha-unix-build.tar.xz) = 8657204
SHA256 (0ad-r11863-alpha-unix-data.tar.xz) = 76702023402361d27b61eea37034b08e9e19b282e4cdd69954495d2dd087b90a
SIZE (0ad-r11863-alpha-unix-data.tar.xz) = 310994700

View File

@ -0,0 +1,32 @@
--- build/premake/premake4/build/gmake.unix/Premake4.make.orig 2012-01-12 01:03:37.000000000 +0100
+++ build/premake/premake4/build/gmake.unix/Premake4.make 2012-05-03 16:24:21.478971350 +0200
@@ -24,12 +24,12 @@
TARGETDIR = ../../bin/release
TARGET = $(TARGETDIR)/premake4
DEFINES += -DNDEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
- INCLUDES += -I../../src/host/lua-5.1.4/src
+ INCLUDES += -I../../src/host/lua-5.1.4/src -I$(LOCALBASE)/include/wx-2.8
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -Os
CXXFLAGS += $(CFLAGS)
LDFLAGS += -s -rdynamic
- LIBS += -lm -ldl
+ LIBS += -lm
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)
@@ -46,12 +46,12 @@
TARGETDIR = ../../bin/debug
TARGET = $(TARGETDIR)/premake4
DEFINES += -D_DEBUG -DLUA_USE_POSIX -DLUA_USE_DLOPEN
- INCLUDES += -I../../src/host/lua-5.1.4/src
+ INCLUDES += -I../../src/host/lua-5.1.4/src -I$(LOCALBASE)/include/wx-2.8
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) -Wall -g
CXXFLAGS += $(CFLAGS)
LDFLAGS += -rdynamic
- LIBS += -lm -ldl
+ LIBS += -lm
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(LDDEPS) $(LIBS)

View File

@ -0,0 +1,25 @@
--- build/premake/premake4.lua.orig 2012-02-21 21:27:25.000000000 +0100
+++ build/premake/premake4.lua 2012-05-17 23:23:30.211530880 +0200
@@ -215,7 +215,6 @@
-- enable security features (stack checking etc) that shouldn't have
-- a significant effect on performance and can catch bugs
- "-fstack-protector-all",
"-D_FORTIFY_SOURCE=2",
-- always enable strict aliasing (useful in debug builds because of the warnings)
@@ -276,11 +275,11 @@
-- X11 includes may be installed in one of a gadzillion of three places
-- Famous last words: "You can't include too much! ;-)"
includedirs {
- "/usr/X11R6/include/X11",
- "/usr/X11R6/include",
+ "%%LOCALBASE%%/X11",
+ "%%LOCALBASE%%/include",
"/usr/include/X11"
}
- libdirs { "/usr/X11R6/lib" }
+ libdirs { "%%LOCALBASE%%/lib" }
if _OPTIONS["bindir"] then
defines { "INSTALLED_BINDIR=" .. _OPTIONS["bindir"] }

View File

@ -0,0 +1,11 @@
--- build/resources/0ad.desktop.orig 2010-10-08 16:08:54.000000000 +0200
+++ build/resources/0ad.desktop 2012-05-10 15:27:23.306790356 +0200
@@ -3,7 +3,7 @@
Name=0 A.D.
Comment=A real-time strategy game of ancient warfare
Comment[it]=Videogioco strategico in tempo reale di guerre antiche
-Exec=/usr/bin/0ad
+Exec=/usr/local/bin/0ad
Icon=0ad
Terminal=false
Type=Application

View File

@ -0,0 +1,7 @@
--- build/resources/0ad.sh.orig 2010-08-15 14:23:11.000000000 +0200
+++ build/resources/0ad.sh 2012-05-10 15:17:57.136470711 +0200
@@ -1,3 +1,3 @@
#!/bin/sh
-/usr/bin/pyrogenesis "$@"
+/usr/local/bin/pyrogenesis "$@"

View File

@ -0,0 +1,45 @@
--- libraries/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp.orig 2012-05-21 22:08:59.267251130 +0200
+++ libraries/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp 2012-05-21 22:13:05.450463479 +0200
@@ -18,6 +18,42 @@
#include <float.h>
#endif
+#ifdef __FreeBSD__
+// ecvt is not included in FreeBSD's stdlib
+// http://forum.pellesc.de/index.php?PHPSESSID=0c4srgu3vrs19ali5459jehdh3&topic=2103.msg7797#msg7797
+char *ecvt(double value, int ndigit, int *decpt, int *sign)
+{
+ static char buffer[348];
+ static const int n = sizeof(buffer)/sizeof(buffer[0])-1;
+ ptrdiff_t pd;
+ int len;
+ int zeros=0;
+ if (ndigit > n) ndigit=n;
+ while (value > -1.0 && value < 1.0 ) {
+ value*=10.0;
+ zeros++;
+ }
+ sprintf(buffer,"%.*f",DBL_DIG,value);
+ len=strlen(buffer);
+ if (buffer[0]=='-') {
+ memmove(buffer, buffer+1, --len);
+ buffer[len]='\0';
+ *sign=1;
+ }
+ else *sign = 0;
+ pd=strchr(buffer,'.')-buffer;
+ memmove(buffer+pd,buffer+pd+1,--len-pd);
+ buffer[len]='\0';
+ *decpt=(int)pd-zeros;
+ if (len >= ndigit) buffer[ndigit]='\0';
+ else {
+ memset(buffer+len,'0',ndigit-len);
+ buffer[ndigit]='\0';
+ }
+ return buffer;
+}
+#endif
+
#ifdef WIN32
#define ecvt _ecvt
#endif // WIN32

View File

@ -0,0 +1,11 @@
--- libraries/nvtt/src/src/nvtt/squish/CMakeLists.txt.orig 2012-05-17 23:33:39.561531637 +0200
+++ libraries/nvtt/src/src/nvtt/squish/CMakeLists.txt 2012-05-17 23:33:51.665531705 +0200
@@ -22,7 +22,4 @@
ADD_LIBRARY(squish STATIC ${SQUISH_SRCS})
-IF(CMAKE_COMPILER_IS_GNUCXX)
- SET_TARGET_PROPERTIES(squish PROPERTIES COMPILE_FLAGS -fPIC)
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-
+SET_TARGET_PROPERTIES(squish PROPERTIES COMPILE_FLAGS -fPIC)

View File

@ -0,0 +1,14 @@
--- libraries/spidermonkey/build.sh.orig 2012-01-31 01:06:56.000000000 +0100
+++ libraries/spidermonkey/build.sh 2012-05-03 15:49:34.640969629 +0200
@@ -49,6 +49,11 @@
cd js-1.8.5/js/src
+cp jsnativestack.cpp jsnativestack.cpp.orig
+sed 's/# include <pthread_np.h>/#pragma GCC visibility push(default)\
+#include <pthread_np.h>\
+#pragma GCC visibility pop/' jsnativestack.cpp.orig >jsnativestack.cpp
+
# We want separate debug/release versions of the library, so we have to change
# the LIBRARY_NAME for each build.
# (We use perl instead of sed so that it works with MozillaBuild on Windows,

View File

@ -0,0 +1,16 @@
--- source/lib/sysdep/os/unix/x/x.cpp.orig 2012-05-18 13:26:07.715192771 +0200
+++ source/lib/sysdep/os/unix/x/x.cpp 2012-05-18 13:26:35.139193906 +0200
@@ -40,10 +40,10 @@
#define Cursor X__Cursor
-#include <Xlib.h>
+#include <X11/Xlib.h>
#include <stdlib.h>
-#include <Xatom.h>
-#include <Xcursor/Xcursor.h>
+#include <X11/Xatom.h>
+#include <X11/Xcursor/Xcursor.h>
#include "SDL.h"
#include "SDL_syswm.h"

View File

@ -0,0 +1,11 @@
--- source/tools/atlas/AtlasObject/AtlasObjectJS.cpp.orig 2012-05-21 22:49:25.624250443 +0200
+++ source/tools/atlas/AtlasObject/AtlasObjectJS.cpp 2012-05-21 22:49:28.429250717 +0200
@@ -24,7 +24,7 @@
# pragma warning(disable:4996) // deprecated CRT
#endif
-#include "wx/log.h"
+#include "wx-2.8/wx/log.h"
#include <sstream>

16
games/0ad/pkg-descr Normal file
View File

@ -0,0 +1,16 @@
0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
real-time strategy (RTS) game of ancient warfare. In short, it is
a historically-based war/economy game that allows players to relive
or rewrite the history of Western civilizations, focusing on the
years between 500 B.C. and 500 A.D. The project is highly ambitious,
involving state-of-the-art 3D graphics, detailed artwork, sound,
and a flexible and powerful custom-built game engine.
The game has been in development by Wildfire Games (WFG), a group
of volunteer, hobbyist game developers, since 2001. The code and
data are available under the GPL license, and the art, sound and
documentation are available under CC-BY-SA. In short, we consider
0 A.D. an educational celebration of game development and ancient
history.
WWW: http://wildfiregames.com/0ad/

17
games/0ad/pkg-plist Normal file
View File

@ -0,0 +1,17 @@
bin/pyrogenesis
bin/0ad
bin/ActorEditor
lib/0ad/libAtlasUI.so
lib/0ad/libCollada.so
lib/0ad/libenet.so.1
lib/0ad/libmozjs185-ps-release.so.1.0
lib/0ad/libnvcore.so
lib/0ad/libnvimage.so
lib/0ad/libnvmath.so
lib/0ad/libnvtt.so
share/applications/0ad.desktop
share/pixmaps/0ad.png
@exec mkdir -p %D/%%DATADIR%%/mods/_test.minimal/art/meshes
@exec mkdir -p %D/%%DATADIR%%/mods/_test.minimal/art/actors
@dirrm lib/0ad
@dirrmtry share/applications

View File

@ -3,6 +3,7 @@
COMMENT = Games
SUBDIR += 0ad
SUBDIR += 0verkill
SUBDIR += 3dc
SUBDIR += 3dpong