Subject: [bug#70305] [PATCH 4/5] gnu: coin3d: Avoid use of dlopen.

From: Jean-Pierre De Jesus DIAZ <[email-masked]>
Date: Tue, 9 Apr 2024 12:22:37 +0200

* gnu/packages/graphics.scm (coin3d): Avoid use of dlopen and add
missing inputs.

Change-Id: I48d93218bd93f6ef4f10fb1c4f1cc22396040d7d
---
 gnu/packages/graphics.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 7f704c3e58..5d7c95a2a9 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -81,6 +81,7 @@ (define-module (gnu packages graphics)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnunet)
+  #:use-module (gnu packages gnuzilla)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
@@ -1986,12 +1987,31 @@ (define-public coin3d
      (list #:configure-flags
            #~(list "-DCOIN_BUILD_DOCUMENTATION_MAN=ON"
                    "-DUSE_EXTERNAL_EXPAT=ON"
+                   ;; Disable "runtime linking" of libraries, i.e. `dlopen`,
+                   ;; force to use libraries at build time.
+                   "-DFONTCONFIG_RUNTIME_LINKING=OFF"
+                   "-DFREETYPE_RUNTIME_LINKING=OFF"
+                   "-DLIBBZIP2_RUNTIME_LINKING=OFF"
+                   "-DOPENAL_RUNTIME_LINKING=OFF"
+                   ;"-DSIMAGE_RUNTIME_LINKING=OFF" -- Not packaged yet.
+                   "-DZLIB_RUNTIME_LINKING=OFF"
+                   "-DGLU_RUNTIME_LINKING=OFF"
+                   ;"-DSPIDERMONKEY_RUNTIME_LINKING=OFF" -- Can't find mozjs.
                    (string-append "-DBOOST_ROOT="
                                   #$(this-package-input "boost")))))
     (native-inputs
      (list doxygen graphviz))
     (inputs
-     (list boost expat freeglut glew))
+     (list boost
+           bzip2
+           expat
+           fontconfig
+           freeglut
+           freetype
+           glew
+           libx11
+           openal
+           zlib))
     (home-page "https://github.com/coin3d/coin")
     (synopsis
      "High-level 3D visualization library with Open Inventor 2.1 API")
-- 
2.41.0