diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2008-05-24 18:40:32 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2008-05-24 18:40:32 +0000 |
commit | 73127a0046c3fcb6bbdea232cae7bda9105d4cfd (patch) | |
tree | 0e247e9ffe7aa8010ef7c98bf7f5062c4a14bfcf /games/vegastrike | |
parent | 1d77f1a2ccb85d590f564da111b0b9a766bf1b2d (diff) | |
download | ports-73127a0046c3fcb6bbdea232cae7bda9105d4cfd.tar.gz ports-73127a0046c3fcb6bbdea232cae7bda9105d4cfd.zip |
Notes
Diffstat (limited to 'games/vegastrike')
-rw-r--r-- | games/vegastrike/Makefile | 80 | ||||
-rw-r--r-- | games/vegastrike/distinfo | 3 | ||||
-rw-r--r-- | games/vegastrike/files/patch-setup-src-c-setup.cpp | 173 | ||||
-rw-r--r-- | games/vegastrike/files/patch-setup-src-include-file.cpp | 71 | ||||
-rw-r--r-- | games/vegastrike/files/patch-src-cmd-ai-docking.cpp | 9 | ||||
-rw-r--r-- | games/vegastrike/files/patch-src-cmd-collide2-opcodetypes.h | 18 | ||||
-rw-r--r-- | games/vegastrike/files/patch-src-python-universe_util_export.cpp | 26 | ||||
-rw-r--r-- | games/vegastrike/pkg-descr | 15 | ||||
-rw-r--r-- | games/vegastrike/pkg-message | 3 |
9 files changed, 398 insertions, 0 deletions
diff --git a/games/vegastrike/Makefile b/games/vegastrike/Makefile new file mode 100644 index 000000000000..aa99c2b3d971 --- /dev/null +++ b/games/vegastrike/Makefile @@ -0,0 +1,80 @@ +# New ports collection makefile for: vegastrike +# Date created: 05 May 2008 +# Whom: Dmitry Marakasov <amdmi3@amdmi3.ru> +# +# $FreeBSD$ +# + +PORTNAME= vegastrike +PORTVERSION= 0.5.0 +CATEGORIES= games +MASTER_SITES= SF +DISTNAME= vegastrike-source-${PORTVERSION} + +MAINTAINER= amdmi3@amdmi3.ru +COMMENT= Opensource 3D space simulator + +RUN_DEPENDS= ${DATADIR}/vegastrike.ico:${PORTSDIR}/games/vegastrike-data +LIB_DEPENDS= expat.6:${PORTSDIR}/textproc/expat2 \ + openal.0:${PORTSDIR}/audio/openal \ + vorbis.4:${PORTSDIR}/audio/libvorbis \ + ogg.5:${PORTSDIR}/audio/libogg + +USE_BZIP2= yes +GNU_CONFIGURE= yes +USE_GMAKE= yes +USE_PYTHON= yes +USE_SDL= sdl +USE_GL= gl glu glut +USE_GNOME= gtk20 +CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} +CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib" \ + CPPFLAGS="-I${LOCALBASE}/include" +WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} + +# cegui and ffmpeg are not used yet +CONFIGURE_ARGS= --disable-cegui --disable-ffmpeg \ + --with-data-dir="${LOCALBASE}/share/${PORTNAME}" \ + --enable-flags="${CXXFLAGS}" + +PLIST_FILES= bin/vegastrike bin/vssetup bin/vegaserver + +.if !defined(NOPORTDOCS) +PORTDOCS= README +.endif + +OPTIONS= MESHER "Enable mesher modelling tool" off + +.include <bsd.port.pre.mk> + +.if defined(WITHOUT_MESHER) +CONFIGURE_ARGS+= --disable-ogre +.else +PLIST_FILES+= bin/mesher +BUILD_DEPENDS+= ${LOCALBASE}/lib/libOgreMain.so:${PORTSDIR}/graphics/ogre3d +RUN_DEPENDS+= ${LOCALBASE}/lib/libOgreMain.so:${PORTSDIR}/graphics/ogre3d +.endif + +post-patch: + @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g; \ + s|/usr/X11R6|${LOCALBASE}|g' ${WRKSRC}/configure + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/vegaserver ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/vegastrike ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/vssetup ${PREFIX}/bin +.if !defined(WITHOUT_MESHER) + ${INSTALL_PROGRAM} ${WRKSRC}/mesher ${PREFIX}/bin +.endif + +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} +.for f in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR} +.endfor +.endif + +post-install: + @${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD} + +.include <bsd.port.post.mk> diff --git a/games/vegastrike/distinfo b/games/vegastrike/distinfo new file mode 100644 index 000000000000..f5377ac9b5bf --- /dev/null +++ b/games/vegastrike/distinfo @@ -0,0 +1,3 @@ +MD5 (vegastrike-source-0.5.0.tar.bz2) = 435fae23822d7e4f7563d753eb683ca0 +SHA256 (vegastrike-source-0.5.0.tar.bz2) = e4fe2aeeece103d87ae11ca8b27e48b72cc7ed8a0c1bed44e7131afd644fde72 +SIZE (vegastrike-source-0.5.0.tar.bz2) = 9093178 diff --git a/games/vegastrike/files/patch-setup-src-c-setup.cpp b/games/vegastrike/files/patch-setup-src-c-setup.cpp new file mode 100644 index 000000000000..7e1c3db91c20 --- /dev/null +++ b/games/vegastrike/files/patch-setup-src-c-setup.cpp @@ -0,0 +1,173 @@ +--- setup/src/c/setup.cpp.orig 2008-04-24 16:16:49.000000000 +0400 ++++ setup/src/c/setup.cpp 2008-05-08 16:55:40.000000000 +0400 +@@ -25,6 +25,7 @@ + #include <stdio.h> + #include <unistd.h> + #include <pwd.h> ++#include <sys/stat.h> + #include <sys/types.h> + + #endif +@@ -33,6 +34,57 @@ + using std::string; + using std::vector; + char origpath[65536]; ++ ++static void changeToProgramDirectory(char *argv0) { ++ int ret = -1; /* Should it use argv[0] directly? */ ++ char *program = argv0; ++#ifndef _WIN32 ++ char buf[65536]; ++ { ++ char linkname[128]; /* /proc/<pid>/exe */ ++ linkname[0]='\0'; ++ pid_t pid; ++ ++ /* Get our PID and build the name of the link in /proc */ ++ pid = getpid(); ++ ++ sprintf(linkname, "/proc/%d/exe", pid); ++ ret = readlink(linkname, buf, 65535); ++ if (ret <= 0) { ++ sprintf(linkname, "/proc/%d/file", pid); ++ ret = readlink(linkname, buf, 65535); ++ } ++ if (ret <= 0) { ++ ret = readlink(program, buf, 65535); ++ } ++ if (ret > 0) { ++ buf[ret]='\0'; ++ /* Ensure proper NUL termination */ ++ program = buf; ++ } ++ } ++#endif ++ ++ char *parentdir; ++ int pathlen=strlen(program); ++ parentdir=new char[pathlen+1]; ++ char *c; ++ strncpy ( parentdir, program, pathlen+1 ); ++ c = (char*) parentdir; ++ while (*c != '\0') /* go to end */ ++ c++; ++ ++ while ((*c != '/')&&(*c != '\\')&&c>parentdir) /* back up to parent */ ++ c--; ++ ++ *c = '\0'; /* cut off last part (binary name) */ ++ if (strlen (parentdir)>0) { ++ chdir (parentdir);/* chdir to the binary app's parent */ ++ } ++ delete []parentdir; ++} ++ ++ + #if defined(_WINDOWS)&&defined(_WIN32) + typedef char FileNameCharType [65536]; + int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nShowCmd) { +@@ -44,20 +96,21 @@ + #else + int main(int argc, char *argv[]) { + #endif +-#if 1 +-//def _WIN32 ++ ++ if (argc>1) { ++ if (strcmp(argv[1], "--target")==0 && argc>2) { ++ chdir(argv[2]); ++ } else { ++ fprintf(stderr,"Usage: vssetup [--target DATADIR]\n"); ++ return 1; ++ } ++ } + getcwd (origpath,65535); + origpath[65535]=0; +- int i; +- for (i=strlen(argv[0]);argv[0][i]!='\\'&&argv[0][i]!='/'&&i>=0;i--) { +- } +- argv[0][i+1]='\0'; +- if (i>=0) { +- chdir(argv[0]); +- } +-#endif + +- { ++ changeToProgramDirectory(argv[0]); ++ ++ { + vector<string> data_paths; + #ifdef DATA_DIR + data_paths.push_back( DATA_DIR); +@@ -69,6 +122,7 @@ + data_paths.push_back( string(origpath)+"/data4.x"); + data_paths.push_back( string(origpath)+"/data"); + data_paths.push_back( string(origpath)+"/../data"); ++ data_paths.push_back( string(origpath)+"/../Resources"); + getcwd (origpath,65535); + origpath[65535]=0; + data_paths.push_back( "."); +@@ -79,6 +133,8 @@ + data_paths.push_back( "../../data"); + data_paths.push_back( "../Resources"); + data_paths.push_back( "../Resources/data"); ++ data_paths.push_back( "../Resources/data4.x"); ++/* + data_paths.push_back( "/usr/share/local/vegastrike/data"); + data_paths.push_back( "/usr/local/share/vegastrike/data"); + data_paths.push_back( "/usr/local/vegastrike/data"); +@@ -86,7 +142,6 @@ + data_paths.push_back( "/usr/local/games/vegastrike/data"); + data_paths.push_back( "/usr/games/vegastrike/data"); + data_paths.push_back( "/opt/share/vegastrike/data"); +- data_paths.push_back( "../Resources/data4.x"); + data_paths.push_back( "/usr/share/local/vegastrike/data4.x"); + data_paths.push_back( "/usr/local/share/vegastrike/data4.x"); + data_paths.push_back( "/usr/local/vegastrike/data4.x"); +@@ -94,7 +149,7 @@ + data_paths.push_back( "/usr/local/games/vegastrike/data4.x"); + data_paths.push_back( "/usr/games/vegastrike/data4.x"); + data_paths.push_back( "/opt/share/vegastrike/data4.x"); +- ++*/ + // Win32 data should be "." + char tmppath[16384]; + for( vector<string>::iterator vsit=data_paths.begin(); vsit!=data_paths.end(); vsit++) +@@ -118,8 +173,8 @@ + #ifndef _WIN32 + struct passwd *pwent; + pwent = getpwuid (getuid()); +- string HOMESUBDIR=".vegastrike"; + ++ string HOMESUBDIR; + FILE *version=fopen("Version.txt","r"); + if (!version) + version=fopen("../Version.txt","r"); +@@ -135,13 +190,23 @@ + if (hsd.length()) { + HOMESUBDIR=hsd; + //fprintf (STD_OUT,"Using %s as the home directory\n",hsd.c_str()); +- } ++ } ++ } ++ if (HOMESUBDIR.empty()) { ++ fprintf(stderr,"Error: Failed to find Version.txt anywhere.\n"); ++ return 1; + } + chdir (pwent->pw_dir); +- chdir (HOMESUBDIR.c_str()); ++ ++ mkdir(HOMESUBDIR.c_str() ++#ifndef _WIN32 ++ , 0755 + #endif +-#ifdef GTK +-#endif //GTK ++ ); ++ ++#endif ++ chdir (HOMESUBDIR.c_str()); ++ + Start(&argc,&argv); + #if defined(_WINDOWS)&&defined(_WIN32) + delete []argv0; diff --git a/games/vegastrike/files/patch-setup-src-include-file.cpp b/games/vegastrike/files/patch-setup-src-include-file.cpp new file mode 100644 index 000000000000..96fe0ee805a5 --- /dev/null +++ b/games/vegastrike/files/patch-setup-src-include-file.cpp @@ -0,0 +1,71 @@ +--- setup/src/include/file.cpp.orig 2008-04-24 16:16:50.000000000 +0400 ++++ setup/src/include/file.cpp 2008-05-09 04:41:07.000000000 +0400 +@@ -15,6 +15,8 @@ + * * + **************************************************************************/ + #include <string> ++#include <sys/stat.h> ++ + using std::string; + #include "file.h" + extern char origpath[65536]; +@@ -98,6 +100,17 @@ + string mangle_config (string config) { + return string(origpath)+string("/")+config; + } ++ ++bool useGameConfig(void) { ++ struct stat st1,st2; ++ if (stat(CONFIG.config_file, &st1)==0 && stat(mangle_config(CONFIG.config_file).c_str(), &st2)==0) { ++ if (st2.st_mtime > st1.st_mtime) { ++ return true; ++ } ++ } ++ return false; ++} ++ + void LoadConfig(void) { + FILE *fp; + char line[MAX_READ+1]; +@@ -108,8 +121,7 @@ + G_CURRENT = &GROUPS; + C_CURRENT = &CATS; + +- +- if ((fp = fopen(CONFIG.config_file, "r")) == NULL) { ++ if (useGameConfig() || (fp = fopen(CONFIG.config_file, "r")) == NULL) { + origconfig=true; + if ((fp = fopen(mangle_config(CONFIG.config_file).c_str(), "r")) == NULL) { + fprintf (stderr, "Unable to read from %s\n", CONFIG_FILE ); +@@ -185,7 +197,8 @@ + char *p, *parm, *n_parm, *start_write, *end_write; + int commenting = 0; // 0 if scanning, 1 if adding comments, 2 if removing comments + int skip; +- if ((rp = fopen(CONFIG.config_file, "r")) == NULL) { ++ ++ if (useGameConfig() || (rp = fopen(CONFIG.config_file, "r")) == NULL) { + if ((rp = fopen(mangle_config(CONFIG.config_file).c_str(), "r")) == NULL) { + fprintf (stderr, "Unable to read from %s\n", CONFIG_FILE ); + exit(-1); +@@ -288,11 +301,20 @@ + } + } + string tmp1 = CONFIG.config_file; ++/* + if(origconfig) { + tmp1 = mangle_config (CONFIG.config_file); + } ++*/ + if ((wp = fopen(tmp1.c_str(), "w")) == NULL) { +- fprintf (stderr, "Unable to write to %s\n", CONFIG.config_file ); ++ tmp1 = mangle_config (CONFIG.config_file); ++ if ((wp = fopen(tmp1.c_str(), "w")) == NULL) { ++ tmp1 = CONFIG.config_file; ++ if ((wp = fopen(tmp1.c_str(), "w")) == NULL) { ++ fprintf (stderr, "Unable to write to %s\n", CONFIG.config_file ); ++ exit(1); ++ } ++ } + } + while ((p = fgets(line, MAX_READ, rp)) != NULL) { + fprintf(wp, line); diff --git a/games/vegastrike/files/patch-src-cmd-ai-docking.cpp b/games/vegastrike/files/patch-src-cmd-ai-docking.cpp new file mode 100644 index 000000000000..d2e6b43d4645 --- /dev/null +++ b/games/vegastrike/files/patch-src-cmd-ai-docking.cpp @@ -0,0 +1,9 @@ +--- src/cmd/ai/docking.cpp.orig 2008-04-24 16:12:16.000000000 +0400 ++++ src/cmd/ai/docking.cpp 2008-05-05 23:55:37.000000000 +0400 +@@ -1,5 +1,5 @@ +-#include <string> + #include "python/python_compile.h" ++#include <string> + #include "docking.h" + #include "xml_support.h" + #include "config_xml.h" diff --git a/games/vegastrike/files/patch-src-cmd-collide2-opcodetypes.h b/games/vegastrike/files/patch-src-cmd-collide2-opcodetypes.h new file mode 100644 index 000000000000..f6917488c02f --- /dev/null +++ b/games/vegastrike/files/patch-src-cmd-collide2-opcodetypes.h @@ -0,0 +1,18 @@ +--- src/cmd/collide2/opcodetypes.h.orig 2008-04-24 16:12:20.000000000 +0400 ++++ src/cmd/collide2/opcodetypes.h 2008-05-05 23:57:08.000000000 +0400 +@@ -198,13 +198,13 @@ + #include <wctype.h> + #endif + #if !defined(CS_HAVE_WCHAR_T) && !defined(_WCHAR_T_DEFINED) +-typedef uint16 wchar_t; ++//typedef uint16 wchar_t; + #define _WCHAR_T_DEFINED + #define CS_WCHAR_T_SIZE 2 + #endif + #if !defined(CS_HAVE_WINT_T) && !defined(_WCTYPE_T_DEFINED) && \ + !defined(_WINT_T) +-typedef wchar_t wint_t; ++//typedef wchar_t wint_t; + #define _WCTYPE_T_DEFINED + #define _WINT_T + #endif diff --git a/games/vegastrike/files/patch-src-python-universe_util_export.cpp b/games/vegastrike/files/patch-src-python-universe_util_export.cpp new file mode 100644 index 000000000000..c03570b7f048 --- /dev/null +++ b/games/vegastrike/files/patch-src-python-universe_util_export.cpp @@ -0,0 +1,26 @@ +--- src/python/universe_util_export.cpp.orig 2008-04-24 16:11:53.000000000 +0400 ++++ src/python/universe_util_export.cpp 2008-05-05 23:56:04.000000000 +0400 +@@ -3,17 +3,18 @@ + /* ToDo: Fix so Boost 1.28 is supported */ + #if BOOST_VERSION != 102800 + +-#include "cmd/container.h" +-#include <string> +-#include "init.h" +-#include "gfx/vec.h" +-#include "cmd/unit_generic.h" + #include "python_class.h" + #if BOOST_VERSION != 102800 + #include <boost/python.hpp> + #else + #include <boost/python/objects.hpp> + #endif ++ ++#include "cmd/container.h" ++#include <string> ++#include "init.h" ++#include "gfx/vec.h" ++#include "cmd/unit_generic.h" + #include "universe_util.h" + #include "cmd/unit_util.h" + #include "faction_generic.h" diff --git a/games/vegastrike/pkg-descr b/games/vegastrike/pkg-descr new file mode 100644 index 000000000000..134b31956117 --- /dev/null +++ b/games/vegastrike/pkg-descr @@ -0,0 +1,15 @@ +Vega Strike is an OpenSource 3d Space Simulator. Work is proceeding +on both the Vega Strike game engine and a Vega Strike Universe game +data set. Both engine and data are in a playable state, but still +under development. Each release serves as a beta for both engine +and data. + +The project goal is, at version 1.0, is to be a generic space +simulator. Currently developed features include: + +* Trading +* Exploration +* Plenty of shoot 'em up action +* Preliminary multiplayer Deathmatch (testing server only) + +WWW: http://vegastrike.sourceforge.net diff --git a/games/vegastrike/pkg-message b/games/vegastrike/pkg-message new file mode 100644 index 000000000000..d64ad2328e40 --- /dev/null +++ b/games/vegastrike/pkg-message @@ -0,0 +1,3 @@ +Vega Strike is now installed. + +Please run `vssetup` before running the game to tune game settings. |