diff mbox series

[bug#66034,gnome-team,2/3] gnu: pcre2: install static libraries.

Message ID 051fe4a2bba91549c26246e071c1575f14c9ca38.1694877577.git.vivien@planete-kraus.eu
State New
Headers show
Series Fix qemu | expand

Commit Message

Vivien Kraus Sept. 16, 2023, 12:25 p.m. UTC
* gnu/packages/pcre.scm (pcre2)[#:configure-flags]: Remove "--disable-static".
[#:phases 'move-static-libs]: Same as pcre.
[outputs]: Add a "static" output.
---
 gnu/packages/pcre.scm | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/pcre.scm b/gnu/packages/pcre.scm
index ee48ad0e2b..c7471169d9 100644
--- a/gnu/packages/pcre.scm
+++ b/gnu/packages/pcre.scm
@@ -102,6 +102,7 @@  (define-public pcre2
                (base32
                 "0s4x2l6g0sb9piwkr3sxqwdswz2g6bk1hhwngv0kv4w38wybir0l"))))
     (build-system gnu-build-system)
+    (outputs '("out" "static"))
     (inputs (list bzip2 readline zlib))
     (arguments
      (list #:configure-flags
@@ -114,14 +115,23 @@  (define-public pcre2
                ;; riscv64-linux is an unsupported architecture.
                #$@(if (target-riscv64?)
                       #~()
-                      #~("--enable-jit"))
-               "--disable-static")
+                      #~("--enable-jit")))
            #:phases
            #~(modify-phases %standard-phases
                (add-after 'unpack 'patch-paths
                  (lambda _
                    (substitute* "RunGrepTest"
-                     (("/bin/echo") (which "echo"))))))))
+                     (("/bin/echo") (which "echo")))))
+               (add-after 'install 'move-static-libs
+                 (lambda _
+                   (let ((source (string-append #$output "/lib"))
+                         (static (string-append #$output:static "/lib")))
+                     (mkdir-p static)
+                     (for-each (lambda (lib)
+                                 (link lib (string-append static "/"
+                                                          (basename lib)))
+                                 (delete-file lib))
+                               (find-files source "\\.a$"))))))))
     (synopsis "Perl Compatible Regular Expressions")
     (description
      "The PCRE library is a set of functions that implement regular expression