commit:     ee4a29effa2dc4c4d279dcfa57d4d8ff6574f6f0
Author:     Slawomir Lis <slis <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 21 06:50:54 2016 +0000
Commit:     Slawek Lis <slis <AT> gentoo <DOT> org>
CommitDate: Wed Sep 21 11:56:57 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee4a29ef

sci-misc/repsnapper: Added patch to fix compilation error with newer gcc

This bug is issued in newer gcc's because of abs() method is moved into
std namespace. Added a patch to fix the issue.
Reported in bug 594474

Reported-By: Toralf Förster <toralf.foerster <AT> gmx.de>

Package-Manager: portage-2.3.0

 sci-misc/repsnapper/files/std_abs.patch       | 11 +++++++++++
 sci-misc/repsnapper/repsnapper-2.4a_p0.ebuild |  1 +
 sci-misc/repsnapper/repsnapper-9999.ebuild    |  3 +++
 3 files changed, 15 insertions(+)

diff --git a/sci-misc/repsnapper/files/std_abs.patch 
b/sci-misc/repsnapper/files/std_abs.patch
new file mode 100644
index 00000000..35aefe9
--- /dev/null
+++ b/sci-misc/repsnapper/files/std_abs.patch
@@ -0,0 +1,11 @@
+--- 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;
+       int OrigIndex;
+ 
+-      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
++      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
+       static double WeldThresh; //weld threshold for importing from STL
+ };
+ 

diff --git a/sci-misc/repsnapper/repsnapper-2.4a_p0.ebuild 
b/sci-misc/repsnapper/repsnapper-2.4a_p0.ebuild
index a976a17..ce016a8 100644
--- a/sci-misc/repsnapper/repsnapper-2.4a_p0.ebuild
+++ b/sci-misc/repsnapper/repsnapper-2.4a_p0.ebuild
@@ -31,6 +31,7 @@ RDEPEND=${DEPEND}
 
 src_prepare() {
        epatch "${FILESDIR}/std-c11.patch"
+       epatch "${FILESDIR}/std_abs.patch"
        eautoreconf
        append-cxxflags -std=c++11
 }

diff --git a/sci-misc/repsnapper/repsnapper-9999.ebuild 
b/sci-misc/repsnapper/repsnapper-9999.ebuild
index c56bddd..34e7a93 100644
--- a/sci-misc/repsnapper/repsnapper-9999.ebuild
+++ b/sci-misc/repsnapper/repsnapper-9999.ebuild
@@ -25,5 +25,8 @@ DEPEND="
 RDEPEND=${DEPEND}
 
 src_prepare() {
+       epatch "${FILESDIR}/std-c11.patch"
+       epatch "${FILESDIR}/std_abs.patch"
        eautoreconf
+       append-cxxflags -std=c++11
 }

Reply via email to