about summary refs log tree commit diff
path: root/pkgs/applications/graphics/meshlab
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2014-04-20 11:30:06 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2014-04-21 11:24:26 +0200
commitb12b180fc28ae8de527dc1831f27607d1b255269 (patch)
tree94626afdd1ba55fcb9010e08d05169af1f9520a7 /pkgs/applications/graphics/meshlab
parent625d7b9043be673a8df33cc842ec5032d7705c06 (diff)
meshlab: fix build
Patches are from the Arch Linux package.
Diffstat (limited to 'pkgs/applications/graphics/meshlab')
-rw-r--r--pkgs/applications/graphics/meshlab/default.nix6
-rw-r--r--pkgs/applications/graphics/meshlab/gcc-4.7.patch38
-rw-r--r--pkgs/applications/graphics/meshlab/qt-4.8.patch54
3 files changed, 98 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/meshlab/default.nix b/pkgs/applications/graphics/meshlab/default.nix
index 7151fc7af5c4b..4e2075ff47148 100644
--- a/pkgs/applications/graphics/meshlab/default.nix
+++ b/pkgs/applications/graphics/meshlab/default.nix
@@ -12,6 +12,12 @@ stdenv.mkDerivation rec {
   # buildPhase gets removed from the 'meshlab' binary
   dontPatchELF = true;
 
+  # Patches are from the Arch Linux package
+  patchPhase = ''
+    patch -Np0 -i "${./qt-4.8.patch}"
+    patch -Np1 -i "${./gcc-4.7.patch}"
+  '';
+
   buildPhase = ''
     mkdir -p "$out/include"
     cp -r vcglib "$out/include"
diff --git a/pkgs/applications/graphics/meshlab/gcc-4.7.patch b/pkgs/applications/graphics/meshlab/gcc-4.7.patch
new file mode 100644
index 0000000000000..07dc1a08aff52
--- /dev/null
+++ b/pkgs/applications/graphics/meshlab/gcc-4.7.patch
@@ -0,0 +1,38 @@
+diff --git a/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h b/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
+index 2351b2a..90c6d76 100644
+--- a/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
++++ b/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
+@@ -40,7 +40,7 @@ public:
+ 
+   //! Reset histogram data.
+   void Clear() {
+-    this->::Clear();
++    Histogram<ScalarType>::Clear();
+     CV.clear();
+   }
+   /*
+diff --git a/vcglib/wrap/gl/trimesh.h b/vcglib/wrap/gl/trimesh.h
+index 5d40404..ab9d0aa 100644
+--- a/vcglib/wrap/gl/trimesh.h
++++ b/vcglib/wrap/gl/trimesh.h
+@@ -1003,7 +1003,7 @@ void Crease(MESH_TYPE &m, typename MESH_TYPE::scalar_type angleRad)
+ 			}
+ 		}
+ 
+-	m.vert.math::Swap(newvert);
++	m.vert.math.Swap(newvert);
+ 	m.vn=m.vert.size();
+ }
+ 
+diff --git a/vcglib/wrap/ply/plystuff.h b/vcglib/wrap/ply/plystuff.h
+index 3e41e63..4af9508 100644
+--- a/vcglib/wrap/ply/plystuff.h
++++ b/vcglib/wrap/ply/plystuff.h
+@@ -75,6 +75,7 @@ using namespace vcg;
+ #define pb_close  _close
+ #define DIR_SEP "\\"
+ #else
++#include <unistd.h>
+ #define pb_mkdir(n)  mkdir(n,0755)
+ #define pb_access access
+ #define pb_stat   stat
diff --git a/pkgs/applications/graphics/meshlab/qt-4.8.patch b/pkgs/applications/graphics/meshlab/qt-4.8.patch
new file mode 100644
index 0000000000000..abfd77d6f25d9
--- /dev/null
+++ b/pkgs/applications/graphics/meshlab/qt-4.8.patch
@@ -0,0 +1,54 @@
+diff -Nur meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp
+--- meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp	2011-01-25 18:51:28.000000000 +1100
++++ meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp	2012-01-07 11:47:12.836800072 +1100
+@@ -7,6 +7,12 @@
+ #include "SyntopiaCore/Logging/Logging.h"

+ #include "SyntopiaCore/Misc/MiniParser.h"

+ 

++#ifdef Q_WS_MAC

++#include <OpenGL/glu.h>

++#else

++#include <GL/glu.h>

++#endif

++

+ using namespace SyntopiaCore::Math;

+ using namespace SyntopiaCore::Misc;

+ 

+diff -Nur meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h
+--- meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h	2011-01-25 18:51:28.000000000 +1100
++++ meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h	2012-01-07 11:45:26.795586149 +1100
+@@ -3,6 +3,12 @@
+ #include "SyntopiaCore/Math/Vector3.h"

+ #include "Object3D.h"

+ 

++#ifdef Q_WS_MAC

++#include <OpenGL/glu.h>

++#else

++#include <GL/glu.h>

++#endif

++

+ namespace SyntopiaCore {

+ 	namespace GLEngine {	

+ 

+diff -Nur meshlab.orig/src/external/structuresynth/structuresynth.pro meshlab/src/external/structuresynth/structuresynth.pro
+--- meshlab.orig/src/external/structuresynth/structuresynth.pro	2011-01-25 18:49:34.000000000 +1100
++++ meshlab/src/external/structuresynth/structuresynth.pro	2012-01-07 11:51:46.695981995 +1100
+@@ -113,6 +113,7 @@
+            ssynth/StructureSynth/Model/Rendering/TemplateRenderer.cpp

+ CONFIG+=opengl

+ QT+=xml opengl script

++unix:LIBS += -lGLU

+ macx:DESTDIR       = ../lib/macx

+ win32-g++:DESTDIR       = ../lib/win32-gcc

+ win32-msvc2005:DESTDIR       = ../lib/win32-msvc2005

+diff -Nur meshlab.orig/src/meshlab/meshlab.pro meshlab/src/meshlab/meshlab.pro
+--- meshlab.orig/src/meshlab/meshlab.pro	2011-02-15 20:39:47.000000000 +1100
++++ meshlab/src/meshlab/meshlab.pro	2012-01-07 11:57:18.055586086 +1100
+@@ -85,6 +85,7 @@
+ QT += xmlpatterns
+ QT += network
+ QT += script
++unix:LIBS += -lGLU
+ 
+ 
+ # the following line is needed to avoid mismatch between