From 53bec65c51c3f2b7e318db4dc7a5c3a09ad00214 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 17 Dec 2023 17:14:37 +0200 Subject: 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 d7ce839a68..99692fd2b7 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -725,10 +725,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 @@ -774,7 +775,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)) -- cgit v1.2.3