summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorjose17112018-08-18 23:45:31 +0200
committerjose17112018-08-18 23:45:31 +0200
commit6921e8039771e0a897b2197546e36f4da611f0e7 (patch)
tree5d74f978b4b95460c04e44a373302ce826bd896f
parent945f50a6e31fe66fc661ac6e08333b96509e3a48 (diff)
downloadaur-6921e8039771e0a897b2197546e36f4da611f0e7.tar.gz
Added patches from Debian to fix building
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD20
-rw-r--r--build-fix.patch12
-rw-r--r--gcc6-isnan.patch25
-rw-r--r--gcc7.patch18
5 files changed, 63 insertions, 33 deletions
diff --git a/.SRCINFO b/.SRCINFO
index cadf883fe90e..d66ca335c2e3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,12 @@
+# Generated by mksrcinfo v8
+# Sat Aug 18 21:45:05 UTC 2018
pkgbase = torcs
pkgdesc = A 3D racing cars simulator using OpenGL
pkgver = 1.3.7
- pkgrel = 2
+ pkgrel = 3
url = http://torcs.sourceforge.net
arch = x86_64
+ arch = i686
license = GPL
makedepends = plib
makedepends = mesa
@@ -15,20 +18,14 @@ pkgbase = torcs
depends = libxrandr
depends = libvorbis
depends = glu
+ depends = torcs-data=1.3.7
options = !makeflags
source = http://downloads.sourceforge.net/sourceforge/torcs/torcs-1.3.7.tar.bz2
- source = build-fix.patch
+ source = gcc7.patch
+ source = gcc6-isnan.patch
md5sums = de314c3e421e8d7d4323d819c5010d23
- md5sums = e011b533142879b1a399ce1cdeb1772c
+ md5sums = 64216e9dba6cc030c38cde8efea3e59d
+ md5sums = e84edaa1660f55fd980136f70e6471e6
pkgname = torcs
- depends = freeglut
- depends = libpng
- depends = freealut
- depends = libxi
- depends = libxmu
- depends = libxrandr
- depends = libvorbis
- depends = glu
- depends = torcs-data=1.3.7
diff --git a/PKGBUILD b/PKGBUILD
index 1370a96acc67..cd96da3d6cbe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,25 +1,29 @@
# $Id: PKGBUILD 266875 2017-11-15 14:29:11Z foutrelis $
-# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Maintainer: Jose Riha <jose1711 gmail com>
+# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Shahar Weiss <sweiss4@gmx.net>
pkgname=torcs
pkgver=1.3.7
-pkgrel=2
+pkgrel=3
pkgdesc="A 3D racing cars simulator using OpenGL"
url="http://torcs.sourceforge.net"
license=("GPL")
-arch=('x86_64')
-depends=('freeglut' 'libpng' 'freealut' 'libxi' 'libxmu' 'libxrandr' 'libvorbis' 'glu')
+arch=('x86_64' 'i686')
+depends=('freeglut' 'libpng' 'freealut' 'libxi' 'libxmu' 'libxrandr' 'libvorbis' 'glu' "torcs-data=$pkgver")
makedepends=('plib' 'mesa')
options=('!makeflags')
source=(http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-${pkgver/_/-}.tar.bz2
- build-fix.patch)
+ gcc7.patch
+ gcc6-isnan.patch)
md5sums=('de314c3e421e8d7d4323d819c5010d23'
- 'e011b533142879b1a399ce1cdeb1772c')
+ '64216e9dba6cc030c38cde8efea3e59d'
+ 'e84edaa1660f55fd980136f70e6471e6')
prepare() {
cd "$srcdir"/$pkgname-${pkgver/_/-}
- patch -p1 <"$srcdir"/build-fix.patch
+ patch -p1 <"$srcdir"/gcc7.patch
+ patch -p1 <"$srcdir"/gcc6-isnan.patch
}
build() {
@@ -30,10 +34,8 @@ build() {
}
package() {
- depends=(${depends[@]} "torcs-data=$pkgver")
cd "$srcdir"/$pkgname-${pkgver/_/-}
make DESTDIR="$pkgdir" install
- make DESTDIR="$pkgdir" datainstall
install -D -m644 Ticon.png "$pkgdir"/usr/share/pixmaps/torcs.png
install -D -m644 torcs.desktop "$pkgdir"/usr/share/applications/torcs.desktop
find "$pkgdir" -type d -exec chmod 755 {} \;
diff --git a/build-fix.patch b/build-fix.patch
deleted file mode 100644
index 07be902a380c..000000000000
--- a/build-fix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -wbBur torcs-1.3.7/src/drivers/olethros/geometry.cpp torcs-1.3.7.my/src/drivers/olethros/geometry.cpp
---- torcs-1.3.7/src/drivers/olethros/geometry.cpp 2006-01-06 18:22:29.000000000 +0300
-+++ torcs-1.3.7.my/src/drivers/olethros/geometry.cpp 2016-08-09 21:44:26.976853102 +0300
-@@ -27,6 +27,8 @@
- #ifdef WIN32
- #include <float.h>
- #define isnan _isnan
-+#else
-+#define isnan std::isnan
- #endif
-
-
diff --git a/gcc6-isnan.patch b/gcc6-isnan.patch
new file mode 100644
index 000000000000..ff415fe5d279
--- /dev/null
+++ b/gcc6-isnan.patch
@@ -0,0 +1,25 @@
+From: Aurelien Jarno <aurelien@aurel32.net>
+Date: Mon, 1 May 2017 15:53:17 +0200
+Subject: gcc6-isnan
+
+car->ctrl->gear is defined as int, therefore it can never be infinite or
+NaN. Just drop the tests.
+
+Forwarded: https://sourceforge.net/p/torcs/mailman/message/35831161/
+---
+ src/drivers/olethros/geometry.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/drivers/olethros/geometry.cpp b/src/drivers/olethros/geometry.cpp
+index 7b6bc82..846aef7 100644
+--- a/src/drivers/olethros/geometry.cpp
++++ b/src/drivers/olethros/geometry.cpp
+@@ -370,7 +370,7 @@ void EstimateSphere (std::vector<Vector> P, ParametricSphere* sphere)
+ }
+ delta_total += delta;
+ }
+- if (isnan(r)) {
++ if (std::isnan(r)) {
+ for (i=0; i<d; i++) {
+ center[i] = ((*(sphere->C))[i] - mean[i]) / scale;
+ }
diff --git a/gcc7.patch b/gcc7.patch
new file mode 100644
index 000000000000..e7706ca495b2
--- /dev/null
+++ b/gcc7.patch
@@ -0,0 +1,18 @@
+--- a/src/libs/musicplayer/OpenALMusicPlayer.cpp 2014-02-05 09:54:43.000000000 +0000
++++ b/src/libs/musicplayer/OpenALMusicPlayer.cpp 2017-08-10 03:28:31.025410384 +0000
+@@ -161,7 +161,7 @@
+ {
+ char pcm[BUFFERSIZE];
+ int size = 0;
+- const char* error = '\0';
++ const char* error = nullptr;
+
+ if (!stream->read(pcm, BUFFERSIZE, &size, &error)) {
+ GfError("OpenALMusicPlayer: Stream read error: %s\n", error);
+@@ -268,4 +268,4 @@
+ alSourcePlay(source);
+
+ return true;
+-}
+\ No newline at end of file
++}