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.master
parent
3557d7d8bc
commit
5cba0f4805
|
@ -745,12 +745,13 @@ your calls and messages.")
|
||||||
(("third_party/build") ""))
|
(("third_party/build") ""))
|
||||||
#t))))
|
#t))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(outputs '("out" "debug"))
|
(outputs '("out" "debug" "static"))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #t
|
`(#:tests? #t
|
||||||
#:test-target "selftest"
|
#:test-target "selftest"
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
(list "--with-external-speex"
|
(list "--enable-shared"
|
||||||
|
"--with-external-speex"
|
||||||
"--with-external-gsm"
|
"--with-external-gsm"
|
||||||
"--with-external-srtp"
|
"--with-external-srtp"
|
||||||
"--with-external-pa"
|
"--with-external-pa"
|
||||||
|
@ -769,7 +770,11 @@ your calls and messages.")
|
||||||
;; -DNDEBUG is set to prevent pjproject from raising
|
;; -DNDEBUG is set to prevent pjproject from raising
|
||||||
;; assertions that aren't critical, crashing
|
;; assertions that aren't critical, crashing
|
||||||
;; applications as the result.
|
;; 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
|
#:phases
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-after 'unpack 'make-source-files-writable
|
(add-after 'unpack 'make-source-files-writable
|
||||||
|
@ -780,6 +785,21 @@ your calls and messages.")
|
||||||
#t))
|
#t))
|
||||||
(add-before 'build 'build-dep
|
(add-before 'build 'build-dep
|
||||||
(lambda _ (invoke "make" "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
|
(add-before 'patch-source-shebangs 'autoconf
|
||||||
(lambda _
|
(lambda _
|
||||||
(invoke "autoconf" "-v" "-f" "-i" "-o"
|
(invoke "autoconf" "-v" "-f" "-i" "-o"
|
||||||
|
|
Reference in New Issue