[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/05: gnu: Add pjproject-ring.
From: |
guix-commits |
Subject: |
02/05: gnu: Add pjproject-ring. |
Date: |
Fri, 11 Jan 2019 13:52:16 -0500 (EST) |
ambrevar pushed a commit to branch wip-ring
in repository guix.
commit 482cb9f07e333e2634d245f84e10b57500c33a13
Author: Pierre Neidhardt <address@hidden>
Date: Fri Jan 11 18:56:44 2019 +0100
gnu: Add pjproject-ring.
* gnu/packages/telephony.scm (pjproject-ring): New variable.
---
gnu/packages/telephony.scm | 96 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index e588b4d..151a534 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -625,3 +625,99 @@ calls and messages")
(description "PJProject provides an implementation of the Session
Initiation Protocol (SIP) and a multimedia framework.")
(license license:gpl2+)))
+
+(define-public pjproject-ring
+ (package
+ (inherit pjproject)
+ (name "pjproject-ring")
+ (native-inputs
+ `(("savoir-faire-linux-patches"
+ ,(origin
+ (method url-fetch)
+ (uri (string-append "http://dl.ring.cx/ring-release/tarballs/ring_"
+ (package-version libring)
+ ".tar.gz"))
+ (modules '((guix build utils)))
+ (sha256
+ (base32
+ "1kvkxxwfl5wh9jrd0v8nbgdby8afg4w6allp1aww2a6xl4q7lwxf"))))
+ ,@(package-native-inputs pjproject)))
+ (arguments
+ ;; TODO: Inherit from original.
+ `( ;; FIXME make: No rule to make target
+ ;; 'pjlib-test-unknown-[something]-gnu'.
+ #:tests? #f
+ ;; #:test-target "selftest"
+ #:configure-flags
+ ;; See ring-project/daemon/contrib/src/pjproject/rules.mak.
+ (list "--disable-oss"
+ "--disable-sound"
+ "--disable-video"
+ "--enable-ext-sound"
+ "--disable-speex-aec"
+ "--disable-g711-codec"
+ "--disable-l16-codec"
+ "--disable-gsm-codec"
+ "--disable-g722-codec"
+ "--disable-g7221-codec"
+ "--disable-speex-codec"
+ "--disable-ilbc-codec"
+ "--disable-opencore-amr"
+ "--disable-silk"
+ "--disable-sdl"
+ "--disable-ffmpeg"
+ "--disable-v4l2"
+ "--disable-openh264"
+ "--disable-resample"
+ "--disable-libwebrtc"
+ ;; "-fPIC" is required for libring. Bug?
+ "CFLAGS=-fPIC -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256
-DPJ_ICE_MAX_CHECKS=1024 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3
-DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32"
+ "CXXFLAGS=-fPIC -DPJ_ENABLE_EXTRA_CHECK=1 -DPJ_ICE_MAX_CAND=256
-DPJ_ICE_MAX_CHECKS=1024 -DPJ_ICE_COMP_BITS=2 -DPJ_ICE_MAX_STUN=3
-DPJSIP_MAX_PKT_LEN=8000 -DPJ_ICE_ST_MAX_CAND=32"
+ ;; Now deviating from the rules.mak file.
+ "--enable-ssl=gnutls"
+ "--with-external-srtp")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'build-dep
+ (lambda _ (invoke "make" "dep")))
+ (add-after 'unpack 'apply-patches
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((savoir-faire-linux-patches-directory "Savoir-faire Linux
patches")
+ ;; Comes from
+ ;; "ring-project/daemon/contrib/src/pjproject/rules.mak".
+ ;; WARNING: These amount for huge changes in pjproject.
+ ;; Particularly, they add support for GnuTLS.
+ (savoir-faire-linux-patches
+ '("gnutls"
+ "rfc2466"
+ "ipv6"
+ "ice_config"
+ "multiple_listeners"
+ "pj_ice_sess"
+ "fix_turn_fallback"
+ "fix_ioqueue_ipv6_sendto"
+ "add_dtls_transport"
+ "rfc6062")))
+ (mkdir-p savoir-faire-linux-patches-directory)
+ (invoke "tar" "-xvf" (assoc-ref inputs
"savoir-faire-linux-patches")
+ "-C" savoir-faire-linux-patches-directory
"--strip-components=5" "ring-project/daemon/contrib/src/pjproject")
+ (for-each
+ (lambda (file)
+ (invoke "patch" "--force" "-p1" "-i"
+ (string-append savoir-faire-linux-patches-directory
"/"
+ file ".patch")))
+ savoir-faire-linux-patches))
+ #t))
+ ;; Autoconf must be re-run after applying the patches.
+ (add-before 'patch-source-shebangs 'autoconf
+ (lambda _
+ (invoke "autoconf" "-v" "-f" "-i" "-o"
+ "aconfigure" "aconfigure.ac")))
+ (add-before 'autoconf 'disable-some-tests
+ ;; Three of the six test programs fail due to missing network
+ ;; access.
+ (lambda _
+ (substitute* "Makefile"
+ (("selftest: pjlib-test pjlib-util-test pjnath-test
pjmedia-test pjsip-test pjsua-test")
+ "selftest: pjlib-test pjlib-util-test pjmedia-test"))
+ #t)))))))