Subject: [bug#75286] [PATCH v3] gnu: Add tetgen.

From: Andreas Enge <[email-masked]>
Date: Wed, 5 Feb 2025 15:08:31 +0100

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: <[email-masked]>
From: Lars Bilke <[email-masked]>
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 <[email-masked]>
Signed-off-by: Andreas Enge <[email-masked]>
---
 gnu/packages/geo.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

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 <[email-masked]>
 ;;; Copyright © 2024 Wilko Meyer <[email-masked]>
 ;;; Copyright © 2024 Jonathan Brielmaier <[email-masked]>
+;;; Copyright © 2025 Andreas Enge <[email-masked]>
 ;;;
 ;;; 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+)))

base-commit: a53bd6f27b0a49491dc87c2476555682fef6c47e
-- 
2.47.1