[tetgen] 01/01: Really create a tetgen main using libtet Add a test in debian/rules

Christophe Trophime trophime-guest at moszumanska.debian.org
Mon Feb 10 16:24:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

trophime-guest pushed a commit to branch master
in repository tetgen.

commit c363f8b1c15eac025b0d526dd539d7db47ef7ad1
Author: Christophe Trophime <christrophime at googlemail.com>
Date:   Mon Feb 10 17:23:51 2014 +0100

    Really create a tetgen main using libtet
    Add a test in debian/rules
---
 debian/patches/01_cmake.patch | 14 +++++----
 debian/patches/main.patch     | 67 +++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series         |  1 +
 debian/rules                  |  6 +++-
 4 files changed, 81 insertions(+), 7 deletions(-)

diff --git a/debian/patches/01_cmake.patch b/debian/patches/01_cmake.patch
index 1f4d33a..eb004de 100644
--- a/debian/patches/01_cmake.patch
+++ b/debian/patches/01_cmake.patch
@@ -4,9 +4,9 @@ Last-Update: 2014-01-28
 
 Index: tetgen-1.5.0/CMakeLists.txt
 ===================================================================
---- tetgen-1.5.0.orig/CMakeLists.txt	2013-11-06 21:26:21.000000000 +0100
-+++ tetgen-1.5.0/CMakeLists.txt	2014-02-10 13:04:27.951842671 +0100
-@@ -1,14 +1,28 @@
+--- tetgen-1.5.0.orig/CMakeLists.txt	2014-02-10 16:56:35.040954429 +0100
++++ tetgen-1.5.0/CMakeLists.txt	2014-02-10 17:14:11.745790846 +0100
+@@ -1,14 +1,30 @@
  # Set  the minimum  required version  of cmake  for a  project.
  cmake_minimum_required(VERSION 2.6)
  
@@ -15,13 +15,13 @@ Index: tetgen-1.5.0/CMakeLists.txt
 +set(TET_MAJOR_VERSION 1)
 +set(TET_MINOR_VERSION 5)
 +set(TET_PATCH_VERSION 0)
++
++INCLUDE(GNUInstallDirs)
  
 -#Add a library to the project using the specified source files. 
 -# In Linux/Unix, it will creates the libtet.a
 -add_library(tet STATIC tetgen.cxx predicates.cxx)
-+INCLUDE(GNUInstallDirs)
  
-+
 +#Add a shared library to the project using the specified source files.
 +add_library(tetlib SHARED tetgen.cxx predicates.cxx)
  #Set properties on a target. 
@@ -36,7 +36,9 @@ Index: tetgen-1.5.0/CMakeLists.txt
 +    SOVERSION ${TET_MAJOR_VERSION}.${TET_MINOR_VERSION})
 +
 +# Add an executable to the project using the specified source files.
-+add_executable(tetgen tetgen.cxx predicates.cxx)
++add_definitions(-DTETLIBRARY)
++add_executable(tetgen tetgen_main.cxx)
++target_link_libraries(tetgen tetlib)
 +
 +# Install
 +install(TARGETS tetgen DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/debian/patches/main.patch b/debian/patches/main.patch
new file mode 100644
index 0000000..76c7a11
--- /dev/null
+++ b/debian/patches/main.patch
@@ -0,0 +1,67 @@
+Index: tetgen-1.5.0/tetgen_main.cxx
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ tetgen-1.5.0/tetgen_main.cxx	2014-02-10 17:21:13.125273985 +0100
+@@ -0,0 +1,62 @@
++///////////////////////////////////////////////////////////////////////////////
++//                                                                           //
++// TetGen                                                                    //
++//                                                                           //
++// A Quality Tetrahedral Mesh Generator and A 3D Delaunay Triangulator       //
++//                                                                           //
++// Version 1.5                                                               //
++// November 4, 2013                                                          //
++//                                                                           //
++// TetGen is freely available through the website: http://www.tetgen.org.    //
++//   It may be copied, modified, and redistributed for non-commercial use.   //
++//   Please consult the file LICENSE for the detailed copyright notices.     //
++//                                                                           //
++///////////////////////////////////////////////////////////////////////////////
++
++#include "tetgen.h"
++
++
++///////////////////////////////////////////////////////////////////////////////
++//                                                                           //
++// main()    The command line interface of TetGen.                           //
++//                                                                           //
++///////////////////////////////////////////////////////////////////////////////
++
++int main(int argc, char *argv[])
++{
++  tetgenbehavior b;
++
++  tetgenio in, addin, bgmin;
++
++  if (!b.parse_commandline(argc, argv)) {
++    terminatetetgen(NULL, 10);
++  }
++
++  // Read input files.
++  if (b.refine) { // -r
++    if (!in.load_tetmesh(b.infilename, (int) b.object)) {
++      terminatetetgen(NULL, 10);
++    }
++  } else { // -p
++    if (!in.load_plc(b.infilename, (int) b.object)) {
++      terminatetetgen(NULL, 10);
++    }
++  }
++  if (b.insertaddpoints) { // -i
++    // Try to read a .a.node file.
++    addin.load_node(b.addinfilename);
++  }
++  if (b.metric) { // -m
++    // Try to read a background mesh in files .b.node, .b.ele.
++    bgmin.load_tetmesh(b.bgmeshfilename, (int) b.object);
++  }
++
++  tetrahedralize(&b, &in, NULL, &addin, &bgmin);
++
++  return 0;
++}
++
++////                                                                       ////
++////                                                                       ////
++//// main_cxx /////////////////////////////////////////////////////////////////
++
diff --git a/debian/patches/series b/debian/patches/series
index 86dd546..9014ced 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 01_cmake.patch
+main.patch
diff --git a/debian/rules b/debian/rules
index 675f3b6..f3b2497 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,5 @@
 #!/usr/bin/make -f
+BUILDDIR=debian/build
 
 TETGEN_VERSION = 1.5.0
 TETGEN_LIBVERSION = 1.5
@@ -8,12 +9,15 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 export DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 %:
-	dh $@ --buildsystem=cmake --parallel
+	dh $@ --buildsystem=cmake --builddirectory=$(BUILDDIR) --parallel
 
 override_dh_auto_build:
 	dh_auto_build
 	docbook-to-man debian/tetgen.sgml > tetgen.1
 
+override_dh_auto_test:
+	$(BUILDDIR)/tetgen -p example.poly
+
 get-orig-source:
 	uscan --force-download --rename --verbose --upstream-version $(TETGEN_VERSION)
 	tar xzf ../tetgen_$(TETGEN_VERSION).orig.tar.gz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/tetgen.git



More information about the debian-science-commits mailing list