From 98cca07a1f96929d8d80cf36d33e83098b93af40 Mon Sep 17 00:00:00 2001
From: Olivier Farges <olivier.farges@univ-lorraine.fr>
Date: Sat, 1 Mar 2025 01:53:49 +0100
Subject: [PATCH] debug star-enclosures-3d

---
 edix/packages/star-3d.scm | 35 +++++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/edix/packages/star-3d.scm b/edix/packages/star-3d.scm
index e7b7298..797cfa9 100644
--- a/edix/packages/star-3d.scm
+++ b/edix/packages/star-3d.scm
@@ -16,7 +16,6 @@
   #:use-module (edix packages embree-edix)
   #:use-module (edix packages rsys))
 
-
 (define-public star-3d
   (package
     (name "star-3d")
@@ -37,21 +36,41 @@
            bash
            gnu-make))
     (arguments
-     `(#:make-flags (list (string-append "CC=gcc" ))
+   `(#:make-flags (list (string-append "CC=gcc" ))
        #:phases
        (modify-phases %standard-phases
          (delete 'configure) 
-         (delete 'check)
-         (replace 'build
-           (lambda* (#:key make-flags #:allow-other-keys)
-		    (invoke "make" (string-join make-flags " ")))))
+         (delete 'check) 
+	(replace 'build
+		 (lambda* (#:key make-flags #:allow-other-keys)
+			  (invoke "make" (string-join make-flags " "))))
 	(replace 'install
 		 (lambda* (#:key outputs #:allow-other-keys)
 			  (let ((out (assoc-ref outputs "out")))
-			    (invoke "make" "install" (string-append "PREFIX=" out)))))))
+			    (invoke "make" "install" (string-append "PREFIX=" out)))))
+
+         (add-after 'install 'install-pkg-config
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (pkgconfig-dir (string-append out "/lib/pkgconfig"))
+                    (pc-file (string-append pkgconfig-dir "/s3d.pc")))
+               (mkdir-p pkgconfig-dir)
+               (with-output-to-file pc-file
+                 (lambda ()
+                   (format #t "prefix=~a~%" out)
+                   (format #t "exec_prefix=${prefix}~%")
+                   (format #t "libdir=${exec_prefix}/lib~%")
+                   (format #t "includedir=${prefix}/include~%")
+                   (format #t "~%")
+                   (format #t "Name: s3d~%")
+                   (format #t "Description: 3D simulation library~%")
+                   (format #t "Version: 0.10~%")
+                   (format #t "Cflags: -I${includedir}~%")
+                   (format #t "Libs: -L${libdir} -lstar-3d~%"))))))
+	 )))
+    
     (home-page "https://meso-star.com/star-3d") ;; Remplacez avec le bon lien
     (synopsis "Bibliothèque Star-3D")
     (description "Star-3D")
     (license (list gpl3+))))
 
-
-- 
GitLab