Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / telephony.scm
index ce65648..fd8ec3f 100644 (file)
 ;;; Copyright © 2018 Jovany Leandro G.C <bit4bit@riseup.net>
 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
+;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
+;;; Copyright © 2019 Ivan Vilata i Balaguer <ivan@selidor.net>
+;;; Copyright © 2020 Brett Gilio <brettg@gnu.org>
+;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -43,6 +47,7 @@
   #:use-module (gnu packages file)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages gettext)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
@@ -60,7 +65,6 @@
   #:use-module (gnu packages qt)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages speech)
-  #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages upnp)
   #:use-module (gnu packages video)
@@ -76,7 +80,8 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system qt))
 
 (define-public commoncpp
   (package
@@ -241,7 +246,7 @@ internet.")
 (define-public libsrtp
   (package
     (name "libsrtp")
-    (version "2.2.0")
+    (version "2.3.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -250,13 +255,25 @@ internet.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1ac7xs1djb03j131f1gmqyfmrplblid9qqyxahs0shdy707r5ll6"))))
+                "1f7i3jdh1wzdv7zjlz7gs3xw5jqig9zw8z9awsqqcp54f94xdpvd"))))
     (native-inputs
      `(("psmisc" ,psmisc)               ;some tests require 'killall'
        ("procps" ,procps)))
     (build-system gnu-build-system)
     (arguments
-     '(#:test-target "runtest"))
+     '(#:test-target "runtest"
+       #:phases (modify-phases %standard-phases
+                  (add-after 'build 'build-shared
+                    (lambda* (#:key (make-flags '()) #:allow-other-keys)
+                      ;; Build the shared library separately because
+                      ;; the test runner requires a static build.
+                      (apply invoke "make" "shared_library" make-flags)
+                      #t))
+                  (add-after 'install 'remove-static-library
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (delete-file (string-append (assoc-ref outputs "out")
+                                                  "/lib/libsrtp2.a"))
+                      #t)))))
     (synopsis "Secure RTP (SRTP) Reference Implementation")
     (description
      "This package provides an implementation of the Secure Real-time Transport
@@ -378,54 +395,63 @@ address of one of the participants.")
 (define-public mumble
   (package
     (name "mumble")
-    (version "1.2.19")
+    (version "1.3.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://mumble.info/snapshot/"
                                   name "-" version ".tar.gz"))
               (sha256
                (base32
-                "1s60vaici3v034jzzi20x23hsj6mkjlc0glipjq4hffrg9qgnizh"))
-              (patches (search-patches "mumble-1.2.19-abs.patch"))
+                "03dqg5yf6d7ilc1wydpshnv1ndssppcbadqcq20jm5j4fdaf53cs"))
               (modules '((guix build utils)))
               (snippet
                `(begin
-                  ;; Remove bundled software.
-                  (for-each delete-file-recursively '("3rdparty"
-                                                      "speex"
-                                                      "speexbuild"
-                                                      "opus-build"
-                                                      "opus-src"
-                                                      "sbcelt-helper-build"
-                                                      "sbcelt-lib-build"
-                                                      "sbcelt-src"))
-                  ;; TODO: Celt is still bundled. It has been merged into Opus
-                  ;; and will be removed after 1.3.0.
-                  ;; https://github.com/mumble-voip/mumble/issues/1999
+                  ;; Remove bundled software.  Keep arc4random, celt-0.7.0,
+                  ;; celt-0.11.0, qqbonjour, rnnoise, smallft.
+                  (for-each
+                    delete-file-recursively
+                    '("3rdparty/GL" ; in mesa
+                      "3rdparty/mach-override-build" ; for macx
+                      "3rdparty/mach-override-src"
+                      "3rdparty/minhook-build" ; for win32
+                      "3rdparty/minhook-src"
+                      "3rdparty/opus-build" ; in opus
+                      "3rdparty/opus-src"
+                      "3rdparty/sbcelt-helper-build" ; not enabled
+                      "3rdparty/sbcelt-lib-build"
+                      "3rdparty/sbcelt-src"
+                      "3rdparty/speex-build" ; in speex
+                      "3rdparty/speex-src"
+                      "3rdparty/speexdsp-src" ; in speexdsp
+                      "3rdparty/xinputcheck-build" ; for win32
+                      "3rdparty/xinputcheck-src"))
                   #t))))
-    (build-system gnu-build-system)
+    (build-system qt-build-system)
     (arguments
      `(#:tests? #f  ; no "check" target
        #:phases
        (modify-phases %standard-phases
          (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
-             (invoke "qmake" "main.pro" "-recursive"
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (invoke "qmake" "main.pro" "QMAKE_LRELEASE=lrelease"
+                     (string-append "MUMBLE_PYTHON="
+                                    (string-append (assoc-ref inputs "python")
+                                                   "/bin/python3"))
                      (string-append "CONFIG+="
                                     (string-join
-                                     (list "no-update"
-                                           "no-ice"
+                                     ;; Options used are listed in the same order
+                                     ;; as in the "INSTALL" file
+                                     ;; (plus the final "packaged" and "release").
+                                     (list "no-bundled-speex" ; in speex
+                                           "no-bundled-opus" ; in opus
+                                           "no-g15" ; not packaged
+                                           "no-jackaudio" ; use pulse
+                                           "no-oss" ; use pulse
+                                           "no-alsa" ; use pulse
+                                           "no-update"
                                            "no-embed-qt-translations"
-                                           "no-bundled-speex"
-                                           "pch"
-                                           "no-bundled-opus"
-                                           "no-celt"
-                                           "no-alsa"
-                                           "no-oss"
-                                           "no-portaudio"
-                                           "speechd"
-                                           "no-g15"
-                                           "no-bonjour"
+                                           "no-ice" ; not packaged
+                                           "packaged"
                                            "release")))
                      (string-append "DEFINES+="
                                     "PLUGIN_PATH="
@@ -434,7 +460,19 @@ address of one of the participants.")
          (add-before 'configure 'fix-libspeechd-include
            (lambda _
              (substitute* "src/mumble/TextToSpeech_unix.cpp"
-               (("libspeechd.h") "speech-dispatcher/libspeechd.h"))))
+               (("libspeechd.h") "speech-dispatcher/libspeechd.h"))
+             #t))
+         ;; disable statistic gathering by default. see <https://bugs.gnu.org/25201>
+         (add-before 'configure 'fix-statistic-gathering-default
+           (lambda _
+             (substitute* "src/mumble/Settings.cpp"
+               (("bUsage = true;") "bUsage = false;"))
+             #t))
+         (add-before 'install 'disable-murmur-ice
+           (lambda _
+             (substitute* "scripts/murmur.ini.system"
+               (("^ice=") ";ice="))
+             #t))
          (replace 'install ; install phase does not exist
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
@@ -465,21 +503,23 @@ address of one of the participants.")
                          (find-files "release/plugins" "\\.so$"))))))))
     (inputs
      `(("avahi" ,avahi)
-       ("protobuf" ,protobuf-3.5)
-       ("openssl" ,openssl)
-       ("libsndfile" ,libsndfile)
        ("boost" ,boost)
-       ("opus" ,opus)
-       ("speex" ,speex)
-       ("speexdsp" ,speexdsp)
-       ("speech-dispatcher" ,speech-dispatcher)
-       ("libx11" ,libx11)
+       ("libsndfile" ,libsndfile)
        ("libxi" ,libxi)
-       ("qt-4" ,qt-4)
-       ("alsa-lib" ,alsa-lib)
-       ("pulseaudio" ,pulseaudio)))
+       ("mesa" ,mesa) ; avoid bundled
+       ("openssl" ,openssl)
+       ("opus" ,opus) ; avoid bundled
+       ("protobuf" ,protobuf)
+       ("pulseaudio" ,pulseaudio)
+       ("qtbase" ,qtbase)
+       ("qtsvg" ,qtsvg)
+       ("speech-dispatcher" ,speech-dispatcher)
+       ("speex" ,speex) ; avoid bundled
+       ("speexdsp" ,speexdsp))) ; avoid bundled
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("pkg-config" ,pkg-config)
+       ("python" ,python)
+       ("qttools" ,qttools)))
     (synopsis "Low-latency, high quality voice chat software")
     (description
      "Mumble is an low-latency, high quality voice chat
@@ -487,9 +527,9 @@ software primarily intended for use while gaming.
 Mumble consists of two applications for separate usage:
 @code{mumble} for the client, and @code{murmur} for the server.")
     (home-page "https://wiki.mumble.info/wiki/Main_Page")
-    (license (list license:bsd-3
-                   ;; The bundled celt is bsd-2. Remove after 1.3.0.
-                   license:bsd-2))))
+    (license (list license:bsd-3 ; mumble celt-0.7.0 qqbonjour rnnoise smallft
+                   license:bsd-2 ; celt-0.11.0
+                   license:isc)))) ; arc4random
 
 (define-public twinkle
   (package
@@ -603,7 +643,7 @@ calls and messages")
        ("libsrtp" ,libsrtp)
        ("gnutls" ,gnutls)
        ("resample", resample)
-       ("util-linux" ,util-linux)))
+       ("util-linux" ,util-linux "lib")))
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
@@ -636,12 +676,12 @@ calls and messages")
 Initiation Protocol (SIP) and a multimedia framework.")
     (license license:gpl2+)))
 
-(define %jami-version "20190319.4.a16a99f")
+(define %jami-version "20191101.3.67671e7")
 
 (define* (jami-source #:key without-daemon)
   (origin
     (method url-fetch)
-    (uri (string-append "http://dl.jami.net/ring-release/tarballs/ring_"
+    (uri (string-append "https://dl.jami.net/ring-release/tarballs/ring_"
                         %jami-version
                         ".tar.gz"))
     (modules '((guix build utils)))
@@ -652,7 +692,7 @@ Initiation Protocol (SIP) and a multimedia framework.")
        #f))
     (sha256
      (base32
-      "1c6n6sm7skw83v25g33g4jzbragz9j4przbzaz7asxw54jy33dwl"))))
+      "0kw172w2ccyz438kf5xqw14nhfm4xk6a2libnzib9j2wvhlpf4q0"))))
 
 (define-public pjproject-jami
   (package
@@ -685,35 +725,49 @@ Initiation Protocol (SIP) and a multimedia framework.")
              "--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")
+             "--with-gnutls"
+             "--with-external-srtp"
+             ;; We need -fPIC or else we get the following error when linking
+             ;; against pjproject-jami:
+             ;;   relocation R_X86_64_32S against `.rodata' can not be used when
+             ;;   making a shared object;
+             "CFLAGS=-fPIC"
+             "CXXFLAGS=-fPIC")
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'make-git-checkout-writable
+           (lambda _
+             (for-each make-file-writable (find-files "."))
+             #t))
          (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"
+                    '("fix_turn_alloc_failure"
                       "rfc2466"
                       "ipv6"
-                      "ice_config"
                       "multiple_listeners"
                       "pj_ice_sess"
                       "fix_turn_fallback"
                       "fix_ioqueue_ipv6_sendto"
                       "add_dtls_transport"
-                      "rfc6062")))
+                      "rfc6544"
+                      "ice_config"
+                      "sip_config"
+                      "fix_first_packet_turn_tcp"
+                      "fix_ebusy_turn"
+                      "ignore_ipv6_on_transport_check"
+                      "fix_turn_connection_failure"
+                      ;; "uwp_vs" ; for windows
+                      "disable_local_resolution")))
                (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")
+                       "-C" savoir-faire-linux-patches-directory
+                       "--strip-components=5"
+                       "ring-project/daemon/contrib/src/pjproject")
                (for-each
                 (lambda (file)
                   (invoke "patch" "--force" "-p1" "-i"
@@ -777,8 +831,9 @@ Initiation Protocol (SIP) and a multimedia framework.")
        ("libsecp256k1" ,libsecp256k1)
        ("python" ,python)
        ("python-wrapper" ,python-wrapper)
-       ("restbed" ,restbed)
+       ("restinio" ,restinio)
        ("libx11" ,libx11)
+       ("asio" ,asio)
        ;; TODO: Upstream seems to rely on a custom pjproject (a.k.a. pjsip) version.
        ;; See https://git.jami.net/savoirfairelinux/ring-daemon/issues/24.
        ("pjproject" ,pjproject-jami)))
@@ -863,25 +918,13 @@ This package provides a library common to all Jami clients.")
        ("clutter-gtk" ,clutter-gtk)
        ("gettext" ,gnu-gettext)
        ("libcanberra" ,libcanberra)
-       ("webkitgtk" ,webkitgtk)
-       ;; TODO: We must wrap ring-client-gnome to force using the
-       ;; `sqlite-with-column-metadata' package instead of `sqlite' or else it
-       ;; fails with:
-       ;;
-       ;;   /gnu/store/...-qtbase-5.11.2/lib/qt5/plugins/sqldrivers/libqsqlite.so:
-       ;;   undefined symbol: sqlite3_column_table_name16
-       ;;
-       ;; qtbase is built against sqlite-with-column-metadata but somehow
-       ;; jami-client-gnome ends up with both `sqlite' and
-       ;; `sqlite-with-column-metadata' as inputs and it seems that
-       ;; libqsqlite.so gets confused.
-       ("sqlite" ,sqlite-with-column-metadata)))
+       ("webkitgtk" ,webkitgtk)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("glib:bin" ,glib "bin")
        ("doxygen" ,doxygen)))
     (propagated-inputs
-     `(("libring" ,libring)             ; Contains `dring', the daemon, which is automatically by d-bus.
+     `(("libring" ,libring) ; Contains `dring', the daemon, which is automatically by d-bus.
        ("adwaita-icon-theme" ,adwaita-icon-theme)
        ("evolution-data-server" ,evolution-data-server)))
     (arguments
@@ -891,15 +934,8 @@ This package provides a library common to all Jami clients.")
          (add-after 'unpack 'change-directory
            (lambda _
              (chdir "client-gnome")
-             #t))
-         (add-after 'install 'wrap
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (path (string-append (assoc-ref inputs "sqlite") "/lib")))
-               (wrap-program (string-append out "/bin/gnome-ring")
-                 `("LD_LIBRARY_PATH" ":" prefix (,path))))
              #t)))))
-    (synopsis "Distributed multimedia communications platform")
+    (synopsis "Distributed, privacy-respecting communication program")
     (description "Jami (formerly GNU Ring) is a secure and distributed voice,
 video and chat communication platform that requires no centralized server and
 leaves the power of privacy in the hands of the user.  It supports the SIP and
@@ -911,3 +947,35 @@ This package provides the Jami client for the GNOME desktop.")
 
 (define-public jami-client-gnome
   (deprecated-package "jami-client-gnome" jami))
+
+(define-public libtgvoip
+  (package
+    (name "libtgvoip")
+    (version "2.4.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/grishka/libtgvoip.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       ;; Fix compilation on i686-linux architecture.
+       ;; NOTE: Applying these patches is order-dependent!
+       ;; The patch for WebRTC /must/ precede the patch for SSE2.
+       (patches
+        (search-patches "libtgvoip-disable-webrtc.patch"
+                        "libtgvoip-disable-sse2.patch"))
+       (sha256
+        (base32
+         "122kn3jx6v0kkldlzlpzvlwqxgp6pmzxsjhrhcxw12bx9c08sar5"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("libopusenc" ,libopusenc)
+       ("openssl" ,openssl)
+       ("pulseaudio" ,pulseaudio)))
+    (synopsis "VoIP library for Telegram clients")
+    (description "A collection of libraries and header files for implementing
+telephony functionality into custom Telegram clients.")
+    (home-page "https://github.com/zevlg/libtgvoip")
+    (license license:unlicense)))