This patch contains all the Debian-specific
changes mixed together. To review them
separately, please inspect the git history
at http://gitorious.org/openscad/
--- openscad-2011.12.orig/eigen2.pri
+++ openscad-2011.12/eigen2.pri
@@ -31,6 +31,11 @@ eigen2 {
     linux*: EIGEN2_INCLUDEPATH = /usr/include/eigen2
   }
 
+  isEmpty(EIGEN2_INCLUDEPATH) {
+    CONFIG += link_pkgconfig
+    PKGCONFIG += eigen2
+  }
+
   # eigen2 being under 'include/eigen2' needs special prepending
   QMAKE_INCDIR_QT = $$EIGEN2_INCLUDEPATH $$QMAKE_INCDIR_QT
 
--- openscad-2011.12.orig/src/glview.cc
+++ openscad-2011.12/src/glview.cc
@@ -56,6 +56,7 @@
 #elif !defined(__APPLE__)
 #include <GL/glxew.h>
 #endif
+#include <GL/glu.h>
 
 #define FAR_FAR_AWAY 100000.0
 
--- openscad-2011.12.orig/src/OGL_helper.h
+++ openscad-2011.12/src/OGL_helper.h
@@ -24,6 +24,7 @@
 #include <CGAL/Simple_cartesian.h>
 #include <CGAL/Nef_3/SNC_decorator.h>
 #include <qgl.h>
+#include <GL/glu.h>
 #include <cstdlib>
 
 #define CGAL_NEF3_MARKED_VERTEX_COLOR 183,232,92
--- openscad-2011.12.orig/src/dxftess-glu.cc
+++ openscad-2011.12/src/dxftess-glu.cc
@@ -5,6 +5,7 @@
 #include <stdio.h>
 
 #include "system-gl.h"
+#include <GL/glu.h>
 #include "mathc99.h"
 
 #include <QVector>
--- openscad-2011.12.orig/tests/system-gl.cc
+++ openscad-2011.12/tests/system-gl.cc
@@ -5,6 +5,7 @@
 #include <sstream>
 #include <string>
 #include "system-gl.h"
+#include <GL/glu.h>
 #include <boost/algorithm/string.hpp>
 
 using namespace std;
--- openscad-2011.12.orig/tests/csgtestcore.cc
+++ openscad-2011.12/tests/csgtestcore.cc
@@ -22,6 +22,8 @@
 #include "csgtermnormalizer.h"
 #include "OffscreenView.h"
 
+#include <GL/glu.h>
+
 #include <QApplication>
 #include <QFile>
 #include <QDir>
--- openscad-2011.12.orig/tests/CMakeLists.txt
+++ openscad-2011.12/tests/CMakeLists.txt
@@ -214,7 +214,7 @@ inclusion( GLEW_DIR GLEW_INCLUDE_PATH )
 # Flex/Bison
 find_package(BISON REQUIRED)
 
-if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+if(${CMAKE_SYSTEM_NAME} MATCHES "^FreeBSD")
   # FreeBSD has an old flex in /usr/bin and a new flex in /usr/local/bin
   set(FLEX_EXECUTABLE /usr/local/bin/flex)
 endif()
@@ -349,6 +349,7 @@ set(OFFSCREEN_SOURCES
 
 add_library(tests-core STATIC ${CORE_SOURCES})
 add_library(tests-common STATIC ${COMMON_SOURCES})
+target_link_libraries(tests-core ${OPENGL_LIBRARY})
 target_link_libraries(tests-common tests-core)
 add_library(tests-cgal STATIC ${CGAL_SOURCES})
 set_target_properties(tests-cgal PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
--- openscad-2011.12.orig/tests/OffscreenView.cc
+++ openscad-2011.12/tests/OffscreenView.cc
@@ -1,4 +1,5 @@
 #include <GL/glew.h>
+#include <GL/glu.h>
 #include "OffscreenView.h"
 #include "system-gl.h"
 #include "renderer.h"
