Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  9 May 2008 04:57:42 +0400 (MSD)
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/123538: [NEW PORT] games/vegastrike: Opensource 3D space simulator
Message-ID:  <20080509005742.7395C17046@hades.panopticon>
Resent-Message-ID: <200805090100.m49107E3083186@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         123538
>Category:       ports
>Synopsis:       [NEW PORT] games/vegastrike: Opensource 3D space simulator
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 09 01:00:07 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 7.0-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #0: Fri Apr 25 11:18:45 MSD 2008 root@hades.panopticon:/usr/obj/usr/src/sys/HADES i386


>Description:
This ports depends on games/vegastrike-data, sent in adjacent PR.

---
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
>How-To-Repeat:
>Fix:

--- vegastrike-0.5.0.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	vegastrike
#	vegastrike/Makefile
#	vegastrike/distinfo
#	vegastrike/files
#	vegastrike/files/patch-src-cmd-ai-docking.cpp
#	vegastrike/files/patch-src-python-universe_util_export.cpp
#	vegastrike/files/patch-src-cmd-collide2-opcodetypes.h
#	vegastrike/files/patch-setup-src-c-setup.cpp
#	vegastrike/files/patch-setup-src-include-file.cpp
#	vegastrike/pkg-message
#	vegastrike/pkg-descr
#
echo c - vegastrike
mkdir -p vegastrike > /dev/null 2>&1
echo x - vegastrike/Makefile
sed 's/^X//' >vegastrike/Makefile << 'END-of-vegastrike/Makefile'
X# New ports collection makefile for:	vegastrike
X# Date created:		05 May 2008
X# Whom:			Dmitry Marakasov <amdmi3@amdmi3.ru>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	vegastrike
XPORTVERSION=	0.5.0
XCATEGORIES=	games
XMASTER_SITES=	SF
XDISTNAME=	vegastrike-source-${PORTVERSION}
X
XMAINTAINER=	amdmi3@amdmi3.ru
XCOMMENT=	Opensource 3D space simulator
X
XRUN_DEPENDS=	${DATADIR}/vegastrike.ico:${PORTSDIR}/games/vegastrike-data
XLIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2 \
X		openal.0:${PORTSDIR}/audio/openal \
X		vorbis.4:${PORTSDIR}/audio/libvorbis \
X		ogg.5:${PORTSDIR}/audio/libogg
X
XUSE_BZIP2=	yes
XGNU_CONFIGURE=	yes
XUSE_GMAKE=	yes
XUSE_PYTHON=	yes
XUSE_SDL=	sdl
XUSE_GL=		gl glu glut
XUSE_GNOME=	gtk20
XCONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
XCONFIGURE_ENV=	LDFLAGS="-L${LOCALBASE}/lib" \
X		CPPFLAGS="-I${LOCALBASE}/include"
XWRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
X
X# cegui and ffmpeg are not used yet
XCONFIGURE_ARGS=	--disable-cegui --disable-ffmpeg \
X		--with-data-dir="${LOCALBASE}/share/${PORTNAME}" \
X		--enable-flags="${CXXFLAGS}"
X
X
XPLIST_FILES=	bin/vegastrike bin/vssetup bin/vegaserver
X
X.if !defined(NOPORTDOCS)
XPORTDOCS=	README
X.endif
X
XOPTIONS=	MESHER "Enable mesher modelling tool" off
X
X.include <bsd.port.pre.mk>
X
X.if defined(WITHOUT_MESHER)
XCONFIGURE_ARGS+=	--disable-ogre
X.else
XPLIST_FILES+=	bin/mesher
XBUILD_DEPENDS+=		${LOCALBASE}/lib/libOgreMain.so:${PORTSDIR}/graphics/ogre3d
XRUN_DEPENDS+=		${LOCALBASE}/lib/libOgreMain.so:${PORTSDIR}/graphics/ogre3d
X.endif
X
Xpost-patch:
X	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g; \
X		s|/usr/X11R6|${LOCALBASE}|g' ${WRKSRC}/configure
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKSRC}/vegaserver ${PREFIX}/bin
X	${INSTALL_PROGRAM} ${WRKSRC}/vegastrike ${PREFIX}/bin
X	${INSTALL_PROGRAM} ${WRKSRC}/vssetup ${PREFIX}/bin
X.if !defined(WITHOUT_MESHER)
X	${INSTALL_PROGRAM} ${WRKSRC}/mesher ${PREFIX}/bin
X.endif
X
X.if !defined(NOPORTDOCS)
X	${MKDIR} ${DOCSDIR}
X.for f in ${PORTDOCS}
X	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
X.endfor
X.endif
X
Xpost-install:
X	@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
X
X.include <bsd.port.post.mk>
END-of-vegastrike/Makefile
echo x - vegastrike/distinfo
sed 's/^X//' >vegastrike/distinfo << 'END-of-vegastrike/distinfo'
XMD5 (vegastrike-source-0.5.0.tar.bz2) = 435fae23822d7e4f7563d753eb683ca0
XSHA256 (vegastrike-source-0.5.0.tar.bz2) = e4fe2aeeece103d87ae11ca8b27e48b72cc7ed8a0c1bed44e7131afd644fde72
XSIZE (vegastrike-source-0.5.0.tar.bz2) = 9093178
END-of-vegastrike/distinfo
echo c - vegastrike/files
mkdir -p vegastrike/files > /dev/null 2>&1
echo x - vegastrike/files/patch-src-cmd-ai-docking.cpp
sed 's/^X//' >vegastrike/files/patch-src-cmd-ai-docking.cpp << 'END-of-vegastrike/files/patch-src-cmd-ai-docking.cpp'
X--- src/cmd/ai/docking.cpp.orig	2008-04-24 16:12:16.000000000 +0400
X+++ src/cmd/ai/docking.cpp	2008-05-05 23:55:37.000000000 +0400
X@@ -1,5 +1,5 @@
X-#include <string>
X #include "python/python_compile.h"
X+#include <string>
X #include "docking.h"
X #include "xml_support.h"
X #include "config_xml.h"
END-of-vegastrike/files/patch-src-cmd-ai-docking.cpp
echo x - vegastrike/files/patch-src-python-universe_util_export.cpp
sed 's/^X//' >vegastrike/files/patch-src-python-universe_util_export.cpp << 'END-of-vegastrike/files/patch-src-python-universe_util_export.cpp'
X--- src/python/universe_util_export.cpp.orig	2008-04-24 16:11:53.000000000 +0400
X+++ src/python/universe_util_export.cpp	2008-05-05 23:56:04.000000000 +0400
X@@ -3,17 +3,18 @@
X /* ToDo: Fix so Boost 1.28 is supported */
X #if BOOST_VERSION != 102800
X 
X-#include "cmd/container.h"
X-#include <string>
X-#include "init.h"
X-#include "gfx/vec.h"
X-#include "cmd/unit_generic.h"
X #include "python_class.h"
X #if BOOST_VERSION != 102800
X #include <boost/python.hpp>
X #else
X #include <boost/python/objects.hpp>
X #endif
X+
X+#include "cmd/container.h"
X+#include <string>
X+#include "init.h"
X+#include "gfx/vec.h"
X+#include "cmd/unit_generic.h"
X #include "universe_util.h"
X #include "cmd/unit_util.h"
X #include "faction_generic.h"
END-of-vegastrike/files/patch-src-python-universe_util_export.cpp
echo x - vegastrike/files/patch-src-cmd-collide2-opcodetypes.h
sed 's/^X//' >vegastrike/files/patch-src-cmd-collide2-opcodetypes.h << 'END-of-vegastrike/files/patch-src-cmd-collide2-opcodetypes.h'
X--- src/cmd/collide2/opcodetypes.h.orig	2008-04-24 16:12:20.000000000 +0400
X+++ src/cmd/collide2/opcodetypes.h	2008-05-05 23:57:08.000000000 +0400
X@@ -198,13 +198,13 @@
X #include <wctype.h>
X #endif
X #if !defined(CS_HAVE_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
X-typedef uint16 wchar_t;
X+//typedef uint16 wchar_t;
X #define _WCHAR_T_DEFINED
X #define CS_WCHAR_T_SIZE 2
X #endif
X #if !defined(CS_HAVE_WINT_T) && !defined(_WCTYPE_T_DEFINED) && \
X     !defined(_WINT_T)
X-typedef wchar_t wint_t;
X+//typedef wchar_t wint_t;
X #define _WCTYPE_T_DEFINED
X #define _WINT_T
X #endif
END-of-vegastrike/files/patch-src-cmd-collide2-opcodetypes.h
echo x - vegastrike/files/patch-setup-src-c-setup.cpp
sed 's/^X//' >vegastrike/files/patch-setup-src-c-setup.cpp << 'END-of-vegastrike/files/patch-setup-src-c-setup.cpp'
X--- setup/src/c/setup.cpp.orig	2008-04-24 16:16:49.000000000 +0400
X+++ setup/src/c/setup.cpp	2008-05-08 16:55:40.000000000 +0400
X@@ -25,6 +25,7 @@
X #include <stdio.h>
X #include <unistd.h>
X #include <pwd.h>
X+#include <sys/stat.h>
X #include <sys/types.h>
X 
X #endif
X@@ -33,6 +34,57 @@
X using std::string;
X using std::vector;
X char origpath[65536];
X+
X+static void changeToProgramDirectory(char *argv0) {
X+    int ret = -1; /* Should it use argv[0] directly? */
X+    char *program = argv0;
X+#ifndef _WIN32
X+    char buf[65536];
X+    {
X+	char linkname[128]; /* /proc/<pid>/exe */
X+	linkname[0]='\0';
X+	pid_t pid;
X+	
X+	/* Get our PID and build the name of the link in /proc */
X+	pid = getpid();
X+	
X+	sprintf(linkname, "/proc/%d/exe", pid);
X+	ret = readlink(linkname, buf, 65535);
X+	if (ret <= 0) {
X+		sprintf(linkname, "/proc/%d/file", pid);
X+		ret = readlink(linkname, buf, 65535);
X+	}
X+	if (ret <= 0) {
X+		ret = readlink(program, buf, 65535);
X+	}
X+	if (ret > 0) {
X+		buf[ret]='\0';
X+		/* Ensure proper NUL termination */
X+		program = buf;
X+	}
X+    }
X+#endif
X+
X+    char *parentdir;
X+    int pathlen=strlen(program);
X+    parentdir=new char[pathlen+1];
X+    char *c;
X+    strncpy ( parentdir, program, pathlen+1 );
X+    c = (char*) parentdir;
X+    while (*c != '\0')     /* go to end */
X+      c++;
X+    
X+    while ((*c != '/')&&(*c != '\\')&&c>parentdir)      /* back up to parent */
X+      c--;
X+    
X+    *c = '\0';             /* cut off last part (binary name) */
X+    if (strlen (parentdir)>0) {
X+      chdir (parentdir);/* chdir to the binary app's parent */
X+    }
X+    delete []parentdir;
X+}
X+
X+
X #if defined(_WINDOWS)&&defined(_WIN32)
X typedef char FileNameCharType [65536];
X int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nShowCmd) {
X@@ -44,20 +96,21 @@
X #else
X int main(int argc, char *argv[]) {
X #endif
X-#if 1
X-//def _WIN32
X+
X+	if (argc>1) {
X+		if (strcmp(argv[1], "--target")==0 && argc>2) {
X+			chdir(argv[2]);
X+		} else {
X+			fprintf(stderr,"Usage: vssetup [--target DATADIR]\n");
X+			return 1;
X+		}
X+	}
X 	getcwd (origpath,65535);
X 	origpath[65535]=0;
X-        int i;
X-	for (i=strlen(argv[0]);argv[0][i]!='\\'&&argv[0][i]!='/'&&i>=0;i--) {
X-	}
X-	argv[0][i+1]='\0';
X-	if (i>=0) {
X-		chdir(argv[0]);
X-	}
X-#endif
X 	
X-	{	
X+	changeToProgramDirectory(argv[0]);
X+	
X+	{
X 		vector<string>	data_paths;
X #ifdef DATA_DIR
X 		data_paths.push_back( DATA_DIR);
X@@ -69,6 +122,7 @@
X 		data_paths.push_back( string(origpath)+"/data4.x");
X 		data_paths.push_back( string(origpath)+"/data");
X 		data_paths.push_back( string(origpath)+"/../data");
X+		data_paths.push_back( string(origpath)+"/../Resources");
X 		getcwd (origpath,65535);
X 		origpath[65535]=0;
X 		data_paths.push_back( ".");
X@@ -79,6 +133,8 @@
X 		data_paths.push_back( "../../data");
X 		data_paths.push_back( "../Resources");
X 		data_paths.push_back( "../Resources/data");
X+		data_paths.push_back( "../Resources/data4.x");
X+/*
X 		data_paths.push_back( "/usr/share/local/vegastrike/data");
X 		data_paths.push_back( "/usr/local/share/vegastrike/data");
X 		data_paths.push_back( "/usr/local/vegastrike/data");
X@@ -86,7 +142,6 @@
X 		data_paths.push_back( "/usr/local/games/vegastrike/data");
X 		data_paths.push_back( "/usr/games/vegastrike/data");
X 		data_paths.push_back( "/opt/share/vegastrike/data");
X-		data_paths.push_back( "../Resources/data4.x");
X 		data_paths.push_back( "/usr/share/local/vegastrike/data4.x");
X 		data_paths.push_back( "/usr/local/share/vegastrike/data4.x");
X 		data_paths.push_back( "/usr/local/vegastrike/data4.x");
X@@ -94,7 +149,7 @@
X 		data_paths.push_back( "/usr/local/games/vegastrike/data4.x");
X 		data_paths.push_back( "/usr/games/vegastrike/data4.x");
X 		data_paths.push_back( "/opt/share/vegastrike/data4.x");
X-		
X+*/		
X 		// Win32 data should be "."
X 		char tmppath[16384];
X 		for( vector<string>::iterator vsit=data_paths.begin(); vsit!=data_paths.end(); vsit++)
X@@ -118,8 +173,8 @@
X #ifndef _WIN32
X 	struct passwd *pwent;
X 	pwent = getpwuid (getuid());
X-        string HOMESUBDIR=".vegastrike";
X 	
X+	string HOMESUBDIR;
X 	FILE *version=fopen("Version.txt","r");
X 	if (!version)
X 		version=fopen("../Version.txt","r");
X@@ -135,13 +190,23 @@
X 		if (hsd.length()) {
X 			HOMESUBDIR=hsd;
X 			//fprintf (STD_OUT,"Using %s as the home directory\n",hsd.c_str());
X-		}			
X+		}
X+	}
X+	if (HOMESUBDIR.empty()) {
X+		fprintf(stderr,"Error: Failed to find Version.txt anywhere.\n");
X+		return 1;
X 	}
X 	chdir (pwent->pw_dir);
X-	chdir (HOMESUBDIR.c_str());
X+
X+	mkdir(HOMESUBDIR.c_str()
X+#ifndef _WIN32
X+		, 0755
X #endif
X-#ifdef GTK
X-#endif    //GTK
X+		);
X+
X+#endif
X+	chdir (HOMESUBDIR.c_str());
X+	
X 	Start(&argc,&argv);
X #if defined(_WINDOWS)&&defined(_WIN32)
X 	delete []argv0;
END-of-vegastrike/files/patch-setup-src-c-setup.cpp
echo x - vegastrike/files/patch-setup-src-include-file.cpp
sed 's/^X//' >vegastrike/files/patch-setup-src-include-file.cpp << 'END-of-vegastrike/files/patch-setup-src-include-file.cpp'
X--- setup/src/include/file.cpp.orig	2008-04-24 16:16:50.000000000 +0400
X+++ setup/src/include/file.cpp	2008-05-09 04:41:07.000000000 +0400
X@@ -15,6 +15,8 @@
X  *                                                                         *
X  **************************************************************************/
X #include <string>
X+#include <sys/stat.h>
X+
X using std::string;
X #include "file.h"
X extern char origpath[65536];
X@@ -98,6 +100,17 @@
X string mangle_config (string config) {
X 	return string(origpath)+string("/")+config;
X }
X+
X+bool useGameConfig(void) {
X+	struct stat st1,st2;
X+	if (stat(CONFIG.config_file, &st1)==0 && stat(mangle_config(CONFIG.config_file).c_str(), &st2)==0) {
X+		if (st2.st_mtime > st1.st_mtime) {
X+			return true;
X+		}
X+	}
X+	return false;
X+}
X+
X void LoadConfig(void) {
X 	FILE *fp;
X 	char line[MAX_READ+1];
X@@ -108,8 +121,7 @@
X 	G_CURRENT = &GROUPS;
X 	C_CURRENT = &CATS;
X 
X-
X-	if ((fp = fopen(CONFIG.config_file, "r")) == NULL) {
X+	if (useGameConfig() || (fp = fopen(CONFIG.config_file, "r")) == NULL) {
X 		origconfig=true;
X 		if ((fp = fopen(mangle_config(CONFIG.config_file).c_str(), "r")) == NULL) {
X 			fprintf (stderr, "Unable to read from %s\n", CONFIG_FILE );
X@@ -185,7 +197,8 @@
X 	char *p, *parm, *n_parm, *start_write, *end_write;
X 	int commenting = 0;		// 0 if scanning, 1 if adding comments, 2 if removing comments
X 	int skip;
X-	if ((rp = fopen(CONFIG.config_file, "r")) == NULL) {
X+	
X+	if (useGameConfig() || (rp = fopen(CONFIG.config_file, "r")) == NULL) {
X 		if ((rp = fopen(mangle_config(CONFIG.config_file).c_str(), "r")) == NULL) {
X 			fprintf (stderr, "Unable to read from %s\n", CONFIG_FILE );
X 			exit(-1);
X@@ -288,11 +301,20 @@
X 		}
X 	}
X 	string tmp1 = CONFIG.config_file;
X+/*
X 	if(origconfig) {
X 		tmp1 = mangle_config (CONFIG.config_file);
X 	}
X+*/
X 	if ((wp = fopen(tmp1.c_str(), "w")) == NULL) {
X-		fprintf (stderr, "Unable to write  to %s\n", CONFIG.config_file );
X+		tmp1 = mangle_config (CONFIG.config_file);
X+		if ((wp = fopen(tmp1.c_str(), "w")) == NULL) {
X+			tmp1 = CONFIG.config_file;
X+			if ((wp = fopen(tmp1.c_str(), "w")) == NULL) {
X+				fprintf (stderr, "Unable to write  to %s\n", CONFIG.config_file );
X+				exit(1);
X+			}
X+		}
X 	}
X 	while ((p = fgets(line, MAX_READ, rp)) != NULL) {
X 		fprintf(wp, line);
END-of-vegastrike/files/patch-setup-src-include-file.cpp
echo x - vegastrike/pkg-message
sed 's/^X//' >vegastrike/pkg-message << 'END-of-vegastrike/pkg-message'
XVega Strike is now installed.
X
XPlease run `vssetup` before running the game to tune game settings.
END-of-vegastrike/pkg-message
echo x - vegastrike/pkg-descr
sed 's/^X//' >vegastrike/pkg-descr << 'END-of-vegastrike/pkg-descr'
XVega Strike is an OpenSource 3d Space Simulator. Work is proceeding
Xon both the Vega Strike game engine and a Vega Strike Universe game
Xdata set. Both engine and data are in a playable state, but still
Xunder development. Each release serves as a beta for both engine
Xand data.
X
XThe project goal is, at version 1.0, is to be a generic space
Xsimulator. Currently developed features include:
X
X* Trading
X* Exploration
X* Plenty of shoot 'em up action
X* Preliminary multiplayer Deathmatch (testing server only)
X
XWWW: http://vegastrike.sourceforge.net
END-of-vegastrike/pkg-descr
exit
--- vegastrike-0.5.0.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080509005742.7395C17046>