sci-misc/repsnapper: Fix building with GCC-6
authorPeter Levine <plevine457@gmail.com>
Thu, 25 May 2017 04:41:09 +0000 (00:41 -0400)
committerDavid Seifert <soap@gentoo.org>
Fri, 26 May 2017 20:59:37 +0000 (22:59 +0200)
Bug: https://bugs.gentoo.org/show_bug.cgi?id=594474
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Closes: https://github.com/gentoo/gentoo/pull/4753

sci-misc/repsnapper/files/repsnapper-2.4a_p0-gcc6.patch [new file with mode: 0644]
sci-misc/repsnapper/files/std_abs.patch [deleted file]
sci-misc/repsnapper/repsnapper-2.4a_p0.ebuild
sci-misc/repsnapper/repsnapper-9999.ebuild

diff --git a/sci-misc/repsnapper/files/repsnapper-2.4a_p0-gcc6.patch b/sci-misc/repsnapper/files/repsnapper-2.4a_p0-gcc6.patch
new file mode 100644 (file)
index 0000000..80a3c56
--- /dev/null
@@ -0,0 +1,54 @@
+From f6a411fa829f144800d123c1256d7d7648736437 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tiago=20St=C3=BCrmer=20Daitx?= <tdaitx@gmail.com>
+Date: Thu, 1 Sep 2016 00:02:48 -0300
+Subject: [PATCH 1/2] replace abs() with std::abs() for gcc6 compatibility
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Building with GCC 6 fails with "call of overloaded ‘abs(double)’ is
+ambiguous" - for some reason only on PowerPC and PPC64.
+---
+ libraries/amf/amftools-code/include/STL_File.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libraries/amf/amftools-code/include/STL_File.h b/libraries/amf/amftools-code/include/STL_File.h
+index 0bc01bed..2d9d656f 100644
+--- a/libraries/amf/amftools-code/include/STL_File.h
++++ b/libraries/amf/amftools-code/include/STL_File.h
+@@ -89,7 +89,7 @@ class aWeldVertex {
+       Vec3D v;\r
+       int OrigIndex;\r
+ \r
+-      static inline bool IsSoftLessThan(const aWeldVertex& v1, const aWeldVertex& v2){if(abs(v1.v.z - v2.v.z) <= WeldThresh){ if(abs(v1.v.y - v2.v.y) <= WeldThresh){ return v1.v.x < v2.v.x-WeldThresh;}else return (v1.v.y < v2.v.y-WeldThresh);} else return (v1.v.z < v2.v.z-WeldThresh); } //Is less then (generates a "hash" for sorting vertices by z for set\r
++      static inline bool IsSoftLessThan(const aWeldVertex& v1, const aWeldVertex& v2){if(std::abs(v1.v.z - v2.v.z) <= WeldThresh){ if(std::abs(v1.v.y - v2.v.y) <= WeldThresh){ return v1.v.x < v2.v.x-WeldThresh;}else return (v1.v.y < v2.v.y-WeldThresh);} else return (v1.v.z < v2.v.z-WeldThresh); } //Is less then (generates a "hash" for sorting vertices by z for set\r
+       static double WeldThresh; //weld threshold for importing from STL\r
+ };\r
+ \r
+
+From 93c81e3794a3eb7c2b7c7611803a3107fb25027b Mon Sep 17 00:00:00 2001
+From: "Ying-Chun Liu (PaulLiu)" <paulliu@debian.org>
+Date: Wed, 4 Jan 2017 13:50:56 +0800
+Subject: [PATCH 2/2] Fix FTBFS for glibmm Glib::RefPtr
+
+Now we can use operator RefPtr::operator bool() to test if it is NULL.
+RefPtr::operator== can not work on int.
+
+Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
+---
+ src/model.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/model.cpp b/src/model.cpp
+index ee559c47..22f0bb39 100644
+--- a/src/model.cpp
++++ b/src/model.cpp
+@@ -181,7 +181,7 @@ vector<Shape*> Model::ReadShapes(Glib::RefPtr<Gio::File> file,
+                                uint max_triangles)
+ {
+   vector<Shape*> shapes;
+-  if (file==0) return shapes;
++  if (!file) return shapes;
+   File sfile(file);
+   vector< vector<Triangle> > triangles;
+   vector<ustring> shapenames;
diff --git a/sci-misc/repsnapper/files/std_abs.patch b/sci-misc/repsnapper/files/std_abs.patch
deleted file mode 100644 (file)
index 35aefe9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- libraries/amf/amftools-code/include/STL_File.h.orig        2016-09-21 08:35:10.600313039 +0200
-+++ libraries/amf/amftools-code/include/STL_File.h     2016-09-21 08:35:58.303647256 +0200
-@@ -89,7 +89,7 @@
-       Vec3D v;\r
-       int OrigIndex;\r
- \r
--      static inline bool IsSoftLessThan(const aWeldVertex& v1, const aWeldVertex& v2){if(abs(v1.v.z - v2.v.z) <= WeldThresh){ if(abs(v1.v.y - v2.v.y) <= WeldThresh){ return v1.v.x < v2.v.x-WeldThresh;}else return (v1.v.y < v2.v.y-WeldThresh);} else return (v1.v.z < v2.v.z-WeldThresh); } //Is less then (generates a "hash" for sorting vertices by z for set\r
-+      static inline bool IsSoftLessThan(const aWeldVertex& v1, const aWeldVertex& v2){if(std::abs(v1.v.z - v2.v.z) <= WeldThresh){ if(std::abs(v1.v.y - v2.v.y) <= WeldThresh){ return v1.v.x < v2.v.x-WeldThresh;}else return (v1.v.y < v2.v.y-WeldThresh);} else return (v1.v.z < v2.v.z-WeldThresh); } //Is less then (generates a "hash" for sorting vertices by z for set\r
-       static double WeldThresh; //weld threshold for importing from STL\r
- };\r
- \r
index 330b26a5619f25902d3459a8067d03433c9342b1..26bbc8eb54b9c08ea92ccef4675637b02168b727 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -30,7 +30,7 @@ RDEPEND=${DEPEND}
 
 src_prepare() {
        epatch "${FILESDIR}/std-c11.patch"
-       epatch "${FILESDIR}/std_abs.patch"
+       epatch "${FILESDIR}/${P}-gcc6.patch"
        eautoreconf
        append-cxxflags -std=c++11
 }
index c4264c5a53e0fba5450a691c01957758b61c21a9..43bd03528bbe66f082505a51766927ea8f0dcc4f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -24,8 +24,6 @@ DEPEND="
 RDEPEND=${DEPEND}
 
 src_prepare() {
-       epatch "${FILESDIR}/std-c11.patch"
-       epatch "${FILESDIR}/std_abs.patch"
        eautoreconf
        append-cxxflags -std=c++11
 }