[bug#75286,v3] gnu: Add tetgen.

Message ID Z6Nw36Hwgn3RuSQK@jurong
State New
Headers
Series [bug#75286,v3] gnu: Add tetgen. |

Commit Message

Andreas Enge Feb. 5, 2025, 2:08 p.m. UTC
  Hello Lars,

when looking at the tetgen homepage, I see that they do not have a
version 1.5.1, but that there is a version 1.6.0. They hide the source
behind a form that asks for a name and an email address, but the real
place of the source code is easily reverse engineered.

I am attaching a corresponding patch; unfortunately there is no install
target, so I copy the binary "by hand" to bin/. And there is an
installed file etc/ld.so.cache, of which I do not know where it comes
from and which phase puts it into the output; it is surely superfluous?

What do you think? I see that your email address is @ufz.de and that the
github origin you provide belongs to ufz, so maybe you maintain a fork?
But if you need one, maybe this should be mentioned somewhere and/or
reflected in the package name?

Andreas
From 1c926212be095477afe06e4ff664060dacfd723f Mon Sep 17 00:00:00 2001
Message-ID: <1c926212be095477afe06e4ff664060dacfd723f.1738764179.git.andreas@enge.fr>
From: Lars Bilke <lars.bilke@ufz.de>
Date: Tue, 28 Jan 2025 10:20:04 +0100
Subject: [PATCH] gnu: Add tetgen.

* gnu/packages/geo.scm (tetgen): New variable.

Change-Id: Iba2de71cf0a10ca5c7b65f9851d05fe63c944b30
Co-authored-by: Andreas Enge <andreas@enge.fr>
Signed-off-by: Andreas Enge <andreas@enge.fr>
---
 gnu/packages/geo.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)


base-commit: a53bd6f27b0a49491dc87c2476555682fef6c47e
  

Comments

Lars Bilke Feb. 6, 2025, 2:11 p.m. UTC | #1
Hi Andreas,

thanks for your patch!

On 5 Feb 2025, at 15:08, Andreas Enge wrote:

> I am attaching a corresponding patch; unfortunately, there is no install
> target, so I copy the binary "by hand" to bin/. And there is an
> installed file etc/ld.so.cache, of which I do not know where it comes
> from and which phase puts it into the output; it is surely superfluous?

Yes, the ld cache is not required for the binary.

> What do you think? I see that your email address is @ufz.de and that the
> github origin you provide belongs to ufz, so maybe you maintain a fork?
> But if you need one, maybe this should be mentioned somewhere and/or
> reflected in the package name?

I am perfectly fine to merge this patch v3.

We relied on tetgen (the library) in the past and made some fixes in the build system on that fork. But this is not required for us anymore and our fork is not maintained anymore.

So building this with the original source as you did is better.

Thanks a lot!
Lars
  
Andreas Enge Feb. 6, 2025, 3:29 p.m. UTC | #2
Hello!

Am Thu, Feb 06, 2025 at 03:11:41PM +0100 schrieb Lars Bilke:
> I am perfectly fine to merge this patch v3.
> So building this with the original source as you did is better.

thanks for your quick reply! I have just pushed the patch.
The etc/ld.so.cache comes from the phase make-dynamic-linker-cache,
of which I do not know why it appears; I have not seen it in other
packages using the cmake build system. So I have just removed the phase
by hand.

Andreas
  

Patch

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 3317271802f..9acb9c4cb80 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -24,6 +24,7 @@ 
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2024 Wilko Meyer <w@wmeyer.eu>
 ;;; Copyright © 2024 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2025 Andreas Enge <andreas@enge.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3684,3 +3685,35 @@  (define-public laszip
 @code{LAZ} files.  The @code{LAS} format is a file format designed for the
 interchange and archiving of lidar point cloud data.")
     (license license:asl2.0)))
+
+(define-public tetgen
+  (package
+    (name "tetgen")
+    (version "1.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+         "https://wias-berlin.de/software/tetgen/1.5/src/tetgen1.6.0.tar.gz")
+       (sha256
+        (base32 "0fff0l6i3xfjlm0zkcgyyhwndp8i5d615mydyb21yirsplgfddc7"))))
+    (build-system cmake-build-system)
+    (arguments
+      (list
+        #:tests? #f ;; No test suite.
+        #:configure-flags #~(list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
+        #:phases
+        #~(modify-phases %standard-phases
+         (replace 'install ;; no install target
+           (lambda _
+             (install-file "tetgen"
+                           (string-append #$output "/bin")))))))
+    (home-page "https://wias-berlin.de/software/tetgen/")
+    (synopsis
+     "Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator")
+    (description
+     "TetGen is a program to generate tetrahedral meshes of any 3D
+polyhedral domains.  TetGen generates exact constrained Delaunay
+tetrahedralizations, boundary conforming Delaunay meshes, and Voronoi
+partitions.")
+    (license license:agpl3+)))