summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-simulation/crashtest')
-rw-r--r--games-simulation/crashtest/Manifest1
-rw-r--r--games-simulation/crashtest/crashtest-1.1.ebuild42
-rw-r--r--games-simulation/crashtest/files/crashtest-1.1-gentoo.patch94
-rw-r--r--games-simulation/crashtest/metadata.xml11
4 files changed, 148 insertions, 0 deletions
diff --git a/games-simulation/crashtest/Manifest b/games-simulation/crashtest/Manifest
new file mode 100644
index 000000000000..dcd50f19a3ea
--- /dev/null
+++ b/games-simulation/crashtest/Manifest
@@ -0,0 +1 @@
+DIST crashtest-1.1.tar.gz 134769 SHA256 55c5ce29857263ceebc1c3f42c153f275dfc47711e9248395fd4398d6ef52ab9 SHA512 f361b5f202cdcdca871357eb2a2158af2958f4058b6754c63dc5a20c3e08e2ef532e984596d0daac073f2321b2db02e3f8c2a0a4998450fc953c1661d712d59c WHIRLPOOL 272352015016844afe6f02fff92be96b6f52e0c2cdfb2e545cc3a2f6e5196f4825bd99c971b89c371be18c6b983e5b04a1bbe739df5cae7c8579ac6319ea80cd
diff --git a/games-simulation/crashtest/crashtest-1.1.ebuild b/games-simulation/crashtest/crashtest-1.1.ebuild
new file mode 100644
index 000000000000..0525ffe1f9ce
--- /dev/null
+++ b/games-simulation/crashtest/crashtest-1.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic games
+
+DESCRIPTION="Educational car crash simulator"
+HOMEPAGE="http://www.stolk.org/crashtest/"
+SRC_URI="http://www.stolk.org/crashtest/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="
+ x11-libs/fltk:1[opengl]
+ dev-games/ode
+ media-libs/alsa-lib
+ virtual/opengl
+ virtual/glu
+ media-libs/freeglut"
+DEPEND="${RDEPEND}
+ >=media-libs/plib-1.8.4"
+
+S=${WORKDIR}/${P}/src-${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}"-gentoo.patch
+ sed -i \
+ -e "s:@GENTOO_DATADIR@:${GAMES_DATADIR}/${PN}:" \
+ -e "s:@GENTOO_BINDIR@:${GAMES_BINDIR}:" \
+ Makefile ${PN}.cxx || die
+ append-flags -DHAVE_ISNANF
+}
+
+src_install() {
+ default
+ make_desktop_entry ${PN} Crashtest
+ prepgamesdirs
+}
diff --git a/games-simulation/crashtest/files/crashtest-1.1-gentoo.patch b/games-simulation/crashtest/files/crashtest-1.1-gentoo.patch
new file mode 100644
index 000000000000..820fd4924737
--- /dev/null
+++ b/games-simulation/crashtest/files/crashtest-1.1-gentoo.patch
@@ -0,0 +1,94 @@
+diff -ru crashtest-1.1.orig/src-crashtest/Makefile crashtest-1.1/src-crashtest/Makefile
+--- crashtest-1.1.orig/src-crashtest/Makefile 2009-02-15 17:11:31.000000000 -0500
++++ crashtest-1.1/src-crashtest/Makefile 2009-10-14 01:00:13.900627555 -0400
+@@ -1,34 +1,12 @@
+-# EDIT THESE SETTINGS
+-
+-PLIBPREFIX=/usr
+-ODEPREFIX=/usr
+-CXX=g++
+-
+-#PLIBPREFIX=$(HOME)
+-#ODEPREFIX=$(HOME)
+-#CXX=g++-4.0
+-
+-# END OF CUSTOM SETTINGS
+-
+-CXXFLAGS=\
+- -I$(ODEPREFIX)/include \
+- -I$(PLIBPREFIX)/include \
+- -I../src-common \
+- -O2 -g -Wall
+-
+-LFLAGS=\
+- -L$(PLIBPREFIX)/lib \
+- -L/usr/X11R6/lib
+-
+ OBJS=staticworldobject.o crashtest.o dynamicobject.o cartobject.o
++CXXFLAGS+=-I `fltk-config --includedir` `ode-config --cflags`
+
+-LIBS= $(ODEPREFIX)/lib/libode.a -lplibssgaux -lplibssg -lplibsg -lplibpu -lplibfnt -lplibul -lGLU -lGL `fltk-config --use-gl --use-images --ldflags`
+-
++LIBS= `ode-config --libs` -lplibssgaux -lplibssg -lplibsg -lplibpu -lplibfnt -lplibul -lGLU -lGL -lasound `fltk-config --use-gl --use-images --ldflags` -lglut
+
+ all: crashtest
+
+ crashtest: $(OBJS)
+- $(CXX) -o crashtest $(OBJS) $(LFLAGS) $(LIBS)
++ $(CXX) -o crashtest $(OBJS) $(LDFLAGS) $(LIBS)
+
+ staticworldobject.o: ../src-common/staticworldobject.cxx ../src-common/staticworldobject.h ../src-common/worldobject.h
+ $(CXX) -c $(CXXFLAGS) ../src-common/staticworldobject.cxx
+@@ -37,10 +14,10 @@
+ $(CXX) -c $(CXXFLAGS) ../src-common/dynamicobject.cxx
+
+ cartobject.o: cartobject.cxx cartobject.h
+- $(CXX) -c $(CXXFLAGS) cartobject.cxx
++ $(CXX) -c $(CXXFLAGS) -I../src-common cartobject.cxx
+
+ crashtest.o: crashtest.cxx crashworld.h ../src-common/modelmap.h cartobject.h bipedobject.h ../src-common/brickwall.h ../src-common/stereocontext.h ../src-common/usercam.h
+- $(CXX) -c $(CXXFLAGS) crashtest.cxx
++ $(CXX) -c $(CXXFLAGS) -I../src-common crashtest.cxx
+
+
+
+@@ -48,13 +25,13 @@
+ PLODE_DATADIR=`pwd` ./crashtest
+
+
+-GAMEDIR=$(DESTDIR)/usr/share/games/crashtest
++GAMEDIR=$(DESTDIR)@GENTOO_DATADIR@
+ install: crashtest
+ # Directories
+- mkdir -p $(DESTDIR)/usr/games/
++ mkdir -p $(DESTDIR)@GENTOO_BINDIR@
+ mkdir -p $(GAMEDIR)/models/
+ # Binary
+- install crashtest $(DESTDIR)/usr/games/crashtest
++ install crashtest $(DESTDIR)@GENTOO_BINDIR@
+ # Models
+ install -m 644 models/testground.3ds $(GAMEDIR)/models/testground.3ds
+ install -m 644 models/biped_torso.3ds $(GAMEDIR)/models/biped_torso.3ds
+diff -ru crashtest-1.1.orig/src-crashtest/crashtest.cxx crashtest-1.1/src-crashtest/crashtest.cxx
+--- crashtest-1.1.orig/src-crashtest/crashtest.cxx 2009-02-15 17:08:24.000000000 -0500
++++ crashtest-1.1/src-crashtest/crashtest.cxx 2009-10-14 01:01:25.822753522 -0400
+@@ -615,13 +615,7 @@
+
+ int main(int argc, char *argv[])
+ {
+- char *bindirname = dirname(argv[0]);
+- if (!strcmp(bindirname,"."))
+- dirprefix="/usr/share/games/crashtest";
+- else
+- {
+- dirprefix = dirname(bindirname) + std::string("/share/games/crashtest");
+- }
++ dirprefix="@GENTOO_DATADIR@";
+ if (getenv("PLODE_DATADIR"))
+ dirprefix = getenv("PLODE_DATADIR");
+ modelmap = new ModelMap(dirprefix);
+@@ -745,4 +739,3 @@
+ Fl::add_idle(idle, &simwin);
+ Fl::run();
+ }
+-
diff --git a/games-simulation/crashtest/metadata.xml b/games-simulation/crashtest/metadata.xml
new file mode 100644
index 000000000000..d06057ad270b
--- /dev/null
+++ b/games-simulation/crashtest/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>games</herd>
+<longdescription lang="en">
+Crashtest simulates car crashes. This is an educational tool that can be used to
+acquire much insight into this complex process. The user can learn about the
+relation between speed, reaction-time and stopping distance. Also, many physical
+properties can be studied.
+</longdescription>
+</pkgmetadata>