Author: Laszlo Kajan <lkajan@rostlab.org>
Description: do not require linking with opengl
 None of the affected methods are used by the application.
Forwarded: http://lists.alioth.debian.org/pipermail/debian-med-packaging/2012-September/017323.html
Forwarded-Comment: Upstream was bcc'd on forwarded email.
--- a/scripts/Makefile.apps
+++ b/scripts/Makefile.apps
@@ -58,7 +58,7 @@
 OPENGL_LIBS=-lglut32 -lglu32 -lopengl32
 endif
 
-LIBS=$(USER_LIBS) $(PKG_LIBS) $(OPENGL_LIBS)
+LIBS=$(USER_LIBS) $(PKG_LIBS)
 
 
 
--- a/pkgs/Makefile
+++ b/pkgs/Makefile
@@ -31,7 +31,7 @@
 	cd RNBasics && $(MAKE) $(TARGET)
 	cd R2Shapes && $(MAKE) $(TARGET)
 	cd R3Shapes && $(MAKE) $(TARGET)
-	cd R3Graphics && $(MAKE) $(TARGET)
+	#cd R3Graphics && $(MAKE) $(TARGET)
 	cd PDB && $(MAKE) $(TARGET)
 	#cd freeglut && $(MAKE) $(TARGET)
 endif
--- a/pkgs/RNBasics/RNCompat.h
+++ b/pkgs/RNBasics/RNCompat.h
@@ -57,9 +57,6 @@
 #   ifdef RN_USE_OPENGL
 #       define RN_2D_GRFX RN_OPENGL
 #       define RN_3D_GRFX RN_OPENGL
-#   else
-#       define RN_2D_GRFX RN_OPENGL
-#       define RN_3D_GRFX RN_OPENGL
 #   endif
 #endif
 
--- a/pkgs/R3Shapes/R3Mesh.C
+++ b/pkgs/R3Shapes/R3Mesh.C
@@ -1561,6 +1561,7 @@
 ////////////////////////////////////////////////////////////////////////
 // DRAW FUNCTIONS
 ////////////////////////////////////////////////////////////////////////
+#ifdef RN_3D_GRFX
 
 void R3Mesh::
 DrawVertices(void) const
@@ -1681,7 +1682,7 @@
 }
 
 
-
+#endif
 ////////////////////////////////////////////////////////////////////////
 // INTERSECTION FUNCTIONS
 ////////////////////////////////////////////////////////////////////////
--- a/pkgs/R3Shapes/R3Mesh.h
+++ b/pkgs/R3Shapes/R3Mesh.h
@@ -403,6 +403,7 @@
     virtual R3MeshFace *SubdivideFace(R3MeshFace *face);
       // Splits face into four by subdividing each edge at midpoint (returns middle face)
 
+#ifdef RN_3D_GRFX
     // DRAW FUNCTIONS
     virtual void Draw(void) const;
       // Draws the faces
@@ -424,6 +425,7 @@
       // Draws one edge
     virtual void DrawFace(R3MeshFace *face) const;
       // Draws one face
+#endif
 
     // INTERSECT FUNCTIONS
     R3MeshType Intersection(const R3Ray& ray, R3MeshIntersection *intersection = NULL) const;
@@ -1426,6 +1428,7 @@
 ////////////////////////////////////////////////////////////////////////
 // DRAW FUNCTIONS
 ////////////////////////////////////////////////////////////////////////
+#ifdef RN_3D_GRFX
 
 inline void R3Mesh:: 
 Draw(void) const
@@ -1433,6 +1436,7 @@
   // Draw the mesh
   DrawFaces();
 } 
+#endif
 
 
 
--- a/pkgs/R3Shapes/R3Grid.C
+++ b/pkgs/R3Shapes/R3Grid.C
@@ -3414,6 +3414,7 @@
 
 
 
+#ifdef RN_3D_GRFX
 void R3Grid::
 DrawIsoSurface(RNScalar isolevel) const
 {
@@ -3526,3 +3527,4 @@
   // Reset OpenGL modes
   glDisable(GL_TEXTURE_2D);
 }
+#endif
--- a/pkgs/R3Shapes/R3Grid.h
+++ b/pkgs/R3Shapes/R3Grid.h
@@ -146,8 +146,10 @@
   int WriteDX(FILE *fp = NULL) const;
 
   // Visualization functions
+#ifdef RN_3D_GRFX
   void DrawIsoSurface(RNScalar isolevel) const;
   void DrawSlice(int dim, int coord) const;
+#endif
 
   // Utility functions
   int ConnectedComponents(RNScalar isolevel = 0, int max_components = 0, int *seeds = NULL, int *sizes = NULL, int *grid_components = NULL);
--- a/pkgs/R2Shapes/R2Grid.C
+++ b/pkgs/R2Shapes/R2Grid.C
@@ -1643,6 +1643,7 @@
 
 
 
+#ifdef RN_2D_GRFX
 void R2Grid::
 Capture(void)
 {
@@ -1727,6 +1728,7 @@
   glMatrixMode(GL_MODELVIEW);
   glPopMatrix();
 }
+#endif
 
 
 
--- a/pkgs/R2Shapes/R2Grid.h
+++ b/pkgs/R2Shapes/R2Grid.h
@@ -149,12 +149,16 @@
   int WriteGRD(const char *filename) const;
   int WriteImage(const char *filename) const;
   int Print(FILE *fp = NULL) const;
+#ifdef RN_2D_GRFX
   void Capture(void);
+#endif
 
+#ifdef RN_2D_GRFX
   // Draw functions
   void Draw(void) const;
   void DrawMesh(void) const;
   void DrawImage(int x = 0, int y = 0) const;
+#endif
 
   // Utility functions
   RNScalar GridValue(RNCoord x, RNCoord y, RNLength sigma) const;
@@ -681,12 +685,14 @@
 
 
 
+#ifdef RN_2D_GRFX
 inline void R2Grid::
 Draw(void) const
 {
   // Draw image
   DrawImage();
 }
+#endif
 
 
 
--- a/pkgs/R2Shapes/R2Image.C
+++ b/pkgs/R2Shapes/R2Image.C
@@ -215,6 +215,7 @@
 
 
 
+#ifdef RN_2D_GRFX
 void R2Image::
 Capture(void)
 {
@@ -270,6 +271,7 @@
   glMatrixMode(GL_MODELVIEW);
   glPopMatrix();
 }
+#endif
 
 
 int R2Image::
--- a/pkgs/R2Shapes/R2Image.h
+++ b/pkgs/R2Shapes/R2Image.h
@@ -46,10 +46,14 @@
   int WriteRAW(const char *filename) const;
   int WriteJPEG(const char *filename) const;
   int WriteTIFF(const char *filename) const;
+#ifdef RN_2D_GRFX
   void Capture(void);
+#endif
 
+#ifdef RN_2D_GRFX
   // Draw functions
   void Draw(int x = 0, int y = 0) const;
+#endif
 
  private:
   int width;
