[Debian-med-packaging] patches for concavity

Laszlo Kajan lkajan at rostlab.org
Fri Sep 28 20:10:19 UTC 2012


Dear Tom!

Please find attached the (quilt) patches I created during packaging.

Please let me know if you use some to create a new upstream, so that I can update the packaged version.

Best regards,

Laszlo
-------------- next part --------------
default_target_all
safe_recursive_make
freeglut
CFLAGSasf
compiler_errors
noopengllink
spelling
-------------- next part --------------
Author: Laszlo Kajan <lkajan at rostlab.org>
Description: respect CFLAGS and alike from environment
 CFLAGS CPPFLAGS LDFLAGS, to allow hardening flags to be passed
--- a/scripts/Makefile.apps
+++ b/scripts/Makefile.apps
@@ -42,7 +42,7 @@
 BASE_LDFLAGS=$(USER_LDFLAGS) -L$(LIB_DIR)
 DEBUG_LDFLAGS=$(BASE_LDFLAGS) -g
 OPT_LDFLAGS=$(BASE_LDFLAGS) -O 
-LDFLAGS=$(DEBUG_LDFLAGS)
+LDFLAGS:=$(DEBUG_LDFLAGS) $(LDFLAGS)
 
 
 #
@@ -67,10 +67,10 @@
 #
 
 opt:
-	    $(MAKE) $(EXE) "CFLAGS=$(OPT_CFLAGS)" "LDFLAGS=$(OPT_LDFLAGS)"
+	    $(MAKE) $(EXE) "CFLAGS=$(OPT_CFLAGS) $(CFLAGS)" "LDFLAGS=$(OPT_LDFLAGS) $(LDFLAGS)"
 
 debug:
-	    $(MAKE) $(EXE) "CFLAGS=$(DEBUG_CFLAGS)" "LDFLAGS=$(DEBUG_LDFLAGS)"
+	    $(MAKE) $(EXE) "CFLAGS=$(DEBUG_CFLAGS) $(CFLAGS)" "LDFLAGS=$(DEBUG_LDFLAGS) $(LDFLAGS)"
 
 $(EXE):	    $(OBJS) $(LIBDIR)
 	    mkdir -p $(EXE_DIR)
--- a/scripts/Makefile.pkgs
+++ b/scripts/Makefile.pkgs
@@ -39,10 +39,10 @@
 #
 
 opt:
-	    $(MAKE) $(LIB) "CFLAGS=$(OPT_CFLAGS)" 
+	    $(MAKE) $(LIB) "CFLAGS=$(OPT_CFLAGS) $(CFLAGS)"
 
 debug:
-	    $(MAKE) $(LIB) "CFLAGS=$(DEBUG_CFLAGS)" 
+	    $(MAKE) $(LIB) "CFLAGS=$(DEBUG_CFLAGS) $(CFLAGS)"
 
 $(LIB):     $(CCSRCS) $(CSRCS) $(OSRCS) $(OBJS) 
 	    mkdir -p $(LIB_DIR)
--- a/scripts/Makefile.std
+++ b/scripts/Makefile.std
@@ -21,7 +21,7 @@
 BASE_CFLAGS=$(USER_CFLAGS) -Wall -I. -I../../pkgs 
 DEBUG_CFLAGS=$(BASE_CFLAGS) -g
 OPT_CFLAGS=$(BASE_CFLAGS) -O3 -DNDEBUG
-CFLAGS=$(DEBUG_CFLAGS)
+CFLAGS:=$(DEBUG_CFLAGS) $(CFLAGS)
 
 
 
@@ -52,8 +52,8 @@
 .SUFFIXES: .c .C .o
 
 .C.o:
-	$(CC) $(CFLAGS) -c $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
 
 .c.o:
-	gcc $(CFLAGS) -c $<
+	gcc $(CPPFLAGS) $(CFLAGS) -c $<
 
--- a/scripts/MSVC/Makefile.apps
+++ b/scripts/MSVC/Makefile.apps
@@ -39,7 +39,7 @@
 BASE_LDFLAGS=$(USER_LDFLAGS) /link /libpath:$(LIB_DIR)
 DEBUG_LDFLAGS=$(BASE_LDFLAGS) -Zi
 OPT_LDFLAGS=$(BASE_LDFLAGS) -Ox 
-LDFLAGS=$(DEBUG_LDFLAGS)
+LDFLAGS:=$(DEBUG_LDFLAGS) $(LDFLAGS)
 
 
 
@@ -58,10 +58,10 @@
 #
 
 opt:
-	    $(MAKE) $(EXE) "CFLAGS=$(OPT_CFLAGS)" "LDFLAGS=$(OPT_LDFLAGS)"
+	    $(MAKE) $(EXE) "CFLAGS=$(OPT_CFLAGS) $(CFLAGS)" "LDFLAGS=$(OPT_LDFLAGS) $(LDFLAGS)"
 
 debug:
-	    $(MAKE) $(EXE) "CFLAGS=$(DEBUG_CFLAGS)" "LDFLAGS=$(DEBUG_LDFLAGS)"
+	    $(MAKE) $(EXE) "CFLAGS=$(DEBUG_CFLAGS) $(CFLAGS)" "LDFLAGS=$(DEBUG_LDFLAGS) $(LDFLAGS)"
 
 $(EXE):	    $(OBJS) $(LIBDIR)
 	    mkdir -p $(EXE_DIR)
--- a/scripts/MSVC/Makefile.pkgs
+++ b/scripts/MSVC/Makefile.pkgs
@@ -39,10 +39,10 @@
 #
 
 opt:
-	    $(MAKE) $(LIB) "CFLAGS=$(OPT_CFLAGS)"
+	    $(MAKE) $(LIB) "CFLAGS=$(OPT_CFLAGS) $(CFLAGS)"
 
 debug:
-	    $(MAKE) $(LIB) "CFLAGS=$(DEBUG_CFLAGS)" 
+	    $(MAKE) $(LIB) "CFLAGS=$(DEBUG_CFLAGS) $(CFLAGS)"
 
 $(LIB):     $(CCSRCS) $(CSRCS) $(OSRCS) $(OBJS) 
 	    mkdir -p $(LIB_DIR)
--- a/scripts/MSVC/Makefile.std
+++ b/scripts/MSVC/Makefile.std
@@ -21,7 +21,7 @@
 BASE_CFLAGS=$(USER_CFLAGS) /TP /W3 -I. -I../../pkgs 
 DEBUG_CFLAGS=-Zi $(BASE_CFLAGS)
 OPT_CFLAGS=-Ox -DNDEBUG $(BASE_CFLAGS)
-CFLAGS=$(DEBUG_CFLAGS)
+CFLAGS:=$(DEBUG_CFLAGS) $(CFLAGS)
 
 
 
@@ -42,9 +42,9 @@
 .SUFFIXES: .c .C .obj
 
 .C.obj:
-	$(CC) $(CFLAGS) -c $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
 
 .c.obj:
-	$(CC) $(CFLAGS) -c $<
+	$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
 
 
-------------- next part --------------
Author: Laszlo Kajan <lkajan at rostlab.org>
Description: fix compiler errors and warnings
--- a/pkgs/PDB/PDBFile.C
+++ b/pkgs/PDB/PDBFile.C
@@ -396,7 +396,7 @@
 {
   // Write all header lines
   for (int i = 0; i < headers.NEntries(); i++) {
-    fprintf(fp, headers.Kth(i));
+    fprintf(fp, "%s", headers.Kth(i));
   }
 
   // Write all models
@@ -444,7 +444,7 @@
     
   // Write all trailing lines
   for (int i = 0; i < trailers.NEntries(); i++) {
-    fprintf(fp, trailers.Kth(i));
+    fprintf(fp, "%s", trailers.Kth(i));
   }
 
   // Return number of models written
@@ -1355,7 +1355,7 @@
     }
 
     // Check jsd files for chain A if chain name is "-" or " " ???
-    if (translate_unnamed_chains && !strcmp(chain_name, "-") || !strcmp(chain_name, " ")) {
+    if (translate_unnamed_chains && ( !strcmp(chain_name, "-") || !strcmp(chain_name, " ") ) ) {
       // Get chain jsd filename
       strcpy(chain_filename, jsd_basename);
       strcat(chain_filename, "_");
-------------- next part --------------
Author: Laszlo Kajan <lkajan at rostlab.org>
Description: make default target 'all'
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,9 @@
 # Makefile for GAPS
 #
 
+.PHONY: all opt
+all: opt
+
 opt:
 	$(MAKE) target "TARGET=$@"
 
-------------- next part --------------
Author: Laszlo Kajan <lkajan at rostlab.org>
Description: do not make freeglut, this is packaged separately
--- a/pkgs/Makefile
+++ b/pkgs/Makefile
@@ -33,7 +33,7 @@
 	cd R3Shapes && $(MAKE) $(TARGET)
 	cd R3Graphics && $(MAKE) $(TARGET)
 	cd PDB && $(MAKE) $(TARGET)
-	cd freeglut && $(MAKE) $(TARGET)
+	#cd freeglut && $(MAKE) $(TARGET)
 endif
 
 
-------------- next part --------------
Author: Laszlo Kajan <lkajan at rostlab.org>
Description: do not require linking with opengl
 None of the affected methods are used by the application.
--- 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;
-------------- next part --------------
Author: Laszlo Kajan <lkajan at rostlab.org>
Description: safer recursive make calls
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -17,7 +17,7 @@
 	$(MAKE) target "TARGET=$@"
 
 target: 
-	cd concavity; $(MAKE) $(TARGET)
+	cd concavity && $(MAKE) $(TARGET)
 
 
 
--- a/Makefile
+++ b/Makefile
@@ -20,8 +20,8 @@
 	$(MAKE) target "TARGET=$@"
 
 target: 
-	cd pkgs; $(MAKE) $(TARGET)
-	cd apps; $(MAKE) $(TARGET)
+	cd pkgs && $(MAKE) $(TARGET)
+	cd apps && $(MAKE) $(TARGET)
 
 
 
--- a/pkgs/Makefile
+++ b/pkgs/Makefile
@@ -21,19 +21,19 @@
 
 ifeq ("$(KERN)","Darwin")
 target: 
-	cd RNBasics; $(MAKE) $(TARGET)
-	cd R2Shapes; $(MAKE) $(TARGET)
-	cd R3Shapes; $(MAKE) $(TARGET)
-	cd R3Graphics; $(MAKE) $(TARGET)
-	cd PDB; $(MAKE) $(TARGET)
+	cd RNBasics && $(MAKE) $(TARGET)
+	cd R2Shapes && $(MAKE) $(TARGET)
+	cd R3Shapes && $(MAKE) $(TARGET)
+	cd R3Graphics && $(MAKE) $(TARGET)
+	cd PDB && $(MAKE) $(TARGET)
 else
 target: 
-	cd RNBasics; $(MAKE) $(TARGET)
-	cd R2Shapes; $(MAKE) $(TARGET)
-	cd R3Shapes; $(MAKE) $(TARGET)
-	cd R3Graphics; $(MAKE) $(TARGET)
-	cd PDB; $(MAKE) $(TARGET)
-	cd freeglut; $(MAKE) $(TARGET)
+	cd RNBasics && $(MAKE) $(TARGET)
+	cd R2Shapes && $(MAKE) $(TARGET)
+	cd R3Shapes && $(MAKE) $(TARGET)
+	cd R3Graphics && $(MAKE) $(TARGET)
+	cd PDB && $(MAKE) $(TARGET)
+	cd freeglut && $(MAKE) $(TARGET)
 endif
 
 
-------------- next part --------------
Author: Laszlo Kajan <lkajan at rostlab.org>
Description: fix spelling error
--- a/apps/concavity/pocket_extraction.C
+++ b/apps/concavity/pocket_extraction.C
@@ -1028,7 +1028,7 @@
     printf("  Minimum cavity radius = %g\n", min_cavity_radius);
     printf("  Minimum cavity volume = %g\n", min_cavity_volume);
     printf("  Max cavities = %d\n", max_cavities);
-    printf("  Grid treshold = %g\n", threshold_range.Mid());
+    printf("  Grid threshold = %g\n", threshold_range.Mid());
     printf("  Cardinality = %d\n", mask->Cardinality());
     printf("  Volume = %g\n", mask->Volume());
     RNInterval grid_range = mask->Range();


More information about the Debian-med-packaging mailing list