logo

overlay

My (experimental) gentoo overlay
commit: bef6392eb456f4092d4d7c6d864fc64dd1b3e120
parent: e5e0778388c450846e8d11a8826e7f9e45805219
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 10 Jun 2019 19:45:04 +0200

games-sports/vdrift: New package

Diffstat:

Agames-sports/vdrift/Manifest1+
Agames-sports/vdrift/files/vdrift-20120722-build.patch28++++++++++++++++++++++++++++
Agames-sports/vdrift/files/vdrift-20120722-bullet.patch101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Agames-sports/vdrift/files/vdrift-2014.10.20-gcc6.patch12++++++++++++
Agames-sports/vdrift/files/vdrift-2014.10.20-sconscript.patch11+++++++++++
Agames-sports/vdrift/files/vdrift-2014.10.20-sconstruct.patch59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Agames-sports/vdrift/metadata.xml11+++++++++++
Agames-sports/vdrift/vdrift-2014.10.20.ebuild58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Agames-sports/vdrift/vdrift-9999.ebuild56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 files changed, 337 insertions(+), 0 deletions(-)

diff --git a/games-sports/vdrift/Manifest b/games-sports/vdrift/Manifest @@ -0,0 +1 @@ +DIST vdrift-2014-10-20.tar.bz2 508011987 BLAKE2B e2eacc9dd81eafab67e4b29fdf04804a795aa943cb63145b7688fa0accb08c55bec62060e78b0c4808d7acd32e5e77c405e044b3a11d7f3715f5447da5f72222 SHA512 5f6afbb4bdc273455f6bf4e3eba6e3b702d96fbe3c7b5068cee0c114d5de28b82ceed44ee891f59e9bfe194f0c597f464a13aadf7f34b204630ec54df282e4ee diff --git a/games-sports/vdrift/files/vdrift-20120722-build.patch b/games-sports/vdrift/files/vdrift-20120722-build.patch @@ -0,0 +1,28 @@ +--- VDrift.orig/SConstruct ++++ VDrift/SConstruct +@@ -44,6 +44,7 @@ + LIBPATH = ['.', '#lib', LOCALBASE + '/lib'], + LINKFLAGS = ['-pthread','-lintl'], + options = opts) ++ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) + check_headers = ['GL/gl.h', 'GL/glu.h', 'SDL/SDL.h', 'SDL/SDL_image.h', 'SDL/SDL_rotozoom.h', 'vorbis/vorbisfile.h', 'GL/glew.h', 'bullet/btBulletCollisionCommon.h'] + check_libs = [] + if 'CC' in os.environ: +@@ -380,7 +381,7 @@ + if env['release']: + # release build, debugging off, optimizations on + if (sys.platform != 'freebsd6') and (sys.platform != 'freebsd7') and (sys.platform != 'freebsd8') and (sys.platform != 'freebsd9') and (sys.platform != 'win32') and (sys.platform != 'cygwin'): +- env.Append(CCFLAGS = ['-O1', '-pipe']) ++ env.Append(CCFLAGS = ['-pipe']) + else: + # debug build, lots of debugging, no optimizations + env.Append(CCFLAGS = ['-g3']) +@@ -399,7 +400,6 @@ + env.Append(CCFLAGS = ['-pg']) + env.Append(LINKFLAGS = ['-pg']) + env.Append(CCFLAGS = ['-g3']) +- env.Append(CCFLAGS = ['-O1']) + + #------------------------------------# + # compile-time efficiency assessment # + diff --git a/games-sports/vdrift/files/vdrift-20120722-bullet.patch b/games-sports/vdrift/files/vdrift-20120722-bullet.patch @@ -0,0 +1,100 @@ +--- src/cardynamics.cpp Mon Jan 19 23:26:36 1970 ++++ src/cardynamics.cpp Mon Jan 19 23:26:36 1970 +@@ -1791,23 +1791,29 @@ + + bool CARDYNAMICS::WheelContactCallback( + btManifoldPoint& cp, +- const btCollisionObject* colObj0, +- int partId0, ++ const btCollisionObjectWrapper* col0, ++ int part0, + int index0, +- const btCollisionObject* colObj1, +- int partId1, ++ const btCollisionObjectWrapper* col1, ++ int part1, + int index1) + { +- // cars are fracture bodies, wheel is a cylinder shape +- const btCollisionShape* shape = colObj0->getCollisionShape(); +- if ((colObj0->getInternalType() & CO_FRACTURE_TYPE) && ++#if (BT_BULLET_VERSION < 281) ++ const btCollisionObject* obj = col0; ++ const btCollisionShape* shape = obj->getCollisionShape(); ++ const btCollisionShape* rootshape = obj->getRootCollisionShape(); ++#else ++ const btCollisionObject* obj = col0->getCollisionObject(); ++ const btCollisionShape* shape = col0->getCollisionShape(); ++ const btCollisionShape* rootshape = obj->getCollisionShape(); ++#endif ++ if ((obj->getInternalType() & CO_FRACTURE_TYPE) && + (shape->getShapeType() == CYLINDER_SHAPE_PROXYTYPE)) + { +- // is contact within contact patch? +- const btCompoundShape* car = static_cast<const btCompoundShape*>(colObj0->getRootCollisionShape()); +- const btCylinderShapeX* wheel = static_cast<const btCylinderShapeX*>(shape); +- btVector3 contactPoint = cp.m_localPointA - car->getChildTransform(cp.m_index0).getOrigin(); +- if (-direction::up.dot(contactPoint) > 0.5 * wheel->getRadius()) ++ const btCompoundShape* carshape = static_cast<const btCompoundShape*>(rootshape); ++ const btCylinderShapeX* wheelshape = static_cast<const btCylinderShapeX*>(shape); ++ btVector3 contactPoint = cp.m_localPointA - carshape->getChildTransform(cp.m_index0).getOrigin(); ++ if (-direction::up.dot(contactPoint) > 0.5 * wheelshape->getRadius()) + { + // break contact (hack) + cp.m_normalWorldOnB = btVector3(0, 0, 0); +--- src/cardynamics.h Mon Jan 19 23:26:36 1970 ++++ src/cardynamics.h Mon Jan 19 23:26:36 1970 +@@ -25,6 +25,12 @@ + class FractureBody; + class PTree; + ++#if (BT_BULLET_VERSION < 281) ++#define btCollisionObjectWrapper btCollisionObject ++#else ++struct btCollisionObjectWrapper; ++#endif ++ + class CARDYNAMICS : public btActionInterface + { + friend class PERFORMANCE_TESTING; +@@ -151,11 +157,11 @@ + + static bool WheelContactCallback( + btManifoldPoint& cp, +- const btCollisionObject* colObj0, +- int partId0, ++ const btCollisionObjectWrapper* col0, ++ int part0, + int index0, +- const btCollisionObject* colObj1, +- int partId1, ++ const btCollisionObjectWrapper* col1, ++ int part1, + int index1); + + protected: +--- src/dynamicsworld.cpp Mon Jan 19 23:26:36 1970 ++++ src/dynamicsworld.cpp Mon Jan 19 23:26:36 1970 +@@ -105,7 +105,7 @@ + int patch_id = -1; + const BEZIER * b = 0; + const TRACKSURFACE * s = TRACKSURFACE::None(); +- btCollisionObject * c = 0; ++ const btCollisionObject * c = 0; + + MyRayResultCallback ray(origin, p, caster); + rayTest(origin, p, ray); +@@ -221,6 +221,7 @@ + + void DynamicsWorld::fractureCallback() + { ++#if (BT_BULLET_VERSION < 281) + m_activeConnections.resize(0); + + int numManifolds = getDispatcher()->getNumManifolds(); +@@ -268,4 +269,5 @@ + btRigidBody* child = body->updateConnection(con_id); + if (child) addRigidBody(child); + } ++#endif + }+ \ No newline at end of file diff --git a/games-sports/vdrift/files/vdrift-2014.10.20-gcc6.patch b/games-sports/vdrift/files/vdrift-2014.10.20-gcc6.patch @@ -0,0 +1,12 @@ +diff -up ./src/graphics/model_obj.cpp.gcc6 ./src/graphics/model_obj.cpp +--- ./src/graphics/model_obj.cpp.gcc6 2016-02-09 19:02:50.282554264 -0500 ++++ ./src/graphics/model_obj.cpp 2016-02-09 19:03:10.566308088 -0500 +@@ -221,7 +221,7 @@ bool ModelObj::Save(const std::string & + std::ofstream f(strFileName.c_str()); + if (!f) + { +- error_output << "Error opening file for writing: " << error_output << endl; ++ error_output << "Error opening file for writing: " << strFileName << endl; + return false; + } + diff --git a/games-sports/vdrift/files/vdrift-2014.10.20-sconscript.patch b/games-sports/vdrift/files/vdrift-2014.10.20-sconscript.patch @@ -0,0 +1,11 @@ +--- ./src/SConscript.orig 2014-09-04 16:06:21.000000000 -0400 ++++ ./src/SConscript 2017-10-15 11:22:06.536446627 -0400 +@@ -151,7 +151,7 @@ src = Split(""" + utils.cpp + window.cpp""") + +-src.sort(lambda x, y: cmp(x.lower(),y.lower())) ++src.sort(key=lambda x: x.lower()) + + #------------------------# + # Copy Build Environment # diff --git a/games-sports/vdrift/files/vdrift-2014.10.20-sconstruct.patch b/games-sports/vdrift/files/vdrift-2014.10.20-sconstruct.patch @@ -0,0 +1,59 @@ +--- ./SConstruct.orig 2014-08-04 08:43:04.000000000 -0400 ++++ ./SConstruct 2017-10-15 11:18:01.792656230 -0400 +@@ -92,9 +92,9 @@ elif sys.platform == 'darwin': + + for a in env['universal']: + if not sdk_path: +- print 'Building a universal binary require access to an ' + \ ++ print ('Building a universal binary require access to an ' + \ + 'SDK that has universal \nbinary support.If you know ' + \ +- 'the location of such an SDK, specify it using the \n"SDK" option' ++ 'the location of such an SDK, specify it using the \n"SDK" option') + Exit(1) + env.Append( CCFLAGS = ['-arch', a], LINKFLAGS = ['-arch', a] ) + +@@ -141,11 +141,11 @@ else: + CC = 'gcc', CXX = 'g++', + options = opts) + # Take environment variables into account +- if os.environ.has_key('CXX'): ++ if 'CXX' in os.environ: + env['CXX'] = os.environ['CXX'] +- if os.environ.has_key('CXXFLAGS'): ++ if 'CXXFLAGS' in os.environ: + env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) +- if os.environ.has_key('LDFLAGS'): ++ if 'LDFLAGS' in os.environ: + env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) + check_headers = ['GL/gl.h', 'SDL2/SDL.h', 'SDL2/SDL_image.h', 'vorbis/vorbisfile.h', 'curl/curl.h', 'bullet/btBulletCollisionCommon.h', 'bullet/btBulletDynamicsCommon.h'] + check_libs = [] +@@ -232,7 +232,7 @@ def distcopy (target, source, env): + def tarballer (target, source, env): + cmd = 'tar -jcf "%s" -C "%s" .' % ( str(target[0]), str(source[0]) ) + #cmd = 'tar -jcf ' + str (target[0]) + ' ' + str(source[0]) + " --exclude '*~' " +- print 'running ', cmd, ' ... ' ++ print ('running ', cmd, ' ... ') + p = os.popen (cmd) + return p.close () + +@@ -362,11 +362,11 @@ env.ParseConfig('pkg-config bullet --lib + conf = Configure(env) + for header in check_headers: + if not conf.CheckCXXHeader(header): +- print 'You do not have the %s headers installed. Exiting.' % header ++ print ('You do not have the %s headers installed. Exiting.' % header) + Exit(1) + for lib in check_libs: + if not conf.CheckLibWithHeader(lib[0], lib[1], 'C', lib[2]): +- print lib[3] ++ print (lib[3]) + Exit(1) + + env = conf.Finish() +@@ -535,4 +535,5 @@ if 'data-package' in COMMAND_LINE_TARGET + if 'autopackage' in COMMAND_LINE_TARGETS: + os.system("CXX1=g++-3.4 CXX2=g++-4.1 APBUILD_CXX1=g++-3.4 APBUILD_NO_STATIC_X=1 VDRIFT_VERSION=%s VDRIFT_MINIMAL=%d VDRIFT_RELEASE=%d makepackage tools/autopackage/vdrift.apspec" % (version, env['minimal'], env['release'])) + +-SConscript('src/SConscript', variant_dir = build_dir, duplicate = 0) ++VariantDir(build_dir, '.', duplicate = 0) ++SConscript('src/SConscript') diff --git a/games-sports/vdrift/metadata.xml b/games-sports/vdrift/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>games@gentoo.org</email> + <name>Gentoo Games Project</name> + </maintainer> + <upstream> + <remote-id type="sourceforge">vdrift</remote-id> + </upstream> +</pkgmetadata> diff --git a/games-sports/vdrift/vdrift-2014.10.20.ebuild b/games-sports/vdrift/vdrift-2014.10.20.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2015 Gentoo Foundation +# Copyright 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me> +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) + +inherit python-any-r1 scons-utils + +MY_P="${PN}-$(ver_rs 1-2 -)" + +DESCRIPTION="A driving simulation made with drift racing in mind" +HOMEPAGE="http://vdrift.net/" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2" + +LICENSE="GPL-3 ZLIB LGPL-2.1+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +S="${WORKDIR}/${PN}" + +RDEPEND=" + media-libs/libsdl2[opengl,video] + media-libs/sdl2-image[png] + media-libs/libvorbis + net-misc/curl + sci-physics/bullet[-double-precision] + " +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-gcc6.patch" + "${FILESDIR}/${P}-sconscript.patch" + "${FILESDIR}/${P}-sconstruct.patch" +) + +src_configure() { + MYSCONS=( + destdir="${D}" + prefix=/usr + release=1 + os_cc=1 + os_cxx=1 + os_cxxflags=1 + force_feedback=1 + ) +} + +src_compile() { + escons "${MYSCONS[@]}" +} + +src_install() { + escons "${MYSCONS[@]}" DESTDIR="${D}" install + default +} diff --git a/games-sports/vdrift/vdrift-9999.ebuild b/games-sports/vdrift/vdrift-9999.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2015 Gentoo Foundation +# Copyright 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me> +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) + +inherit python-any-r1 scons-utils + +MY_P="${PN}-$(ver_rs 1-2 -)" + +if [ "${PV}" == "9999" ]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/VDrift/vdrift" +else + SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="A driving simulation made with drift racing in mind" +HOMEPAGE="http://vdrift.net/" +LICENSE="GPL-3 ZLIB LGPL-2.1+" +SLOT="0" + +S="${WORKDIR}/${PN}" + +RDEPEND=" + media-libs/libsdl2[opengl,video] + media-libs/sdl2-image[png] + media-libs/libvorbis + net-misc/curl + sci-physics/bullet[-double-precision] + " +DEPEND="${RDEPEND}" + +src_configure() { + MYSCONS=( + destdir="${D}" + prefix=/usr + release=1 + os_cc=1 + os_cxx=1 + os_cxxflags=1 + force_feedback=1 + ) +} + +src_compile() { + escons "${MYSCONS[@]}" +} + +src_install() { + escons "${MYSCONS[@]}" DESTDIR="${D}" install + default +}