>From e635d7f01155473eef90b5e0ba94c3e64da70909 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 11 Jan 2021 20:25:49 -0500 Subject: [PATCH 12/15] gnu: Add tg_owt. * gnu/packages/telephony.scm (tg_owt): New variable. --- gnu/packages/telephony.scm | 107 +++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index 48e30abfc3..afc85f8424 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -40,6 +40,7 @@ #:use-module (gnu packages admin) #:use-module (gnu packages aidc) #:use-module (gnu packages algebra) + #:use-module (gnu packages assembly) #:use-module (gnu packages autotools) #:use-module (gnu packages avahi) #:use-module (gnu packages audio) @@ -47,6 +48,7 @@ #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages cpp) #:use-module (gnu packages crypto) #:use-module (gnu packages databases) #:use-module (gnu packages docbook) @@ -93,6 +95,111 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system qt)) +(define-public tg_owt + (let ((commit "fa86fcc00c218813d61a272a56feab55c76a1ab9") + (revision "1")) + (package + (name "tg_owt") + (version + (git-version "1" revision commit)) + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/desktop-app/tg_owt.git") + (commit commit))) + (file-name + (git-file-name name version)) + (sha256 + (base32 "06gcrlym6vqqw7zlds9lpwyg37d5m81d87h16aps19v0v9gzan0l")))) + (build-system cmake-build-system) + (arguments + `(#:tests? #f ; No target + #:configure-flags + (list + "-DCMAKE_C_FLAGS=-fPIC" + "-DCMAKE_CXX_FLAGS=-fPIC") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'delete-thirdparty + (lambda _ + (with-directory-excursion "src/third_party" + (for-each delete-file-recursively + ;; [1] Keep Abseil-CPP, LibSRTP, LibVPx, LibYuv, + ;; OpenH264, PFFFT, RnNoise and UsrSCTP. + ;; [2] Tg_owt uses custom fork of Abseil-CPP, + ;; LibSRTP, OpenH264 and RnNoise. + ;; [3] Tg_owt uses specific version/commit of LibVPx, + ;; which is different from one available in Guix. + ;; [4] LibYuv, PFFFT and UsrSCTP aren't available. + (list + "yasm"))) + #t)) + (add-after 'delete-thirdparty 'copy-inputs + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((libvpx-from (assoc-ref inputs "libvpx")) + (libyuv-from (assoc-ref inputs "libyuv")) + (libvpx-to (string-append (getcwd) + "/src/third_party/libvpx/source/libvpx")) + (libyuv-to (string-append (getcwd) + "/src/third_party/libyuv"))) + (copy-recursively libvpx-from libvpx-to) + (copy-recursively libyuv-from libyuv-to)) + #t))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python" ,python-wrapper) + ("yasm" ,yasm))) + (inputs + `(("alsa" ,alsa-lib) + ("ffmpeg" ,ffmpeg) + ("libjpeg" ,libjpeg-turbo) + ("libvpx" + ,(origin + (method git-fetch) + (uri + (git-reference + (url "https://chromium.googlesource.com/webm/libvpx") + (commit "5b63f0f"))) + (file-name + (git-file-name "libvpx" version)) + (sha256 + (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68")))) + ("libyuv" + ,(origin + (method git-fetch) + (uri + (git-reference + (url "https://chromium.googlesource.com/libyuv/libyuv") + (commit "ad89006"))) + (file-name + (git-file-name "libyuv" version)) + (sha256 + (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))) + ("openssl" ,openssl) + ("opus" ,opus) + ("protobuf" ,protobuf) + ("pulseaudio" ,pulseaudio))) + (synopsis "WebRTC support for Telegram-Desktop") + (description "Tg_owt is a custom WebRTC fork by Telegram project, +for its use in telegram desktop client.") + (home-page "https://github.com/desktop-app/tg_owt") + (license + (list + ;; Abseil-CPP + license:asl2.0 + ;; LibYuv + (license:non-copyleft "file:///src/third_party/libyuv/LICENSE") + ;; OpenH264 + license:bsd-2 + ;; PFFFT + (license:non-copyleft "file:///src/third_party/pffft/LICENSE") + ;; RnNoise + license:gpl3 + ;; LibSRTP, LibVPx, UsrSCTP and Others + license:bsd-3))))) + (define-public libilbc (package (name "libilbc") -- 2.30.0