summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/torcs/APKBUILD59
-rw-r--r--user/torcs/define-uint.patch24
-rw-r--r--user/torcs/torcs-1.3.6-as-needed.patch96
-rw-r--r--user/torcs/torcs-1.3.6-format.patch34
-rw-r--r--user/torcs/torcs-1.3.6-gcc6.patch11
-rw-r--r--user/torcs/torcs-1.3.6-no-automake.patch21
6 files changed, 245 insertions, 0 deletions
diff --git a/user/torcs/APKBUILD b/user/torcs/APKBUILD
new file mode 100644
index 000000000..9f4f24a38
--- /dev/null
+++ b/user/torcs/APKBUILD
@@ -0,0 +1,59 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=torcs
+pkgver=1.3.7
+pkgrel=0
+pkgdesc="The Open Racing Car Simulator"
+url="http://torcs.sourceforge.net/"
+arch="all"
+license="GPL-2.0+"
+depends=""
+makedepends="freealut-dev freeglut-dev libogg-dev libpng-dev libsm-dev
+ libvorbis-dev libxmu-dev libxrandr-dev libxrender-dev libxt-dev mesa-dev
+ openal-soft-dev plib-dev zlib-dev"
+subpackages="$pkgname-data::noarch"
+source="https://sourceforge.net/projects/torcs/files/all-in-one/$pkgver/torcs-$pkgver.tar.bz2
+ torcs-1.3.6-as-needed.patch
+ torcs-1.3.6-format.patch
+ torcs-1.3.6-gcc6.patch
+ torcs-1.3.6-no-automake.patch
+ define-uint.patch
+ "
+
+build() {
+ cd "$builddir"
+ autoreconf
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --localstatedir=/var
+ make -j1
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+data() {
+ pkgdesc="Data files for TORCS"
+ cd "$builddir"
+ mkdir -p "$subpkgdir"/usr/share/games
+ chgrp games "$subpkgdir"/usr/share/games
+ make DESTDIR="$subpkgdir" datainstall
+}
+
+sha512sums="14b88624803c746b2f356fa185aca5be56b7d7e5192fede11307474100328bfaa67eafa61e84987bbad04590ae5740127e015707723df6d2c3197bb867818101 torcs-1.3.7.tar.bz2
+8df4f57b470100c123de5868edc471e4233bf7c8e3d23f759a822536ab28e74403375ecdbcbc404ed442d6820260db97d6c76be7d4fabdef7015722600148b2c torcs-1.3.6-as-needed.patch
+6368ab1df79005f5dede537b45db7ccc1943c2c53e0c696ff6b743680f2d48508e29b5ad56b10a373beddf28c82d5f123998d9e794b66ce49e0ea2226f2332aa torcs-1.3.6-format.patch
+9c29c78c4a2f6d2ea187f80c4c10337556ec13cf7dbe4380af37bccd0fa09a67a6209caff319a50c65f9e831b7d07c1af2c1ba8c33d9a3addc55713988fc3e46 torcs-1.3.6-gcc6.patch
+b1908224b82ca3de6694950770a1b70a4935b928b132bd352f67bc3c9b931699b579811f61909b98b28aba19eeb3df9e3d0c4ce8f85caaf4eff3306575efe212 torcs-1.3.6-no-automake.patch
+cc4541cfa8440ba044576da18c0eb310ba8d68863a409de8dc8fe73f34828cd035f9995baf535d2e1e639cb17cd8a1d92b2addf7d24d7d79f5b1a746be046b5c define-uint.patch"
diff --git a/user/torcs/define-uint.patch b/user/torcs/define-uint.patch
new file mode 100644
index 000000000..74e3f7773
--- /dev/null
+++ b/user/torcs/define-uint.patch
@@ -0,0 +1,24 @@
+--- torcs-1.3.7/src/linux/osspec.h.old 2003-03-23 19:43:13.000000000 +0000
++++ torcs-1.3.7/src/linux/osspec.h 2018-10-23 22:59:19.520000000 +0000
+@@ -26,6 +26,10 @@
+ #define TRKEXT "xml"
+ #define PARAMEXT ".xml"
+
++#ifndef __GLIBC__
++typedef unsigned int uint;
++#endif
++
+ #endif /* __OSSPEC__H__ */
+
+
+--- torcs-1.3.7/src/modules/simu/simuv2/SOLID-2.0/src/C-api.cpp.old 2012-05-31 23:44:35.000000000 +0000
++++ torcs-1.3.7/src/modules/simu/simuv2/SOLID-2.0/src/C-api.cpp 2018-10-23 23:04:24.590000000 +0000
+@@ -59,7 +59,7 @@
+ typedef map<DtObjectRef, Object *> ObjectList;
+ typedef set<Encounter> ProxList;
+
+-#ifdef WIN32
++#if defined(WIN32) || (defined(__linux__) && !defined(__GLIBC__))
+ #define uint unsigned int
+ #endif
+
diff --git a/user/torcs/torcs-1.3.6-as-needed.patch b/user/torcs/torcs-1.3.6-as-needed.patch
new file mode 100644
index 000000000..d848538c0
--- /dev/null
+++ b/user/torcs/torcs-1.3.6-as-needed.patch
@@ -0,0 +1,96 @@
+--- torcs-1.3.6.orig/Make-default.mk
++++ torcs-1.3.6/Make-default.mk
+@@ -402,7 +402,7 @@
+ ifdef PROGRAM
+
+ ${PROGRAM}: ${OBJECTS} $(subst -l,${EXPORTBASE}/lib/lib, ${LIBS:=.a})
+- ${CXX} ${OBJECTS} ${LDFLAGS} ${LIBS} ${SOLIBS} ${EXT_LIBS} -o $@
++ ${CXX} ${LDFLAGS} -o $@ ${OBJECTS} ${SOLIBS} ${LIBS} ${EXT_LIBS}
+
+ installprogram: ${PROGRAM}
+ @ createdir="${INSTLIBBASE}" ; \
+@@ -420,14 +420,14 @@
+ ifdef LOCALTOOLS
+
+ ${LOCALTOOLS}: ${OBJECTS} $(subst -l,${EXPORTBASE}/lib/lib, ${LIBS:=.a})
+- ${CXX} ${OBJECTS} ${LDFLAGS} ${LIBS} ${EXT_LIBS} ${SOLIBS} -o $@
++ ${CXX} ${LDFLAGS} -o $@ ${OBJECTS} ${SOLIBS} ${LIBS} ${EXT_LIBS}
+
+ endif
+
+ ifdef TOOLS
+
+ ${TOOLS}: ${OBJECTS} $(subst -l,${EXPORTBASE}/lib/lib, ${LIBS:=.a})
+- ${CXX} ${OBJECTS} ${LDFLAGS} ${LIBS} ${EXT_LIBS} ${SOLIBS} -o $@
++ ${CXX} ${LDFLAGS} -o $@ ${OBJECTS} ${SOLIBS} ${LIBS} ${EXT_LIBS}
+
+ installtools: ${TOOLS}
+ @createdir="${INSTBINBASE}/${TOOLSDIR}" ; \
+@@ -478,7 +478,7 @@
+ ifdef SOLIBRARY
+
+ ${SOLIBRARY}: ${OBJECTS}
+- ${CXX} -shared -o ${SOLIBRARY} ${OBJECTS} ${SOLIBS} ${LDFLAGS} ${LIBSPATH} ${LIBS} ${DEBUG_LIBS}
++ ${CXX} ${CXXFLAGS} ${LDFLAGS} -shared -o ${SOLIBRARY} ${OBJECTS} ${SOLIBS} ${LIBS} ${EXT_LIBS}
+ @D=`pwd` ; \
+ createdir="${EXPORTBASE}/lib" ; \
+ $(mkinstalldirs) $$createdir ; \
+@@ -509,7 +509,7 @@
+ ifdef MODULE
+
+ ${MODULE}: ${OBJECTS}
+- ${CXX} -shared -o ${MODULE} ${OBJECTS} ${LDFLAGS} ${LIBSPATH} ${LIBS}
++ ${CXX} ${CXXFLAGS} ${LDFLAGS} -shared -o ${MODULE} ${OBJECTS} ${SOLIBS} ${LIBS} ${EXT_LIBS}
+ @D=`pwd` ; \
+ createdir="${EXPORTBASE}/${MODULEDIR}" ; \
+ $(mkinstalldirs) $$createdir ; \
+--- torcs-1.3.6.orig/configure.in
++++ torcs-1.3.6/configure.in
+@@ -123,11 +123,11 @@
+ AC_CHECK_LIB(Xxf86vm, XF86VidModeSetViewPort,,AC_MSG_ERROR([Can't find libXxf86vm. Please check config.log and if you can't solve the problem send the file to torcs-users@lists.sourceforge.net with the subject \"torcs compilation problem\"]))
+ AC_CHECK_LIB(Xrender, XRenderSetSubpixelOrder,,AC_MSG_ERROR([Can't find libXrender. Please check config.log and if you can't solve the problem send the file to torcs-users@lists.sourceforge.net with the subject \"torcs compilation problem\"]))
+ AC_CHECK_LIB(Xrandr, XRRQueryVersion,,AC_MSG_ERROR([Can't find libXrandr. Please check config.log and if you can't solve the problem send the file to torcs-users@lists.sourceforge.net with the subject \"torcs compilation problem\"]))
+-AC_CHECK_LIB(openal, alEnable, LDFLAGS="$LDFLAGS -lopenal", AC_MSG_ERROR([Can't find AL/al.h. OpenAL can be found on http://www.openal.org/]))
++AC_CHECK_LIB(openal, alEnable, LIBS="$LIBS -lopenal", AC_MSG_ERROR([Can't find AL/al.h. OpenAL can be found on http://www.openal.org/]))
+ AC_CHECK_LIB(alut, alutLoadWAVFile,
+- LDFLAGS="$LDFLAGS -lalut",
+- LDFLAGS="$LDFLAGS")
+-AC_CHECK_LIB(vorbisfile, ov_fopen, LDFLAGS="$LDFLAGS -lvorbisfile", AC_MSG_ERROR([Can't find libvorbis.]))
++ LIBS="$LIBS -lalut", )
++AC_CHECK_LIB(vorbisfile, ov_fopen, LIBS="$LIBS -lvorbisfile", AC_MSG_ERROR([Can't find libvorbis.]))
++
+
+ AC_CHECK_LIB(dl, dlopen)
+ AC_CHECK_FUNC(dlopen,,AC_MSG_ERROR([Can't find dlopen function. Please check config.log and if you can't solve the problem send the file to torcs-users@lists.sourceforge.net with the subject \"torcs compilation problem\"]))
+--- torcs-1.3.6.orig/src/libs/Makefile
++++ torcs-1.3.6/src/libs/Makefile
+@@ -23,7 +23,7 @@
+
+ TOOLSUBDIRS = txml
+
+-SUBDIRS = confscreens racescreens robottools txml tgf tgfclient client raceengineclient learning \
++SUBDIRS = confscreens racescreens robottools txml tgf tgfclient raceengineclient client learning \
+ portability math musicplayer
+
+ PKGSUBDIRS = $(SUBDIRS)
+--- torcs-1.3.6.orig/src/libs/client/Makefile
++++ torcs-1.3.6/src/libs/client/Makefile
+@@ -23,6 +23,8 @@
+ SOURCES = entry.cpp mainmenu.cpp splash.cpp exitmenu.cpp \
+ optionmenu.cpp
+
++SOLIBS = -lconfscreens -lraceengine
++
+ LIBS = -lplibssg -lplibsg -lplibul
+
+ EXPDIR = include
+--- torcs-1.3.6.orig/src/libs/tgf/Makefile
++++ torcs-1.3.6/src/libs/tgf/Makefile
+@@ -29,6 +29,7 @@
+ profiler.cpp \
+ hash.cpp
+
++SOLIBS = -ltxml
+
+ EXPDIR = include
+
diff --git a/user/torcs/torcs-1.3.6-format.patch b/user/torcs/torcs-1.3.6-format.patch
new file mode 100644
index 000000000..da59c4da4
--- /dev/null
+++ b/user/torcs/torcs-1.3.6-format.patch
@@ -0,0 +1,34 @@
+--- a/src/tools/texmapper/maintexmapper.cpp 2015-12-23 20:55:24.874102363 +0100
++++ b/src/tools/texmapper/maintexmapper.cpp 2015-12-23 20:55:55.071553325 +0100
+@@ -103,7 +103,7 @@
+ {
+ int i, j;
+
+- printf(title);
++ printf("%s", title);
+ for (j = 0; j < 4; j ++){
+ for (i = 0; i < 4; i ++) {
+ printf("%.6f ", m[i][j]);
+--- a/src/tools/trackgen/objects.cpp 2015-12-23 20:59:49.671287196 +0100
++++ b/src/tools/trackgen/objects.cpp 2015-12-23 21:02:21.639523189 +0100
+@@ -234,9 +234,9 @@
+
+ ssgLeaf *vt = (ssgLeaf *)ent;
+ if (vt->getCullFace() == TRUE) {
+- surf = "SURF 0x10\n";
++ surf = "0x10";
+ } else {
+- surf = "SURF 0x30\n";
++ surf = "0x30";
+ }
+
+ int num_verts = vt->getNumVertices();
+@@ -304,7 +304,7 @@
+ fprintf (save_fd, "numsurf %d\n", num_tris);
+
+ for (i = 0; i < num_tris; i++) {
+- fprintf (save_fd, surf);
++ fprintf (save_fd, "SURF %s\n", surf);
+ fprintf (save_fd, "mat 0\n");
+ fprintf (save_fd, "refs 3\n");
+ fprintf (save_fd, "%d %g %g\n",
diff --git a/user/torcs/torcs-1.3.6-gcc6.patch b/user/torcs/torcs-1.3.6-gcc6.patch
new file mode 100644
index 000000000..6daf22a81
--- /dev/null
+++ b/user/torcs/torcs-1.3.6-gcc6.patch
@@ -0,0 +1,11 @@
+--- a/src/drivers/olethros/geometry.cpp
++++ b/src/drivers/olethros/geometry.cpp
+@@ -27,6 +27,8 @@
+ #ifdef WIN32
+ #include <float.h>
+ #define isnan _isnan
++#elif __cplusplus >= 201103L
++using std::isnan;
+ #endif
+
+
diff --git a/user/torcs/torcs-1.3.6-no-automake.patch b/user/torcs/torcs-1.3.6-no-automake.patch
new file mode 100644
index 000000000..de57eeea0
--- /dev/null
+++ b/user/torcs/torcs-1.3.6-no-automake.patch
@@ -0,0 +1,21 @@
+torcs doesn't use automake, so it shouldn't be calling the macro
+
+http://bugs.gentoo.org/408473
+
+--- torcs-1.3.7.orig/configure.in
++++ torcs-1.3.7/configure.in
+@@ -15,9 +15,12 @@
+ #
+ ##############################################################################
+
+-AC_INIT(Make-config.in)
++AC_INIT(torcs, 1.3.7)
+ AC_CONFIG_HEADERS(config.h)
+-AM_INIT_AUTOMAKE(torcs, 1.3.7)
++dnl Workaround code using old VERSION instead of new PACKAGE_VERSION
++VERSION=$PACKAGE_VERSION
++AC_DEFINE_UNQUOTED([VERSION], "$VERSION", [old VERSION workaround])
++AC_SUBST(VERSION)
+
+ dnl Checks for programs.
+ AC_PROG_CC