guix-commits
[Top][All Lists]
Advanced

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

05/07: gnu: pjproject: Enable shared libraries.


From: guix-commits
Subject: 05/07: gnu: pjproject: Enable shared libraries.
Date: Mon, 3 Aug 2020 23:30:47 -0400 (EDT)

apteryx pushed a commit to branch master
in repository guix.

commit 5cba0f48053c036466ff8a61395673ca504e0f73
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sat Aug 1 02:08:30 2020 -0400

    gnu: pjproject: Enable shared libraries.
    
    * gnu/packages/telephony.scm (pjproject)[outputs]: Add a "static" output.
    [phases]: Move the 'check phase after the 'install phase.
    {move-static-libraries}: Add phase.
    [configure-flags]: Set LDFLAGS to add a runpath reference to self.
---
 gnu/packages/telephony.scm | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index 2c50b34..58df4f5 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -745,12 +745,13 @@ your calls and messages.")
              (("third_party/build") ""))
            #t))))
     (build-system gnu-build-system)
-    (outputs '("out" "debug"))
+    (outputs '("out" "debug" "static"))
     (arguments
      `(#:tests? #t
        #:test-target "selftest"
        #:configure-flags
-       (list "--with-external-speex"
+       (list "--enable-shared"
+             "--with-external-speex"
              "--with-external-gsm"
              "--with-external-srtp"
              "--with-external-pa"
@@ -769,7 +770,11 @@ your calls and messages.")
              ;; -DNDEBUG is set to prevent pjproject from raising
              ;; assertions that aren't critical, crashing
              ;; applications as the result.
-             "CFLAGS=-DNDEBUG")
+             "CFLAGS=-DNDEBUG"
+             ;; Specify a runpath reference to itself, which is missing and
+             ;; causes the validate-runpath phase to fail.
+             (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out")
+                            "/lib"))
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'make-source-files-writable
@@ -780,6 +785,21 @@ your calls and messages.")
              #t))
          (add-before 'build 'build-dep
            (lambda _ (invoke "make" "dep")))
+         ;; The check phases is moved after the install phase so to
+         ;; use the installed shared libraries for the tests.
+         (delete 'check)
+         (add-after 'install 'move-static-libraries
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (s (string-append (assoc-ref outputs "static") "/lib")))
+               (mkdir-p s)
+               (with-directory-excursion out
+                 (for-each (lambda (f)
+                             (rename-file f (string-append s "/" (basename 
f))))
+                           (find-files "." "\\.a$")))
+               #t)))
+         (add-after 'install 'check
+           (assoc-ref %standard-phases 'check))
          (add-before 'patch-source-shebangs 'autoconf
            (lambda _
              (invoke "autoconf" "-v" "-f" "-i" "-o"



reply via email to

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