diff mbox series

[bug#48083,1/3] gnu: webrtc-for-telegram-desktop: Use usrsctp from guix instead of from third-party.

Message ID 20210428165141.27183-1-rg@raghavgururajan.name
State New
Headers show
Series [bug#48083,1/3] gnu: webrtc-for-telegram-desktop: Use usrsctp from guix instead of from third-party. | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Raghav Gururajan April 28, 2021, 4:51 p.m. UTC
UsrSCTP is now available in Guix (f5e69549ba5d6efcd03f4f50f771a8a76ed73c5b).

* gnu/packages/telegram.scm (webrtc-for-telegram-desktop)
[snippet]: Remove usrsctp from keep list.
[phases](patch-cmake): New phase.
---
 gnu/packages/telegram.scm | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index e6bfe6c4f2..cf5c173973 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -44,6 +44,7 @@ 
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages networking)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
@@ -96,7 +97,7 @@ 
                      '( ;; Custom forks which are incompatible with the ones in Guix.
                        "abseil-cpp" "libsrtp" "openh264" "rnnoise"
                        ;; Not available in Guix.
-                       "pffft" "usrsctp"
+                       "pffft"
                        ;; Has cmake support files for libvpx input.
                        "libvpx")))
                 (with-directory-excursion "src/third_party"
@@ -124,9 +125,22 @@ 
                                                  "/src/third_party/libyuv")))
                   (copy-recursively libvpx-from libvpx-to)
                   (copy-recursively libyuv-from libyuv-to))
-                #t)))))
+                #t))
+            (add-after 'copy-inputs 'patch-cmake
+              (lambda* (#:key inputs #:allow-other-keys)
+                (substitute* "CMakeLists.txt"
+                  ;; Disable building of usrsctp as thirdparty,
+                  ;; as we removed its source.
+                  (("include\\(cmake/libusrsctp.cmake\\)") "")
+                  ;; Link to usrsctp that is provided as input,
+                  ;; instead of linking to usrsctp that is supossedly
+                  ;; built as thirdparty.
+                  (("tg_owt::libusrsctp") "usrsctp")
+                  ;; Disable exporting of usrsctp,
+                  ;; that is supossedly built as thirdparty.
+                  (("[ \t]*libusrsctp") "")))))))
        (native-inputs
-        `(("gcc" ,gcc-9) ; keep in line with telegram-desktop
+        `(("gcc" ,gcc-9)          ; keep in line with telegram-desktop
           ("perl" ,perl)
           ("pkg-config" ,pkg-config)
           ("python" ,python-wrapper)
@@ -161,6 +175,7 @@ 
           ("opus" ,opus)
           ("protobuf" ,protobuf)
           ("pulseaudio" ,pulseaudio)
+          ("usrsctp" ,usrsctp)
           ("x11" ,libx11)
           ("xext" ,libxext)
           ("xtst" ,libxtst)))