From fe8f77c2c086440e8756cba0abf42e7f1b155015 Mon Sep 17 00:00:00 2001 From: Thibault Lemaire Date: Thu, 21 Apr 2022 16:40:39 +0200 Subject: [PATCH] linphone: Cleanup dependencies A lot of bloat had been accumulated through updates (e.g. with linphone migrating from Gtk to Qt, or linphone being split to liblinphone & linphone-desktop). Method: Through trial and error. Delete all dependencies, try to build, try to run, reintroduce missing dependencies. I have tested everything I could, but it is possible that some optional features have been silently disabled with dependencies not being found now. (Codecs, encryption schemes, etc...) --- .../instant-messengers/linphone/default.nix | 70 +--------------- .../development/libraries/belcard/default.nix | 6 +- .../libraries/liblinphone/default.nix | 82 ++----------------- pkgs/development/libraries/lime/default.nix | 8 +- .../libraries/mediastreamer/default.nix | 37 ++------- .../libraries/mediastreamer/msopenh264.nix | 2 +- 6 files changed, 24 insertions(+), 181 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/linphone/default.nix b/pkgs/applications/networking/instant-messengers/linphone/default.nix index 3b11f7fc1a8..306a53f0a3c 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/default.nix @@ -1,51 +1,18 @@ -{ bcg729 -, bctoolbox -, bcunit +{ bctoolbox , belcard , belle-sip , belr -, bzrtp -, cairo , cmake -, cyrus_sasl , fetchFromGitLab -, fetchurl -, ffmpeg -, gdk-pixbuf -, glib -, graphviz -, gtk2 -, intltool , lib -, libexosip , liblinphone -, libmatroska -, libnotify -, libosip -, libsoup -, libupnp -, libX11 -, libxml2 -, makeWrapper -, mbedtls , mediastreamer , mediastreamer-openh264 , minizip2 , mkDerivation -, openldap -, ortp -, pango -, pkg-config -, qtbase , qtgraphicaleffects , qtquickcontrols2 , qttranslations -, readline -, speex -, sqlite - -, udev -, zlib }: # How to update Linphone? (The Qt desktop app) @@ -95,57 +62,22 @@ mkDerivation rec { # linphone-desktop. buildInputs = [ # Made by BC - bcg729 bctoolbox belcard belle-sip belr - bzrtp liblinphone mediastreamer mediastreamer-openh264 - ortp - - # Vendored by BC but we use upstream, might cause problems - libmatroska - cairo - cyrus_sasl - ffmpeg - gdk-pixbuf - glib - gtk2 - libX11 - libexosip - libnotify - libosip - libsoup - libupnp - libxml2 - mbedtls minizip2 - openldap - pango - qtbase qtgraphicaleffects qtquickcontrols2 qttranslations - readline - speex - sqlite - udev - zlib ]; nativeBuildInputs = [ - # Made by BC - bcunit - cmake - graphviz - intltool - makeWrapper - pkg-config ]; cmakeFlags = [ diff --git a/pkgs/development/libraries/belcard/default.nix b/pkgs/development/libraries/belcard/default.nix index aace36c619c..0f251f73e81 100644 --- a/pkgs/development/libraries/belcard/default.nix +++ b/pkgs/development/libraries/belcard/default.nix @@ -22,8 +22,10 @@ stdenv.mkDerivation rec { buildInputs = [ bctoolbox belr ]; nativeBuildInputs = [ cmake ]; - # Do not build static libraries - cmakeFlags = [ "-DENABLE_STATIC=NO" ]; + cmakeFlags = [ + "-DENABLE_STATIC=NO" # Do not build static libraries + "-DENABLE_UNIT_TESTS=NO" # Do not build test executables + ]; meta = with lib; { description = "C++ library to manipulate VCard standard format. Part of the Linphone project."; diff --git a/pkgs/development/libraries/liblinphone/default.nix b/pkgs/development/libraries/liblinphone/default.nix index 89a23dccc7e..10c2bfb272c 100644 --- a/pkgs/development/libraries/liblinphone/default.nix +++ b/pkgs/development/libraries/liblinphone/default.nix @@ -1,50 +1,20 @@ -{ bcg729 -, bctoolbox -, bcunit +{ bctoolbox , belcard , belle-sip , belr -, bzrtp -, cairo , cmake -, cyrus_sasl , doxygen , fetchFromGitLab -, ffmpeg -, gdk-pixbuf -, glib -, graphviz -, gtk2 -, intltool , jsoncpp -, libexosip -, libmatroska -, libnotify -, libosip -, libsoup -, libupnp -, libX11 , libxml2 , lime -, makeWrapper -, mbedtls , mediastreamer -, openldap -, ortp -, pango -, pkg-config , python3 -, readline , bc-soci -, boost -, speex , sqlite , lib , stdenv -, udev , xercesc -, xsd -, zlib }: stdenv.mkDerivation rec { @@ -62,69 +32,31 @@ stdenv.mkDerivation rec { patches = [ ./use-normal-jsoncpp.patch ]; - # Do not build static libraries - cmakeFlags = [ "-DENABLE_STATIC=NO" ]; + cmakeFlags = [ + "-DENABLE_STATIC=NO" # Do not build static libraries + "-DENABLE_UNIT_TESTS=NO" # Do not build test executables + ]; - # TODO: Not sure if all these inputs are actually needed. Most of them were - # defined when liblinphone and linphone-desktop weren't separated yet, so some - # of them might not be needed for liblinphone alone. buildInputs = [ - (python3.withPackages (ps: [ ps.pystache ps.six ])) - # Made by BC - bcg729 - bctoolbox belcard belle-sip - belr - bzrtp lime mediastreamer - ortp # Vendored by BC bc-soci - # Vendored by BC but we use upstream, might cause problems - libmatroska - - cairo - cyrus_sasl - ffmpeg - gdk-pixbuf - glib - gtk2 - libX11 - libexosip - libnotify - libosip - libsoup - libupnp + jsoncpp libxml2 - mbedtls - openldap - pango - readline - boost - speex + (python3.withPackages (ps: [ ps.pystache ps.six ])) sqlite - udev xercesc - xsd - zlib - jsoncpp ]; nativeBuildInputs = [ - # Made by BC - bcunit - cmake doxygen - graphviz - intltool - makeWrapper - pkg-config ]; strictDeps = true; diff --git a/pkgs/development/libraries/lime/default.nix b/pkgs/development/libraries/lime/default.nix index 1d6a94a828a..38dd0d04e67 100644 --- a/pkgs/development/libraries/lime/default.nix +++ b/pkgs/development/libraries/lime/default.nix @@ -5,7 +5,6 @@ , lib , bc-soci , sqlite -, boost , stdenv }: @@ -31,12 +30,13 @@ stdenv.mkDerivation rec { bc-soci sqlite - boost ]; nativeBuildInputs = [ cmake ]; - # Do not build static libraries - cmakeFlags = [ "-DENABLE_STATIC=NO" ]; + cmakeFlags = [ + "-DENABLE_STATIC=NO" # Do not build static libraries + "-DENABLE_UNIT_TESTS=NO" # Do not build test executables + ]; meta = with lib; { description = "End-to-end encryption library for instant messaging. Part of the Linphone project."; diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix index 2d9c559bcba..bb5bc566bc1 100644 --- a/pkgs/development/libraries/mediastreamer/default.nix +++ b/pkgs/development/libraries/mediastreamer/default.nix @@ -1,33 +1,21 @@ -{ alsa-lib -, bctoolbox +{ bctoolbox , bzrtp , cmake -, doxygen , fetchFromGitLab , ffmpeg , glew , gsm -, intltool , lib -, libGL -, libGLU , libX11 , libXext -, libXv -, libmatroska , libopus -, libpcap , libpulseaudio -, libtheora -, libupnp , libv4l , libvpx , ortp -, pkg-config , python3 , qtbase , qtdeclarative -, SDL , speex , srtp , stdenv @@ -59,9 +47,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake - doxygen - intltool - pkg-config python3 qtbase qtdeclarative @@ -73,28 +58,19 @@ stdenv.mkDerivation rec { bzrtp ortp - # Vendored by BC but we use upstream, might cause problems - libmatroska - - alsa-lib ffmpeg glew - gsm - libGL - libGLU libX11 libXext - libXv - libopus - libpcap libpulseaudio - libtheora - libupnp libv4l - libvpx - SDL speex srtp + + # Optional + gsm # GSM audio codec + libopus # Opus audio codec + libvpx # VP8 video codec ]; strictDeps = true; @@ -104,6 +80,7 @@ stdenv.mkDerivation rec { "-DENABLE_QT_GL=ON" # Build necessary MSQOGL plugin for Linphone desktop "-DCMAKE_C_FLAGS=-DGIT_VERSION=\"v${version}\"" "-DENABLE_STRICT=NO" # Disable -Werror + "-DENABLE_UNIT_TESTS=NO" # Do not build test executables ]; NIX_LDFLAGS = "-lXext"; diff --git a/pkgs/development/libraries/mediastreamer/msopenh264.nix b/pkgs/development/libraries/mediastreamer/msopenh264.nix index 17f537b4d87..83a96175cba 100644 --- a/pkgs/development/libraries/mediastreamer/msopenh264.nix +++ b/pkgs/development/libraries/mediastreamer/msopenh264.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-AqZ7tsNZw2Djgyo1JBJbT/c3eQVyEn6r3CT6DQLD/B8="; }; - nativeBuildInputs = [ autoreconfHook cmake pkg-config ]; + nativeBuildInputs = [ cmake ]; buildInputs = [ mediastreamer openh264 ]; # Do not build static libraries