about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/telegram
diff options
context:
space:
mode:
authoroxalica <oxalicc@pm.me>2021-07-20 22:54:17 +0800
committeroxalica <oxalicc@pm.me>2021-07-23 05:38:52 +0800
commit548ff797656e6f2e03002746d9d1e42f2c6bd841 (patch)
tree6dd3f38e0063d68cd4813cb2f84c6b6956ce9f19 /pkgs/applications/networking/instant-messengers/telegram
parent16105403bdd843540cbef9c63fc0f16c1c6eaa70 (diff)
tdesktop.tg_owt: rework and clean up
- Build shared library to keep binary small.

- Prefer system-wide libraries instead of bundled ones.

- `abseil-cpp` (absl) is required for downstream build and appears in
  output cmake file. So it's added to `propagatedBuildInputs`.
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/telegram')
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix20
1 files changed, 14 insertions, 6 deletions
diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix
index 46076bca68c30..363650dae5a7b 100644
--- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix
+++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/tg_owt.nix
@@ -1,9 +1,9 @@
 { lib, stdenv, fetchFromGitHub, fetchpatch
 , pkg-config, cmake, ninja, yasm
 , libjpeg, openssl, libopus, ffmpeg, alsa-lib, libpulseaudio, protobuf
-, xorg, libXtst, libXcomposite, libXdamage, libXext, libXrender, libXrandr
+, openh264, usrsctp, libevent, libvpx
 , glib, abseil-cpp, pcre, util-linuxMinimal, libselinux, libsepol, pipewire
-, libXi
+, xorg, libX11, libXtst, libXcomposite, libXdamage, libXext, libXrender, libXrandr, libXi
 }:
 
 stdenv.mkDerivation {
@@ -24,15 +24,23 @@ stdenv.mkDerivation {
 
   buildInputs = [
     libjpeg openssl libopus ffmpeg alsa-lib libpulseaudio protobuf
-    xorg.libX11 libXtst libXcomposite libXdamage libXext libXrender libXrandr
+    openh264 usrsctp libevent libvpx
+    libX11 libXtst libXcomposite libXdamage libXext libXrender libXrandr libXi
     glib abseil-cpp pcre util-linuxMinimal libselinux libsepol pipewire
-    libXi
   ];
 
   cmakeFlags = [
-    # Building as a shared library isn't officially supported and currently broken:
+    # Building as a shared library isn't officially supported and may break at any time.
     "-DBUILD_SHARED_LIBS=OFF"
   ];
 
-  meta.license = lib.licenses.bsd3;
+  propagatedBuildInputs = [
+    # Required for linking downstream binaries.
+    abseil-cpp openh264 usrsctp libevent libvpx
+  ];
+
+  meta = with lib; {
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ oxalica ];
+  };
 }