guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: gnu: gsl: Provide static library in separate output.


From: guix-commits
Subject: 01/03: gnu: gsl: Provide static library in separate output.
Date: Mon, 18 Dec 2023 01:39:09 -0500 (EST)

efraim pushed a commit to branch core-updates
in repository guix.

commit 4276c595606d8bb2b24de8d91dd465dd1da131a5
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Dec 17 17:14:37 2023 +0200

    gnu: gsl: Provide static library in separate output.
    
    * gnu/packages/maths.scm (gsl)[outputs]: New field.
    [arguments]: Remove configure-flag disabling static library.  Add
    make-flag to produce PIC output.  Add a phase to move the static
    libraries into the static output.
    
    Change-Id: I4c5dddb8d384f4e2f82122b239da44350bacf57a
---
 gnu/packages/maths.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2dd8f187c9..ad514a4641 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -685,10 +685,11 @@ precision floating point numbers.")
               (sha256
                (base32
                 "0jxkxrnpys2j3rh8bzx0bmnh4w6xm28jd57rgxsjp0s863agpc6w"))))
+    (outputs '("out" "static"))
     (build-system gnu-build-system)
     (arguments
      (let ((system (%current-system)))
-       `(#:configure-flags (list "--disable-static") ;halves package size
+       `(#:make-flags (list "CFLAGS=-fPIC")
          #:phases
          (modify-phases %standard-phases
            ,@(cond
@@ -734,7 +735,16 @@ precision floating point numbers.")
                        (("gsl_ieee_env_setup.*" all)
                         (string-append "exit (77);\n" all)))))))
 
-              (else '()))))))
+              (else '()))
+           (add-after 'install 'move-static-library
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((static (string-append (assoc-ref outputs "static") 
"/lib/"))
+                     (out    (string-append (assoc-ref outputs "out") 
"/lib/")))
+                 (mkdir-p static)
+                 (rename-file (string-append out "libgsl.a")
+                              (string-append static "libgsl.a"))
+                 (rename-file (string-append out "libgslcblas.a")
+                              (string-append static "libgslcblas.a")))))))))
     (native-inputs
      (if (and (target-riscv64?)
               (%current-target-system))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]