diff options
author | Vladimír Čunát <v@cunat.cz> | 2022-04-28 18:04:16 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2022-04-28 18:04:16 +0200 |
commit | 8caa1418f67e7b49496889e723784e09b028cd3a (patch) | |
tree | c85b0152cbd871f9f7a076e43bda4d44806e65d2 /pkgs/applications/networking/instant-messengers/linphone | |
parent | 51554cbbdbe6086da3b31fb803e9d725647052c3 (diff) | |
parent | 0cd6f99f9506e31044a320a8223b59a81323d940 (diff) |
Merge branch 'master' into staging-next-2022-04-23
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/linphone')
4 files changed, 129 insertions, 48 deletions
diff --git a/pkgs/applications/networking/instant-messengers/linphone/default.nix b/pkgs/applications/networking/instant-messengers/linphone/default.nix index f719cc91bd6de..3b11f7fc1a89a 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/default.nix @@ -48,9 +48,25 @@ , zlib }: +# How to update Linphone? (The Qt desktop app) +# +# Belledonne Communications (BC), the company making Linphone, has split the +# project into several sub-projects that they maintain, plus some third-party +# dependencies that they also extend with commits of their own, specific to +# Linphone and not (yet?) upstreamed. +# +# All of this is organised in a Software Development Kit (SDK) meta-repository +# with git submodules to pin all those repositories into a coherent whole. +# +# The Linphone Qt desktop app uses this SDK as submodule as well. +# +# So, in order to update the desktop app to a new release, one has to follow +# the submodule chain and update the corresponding derivations here, in nixpkgs, +# with the corresponding version number (or commit hash) + mkDerivation rec { pname = "linphone-desktop"; - version = "4.2.5"; + version = "4.4.1"; src = fetchFromGitLab { domain = "gitlab.linphone.org"; @@ -58,12 +74,13 @@ mkDerivation rec { group = "BC"; repo = pname; rev = version; - sha256 = "1gq4l9p21rbrcksa7fbkzn9fzbbynqmn6ni6lhnvzk359sb1xvbz"; + sha256 = "sha256-BBOTyKMZikkxMJSmzAuChVHpVeCvbAimn1K3REGbqEg="; }; patches = [ ./do-not-build-linphone-sdk.patch ./remove-bc_compute_full_version-usage.patch + ./no-store-path-in-autostart.patch ]; # See: https://gitlab.linphone.org/BC/public/linphone-desktop/issues/21 @@ -77,12 +94,21 @@ mkDerivation rec { # there might be some build inputs here that aren't needed for # 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 @@ -91,19 +117,14 @@ mkDerivation rec { gtk2 libX11 libexosip - liblinphone - libmatroska libnotify libosip libsoup libupnp libxml2 mbedtls - mediastreamer - mediastreamer-openh264 minizip2 openldap - ortp pango qtbase qtgraphicaleffects @@ -117,7 +138,9 @@ mkDerivation rec { ]; nativeBuildInputs = [ + # Made by BC bcunit + cmake graphviz intltool @@ -126,7 +149,6 @@ mkDerivation rec { ]; cmakeFlags = [ - "-DCMAKE_BUILD_TYPE=RelWithDebInfo" "-DMINIZIP_INCLUDE_DIRS=${minizip2}/include" "-DMINIZIP_LIBRARIES=minizip" ]; @@ -160,18 +182,25 @@ mkDerivation rec { # Linphone will randomly crash when it tries to access those files. Then, # those just need to be copied manually below. installPhase = '' - mkdir -p $out/bin + mkdir -p $out/bin $out/lib cp linphone-app/linphone $out/bin/ + cp linphone-app/libapp-plugin.so $out/lib/ + mkdir -p $out/lib/mediastreamer/plugins + ln -s ${mediastreamer-openh264}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/ + ln -s ${mediastreamer}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/ wrapProgram $out/bin/linphone \ --set MEDIASTREAMER_PLUGINS_DIR \ - ${mediastreamer-openh264}/lib/mediastreamer/plugins + $out/lib/mediastreamer/plugins mkdir -p $out/share/applications cp linphone-app/linphone.desktop $out/share/applications/ - cp -r ../linphone-app/assets/icons $out/share/ + mkdir -p $out/share/icons/hicolor/scalable/apps + cp ../linphone-app/assets/images/linphone_logo.svg $out/share/icons/hicolor/scalable/apps/linphone.svg mkdir -p $out/share/belr/grammars ln -s ${liblinphone}/share/belr/grammars/* $out/share/belr/grammars/ + ln -s ${belle-sip}/share/belr/grammars/* $out/share/belr/grammars/ mkdir -p $out/share/linphone ln -s ${liblinphone}/share/linphone/* $out/share/linphone/ + ln -s ${liblinphone}/share/sounds $out/share/sounds ''; meta = with lib; { diff --git a/pkgs/applications/networking/instant-messengers/linphone/do-not-build-linphone-sdk.patch b/pkgs/applications/networking/instant-messengers/linphone/do-not-build-linphone-sdk.patch index fe774a479fac2..dc635b32a0312 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/do-not-build-linphone-sdk.patch +++ b/pkgs/applications/networking/instant-messengers/linphone/do-not-build-linphone-sdk.patch @@ -1,30 +1,31 @@ -From 08b8b1811a1ad079fa713d19a8cc6bf2dc782bb7 Mon Sep 17 00:00:00 2001 -From: David P <megver83@parabola.nu> -Date: Thu, 26 Nov 2020 15:56:30 -0300 -Subject: [PATCH 1/2] do not build linphone-sdk +From e6a9992461f368d08d1ad63ffe454714ec0c59ce Mon Sep 17 00:00:00 2001 +From: Lorenz Brun <lorenz@brun.one> +Date: Fri, 28 Jan 2022 02:36:01 +0100 +Subject: [PATCH] Remove Linphone SDK build -Signed-off-by: David P <megver83@parabola.nu> --- - CMakeLists.txt | 61 +------------------ - .../cmake_builder/additional_steps.cmake | 9 --- - 2 files changed, 3 insertions(+), 67 deletions(-) + CMakeLists.txt | 86 ++----------------- + .../cmake_builder/additional_steps.cmake | 9 -- + 2 files changed, 5 insertions(+), 90 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index f7eb05f2..5921ee5b 100644 +index 2002b925..6d92a8e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -118,7 +118,6 @@ list(APPEND APP_OPTIONS "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}") - +@@ -152,7 +152,6 @@ list(APPEND APP_OPTIONS "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}") list(APPEND APP_OPTIONS "-DLINPHONE_OUTPUT_DIR=${LINPHONE_OUTPUT_DIR}") + list(APPEND APP_OPTIONS "-DENABLE_QT_GL=${ENABLE_VIDEO}")#Activate on video -include(ExternalProject) set(PROJECT_BUILD_COMMAND "") if(CMAKE_BUILD_PARALLEL_LEVEL) list(APPEND APP_OPTIONS "-DCMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}") -@@ -136,29 +135,8 @@ if(UNIX AND NOT APPLE) - set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib:${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") - list(APPEND APP_OPTIONS "-DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}") +@@ -190,30 +189,8 @@ if(ENABLE_BUILD_APP_PLUGINS) + endif() endif() + +- +-if(NOT LINPHONE_QT_ONLY) -ExternalProject_Add(sdk PREFIX "${CMAKE_BINARY_DIR}/sdk" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-sdk" - INSTALL_DIR "${LINPHONE_OUTPUT_DIR}" @@ -35,7 +36,7 @@ index f7eb05f2..5921ee5b 100644 - INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -- #BUILD_ALWAYS NO #${DO_BUILD} +- BUILD_ALWAYS NO #${DO_BUILD} -) -ExternalProject_Add_Step(sdk force_build - COMMENT "Forcing build for 'desktop'" @@ -43,18 +44,17 @@ index f7eb05f2..5921ee5b 100644 - DEPENDERS build - ALWAYS 1 -) +-endif() include(FindPkgConfig) -set(APP_DEPENDS sdk) -- -- - find_package(Qt5 5.12 COMPONENTS Core REQUIRED) + find_package(Qt5 5.10 COMPONENTS Core REQUIRED) if ( NOT Qt5_FOUND ) -@@ -173,39 +151,6 @@ find_package(Mediastreamer2 CONFIG QUIET) +@@ -227,62 +204,9 @@ find_package(belcard CONFIG QUIET) + find_package(Mediastreamer2 CONFIG QUIET) find_package(ortp CONFIG QUIET) - -if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) OR FORCE_APP_EXTERNAL_PROJECTS) - message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target install") - ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphone-app" @@ -63,23 +63,51 @@ index f7eb05f2..5921ee5b 100644 - BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" - DEPENDS ${APP_DEPENDS} - BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} -- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step will not be done by external project" +- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} - # ${APP_OPTIONS} - BUILD_ALWAYS ON - ) +- if( ENABLE_BUILD_APP_PLUGINS) +- ExternalProject_Add(app-plugins PREFIX "${CMAKE_BINARY_DIR}/plugins-app" +- SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins" +- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" +- BINARY_DIR "${CMAKE_BINARY_DIR}/plugins-app" +- DEPENDS linphone-qt +- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} +- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." +- LIST_SEPARATOR | # Use the alternate list separator +- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +- ) +- endif() - install(CODE "message(STATUS Running install)") - set(AUTO_REGENERATION auto_regeneration) -- add_custom_target(${AUTO_REGENERATION} ALL -- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -- DEPENDS linphone-qt) +- if( ENABLE_BUILD_APP_PLUGINS) +- add_custom_target(${AUTO_REGENERATION} ALL +- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} +- DEPENDS app-plugins) +- else() +- add_custom_target(${AUTO_REGENERATION} ALL +- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} +- DEPENDS linphone-qt) +- endif() -else() - message("Adding Linphone Desktop in an IDE-friendly state") - set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") - add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) -- add_dependencies(app-library ${APP_DEPENDS}) --endif() +- if(NOT LINPHONE_QT_ONLY) +- add_dependencies(app-library ${APP_DEPENDS}) +- endif() +- if( ENABLE_BUILD_APP_PLUGINS) +- add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app") +- endif() ++message("Adding Linphone Desktop in an IDE-friendly state") ++set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") ++add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) ++if( ENABLE_BUILD_APP_PLUGINS) ++ add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app") + endif() -ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" - INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" @@ -89,11 +117,8 @@ index f7eb05f2..5921ee5b 100644 - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} - EXCLUDE_FROM_ALL ON -- BUILD_ALWAYS ON +- #BUILD_ALWAYS ON -) -+message("Adding Linphone Desktop in an IDE-friendly state") -+set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") -+add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) diff --git a/linphone-app/cmake_builder/additional_steps.cmake b/linphone-app/cmake_builder/additional_steps.cmake index 7f7fd573..a69a04e8 100644 --- a/linphone-app/cmake_builder/additional_steps.cmake @@ -114,5 +139,5 @@ index 7f7fd573..a69a04e8 100644 endif () endif () -- -2.29.2 +2.25.1 diff --git a/pkgs/applications/networking/instant-messengers/linphone/no-store-path-in-autostart.patch b/pkgs/applications/networking/instant-messengers/linphone/no-store-path-in-autostart.patch new file mode 100644 index 0000000000000..dc1b0be916cdf --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/linphone/no-store-path-in-autostart.patch @@ -0,0 +1,27 @@ +From 6a26922e5e4363de36057d635a1bf889160b2533 Mon Sep 17 00:00:00 2001 +From: Lorenz Brun <lorenz@brun.one> +Date: Fri, 28 Jan 2022 18:44:43 +0100 +Subject: [PATCH] Do not use store path for autostart on Nix + +--- + linphone-app/src/app/App.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp +index 868f8f44..2c61c648 100644 +--- a/linphone-app/src/app/App.cpp ++++ b/linphone-app/src/app/App.cpp +@@ -858,6 +858,10 @@ void App::setAutoStart (bool enabled) { + exec = QProcessEnvironment::systemEnvironment().value(QStringLiteral("APPIMAGE")); + qDebug() << "exec path autostart set appimage=" << exec; + } ++ else if (binPath.startsWith("/nix/store")) { // Nix/NixOS ++ exec = QStringLiteral("linphone"); ++ qDebug() << "exec path autostart set nix=" << exec; ++ } + else { //classic package + exec = binPath; + qDebug() << "exec path autostart set classic package=" << exec; +-- +2.25.1 + diff --git a/pkgs/applications/networking/instant-messengers/linphone/remove-bc_compute_full_version-usage.patch b/pkgs/applications/networking/instant-messengers/linphone/remove-bc_compute_full_version-usage.patch index 547652d3af7fb..225f0e78db233 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/remove-bc_compute_full_version-usage.patch +++ b/pkgs/applications/networking/instant-messengers/linphone/remove-bc_compute_full_version-usage.patch @@ -1,7 +1,7 @@ -From 6fc23da651d54979e73776fcda38614e290d65dc Mon Sep 17 00:00:00 2001 +From 4849d5633b98e6d3514355436eab5ba537cbfd99 Mon Sep 17 00:00:00 2001 From: David P <megver83@parabola.nu> Date: Fri, 23 Oct 2020 16:44:17 -0300 -Subject: [PATCH 2/2] remove bc_compute_full_version usage +Subject: [PATCH] remove bc_compute_full_version usage --- linphone-app/CMakeLists.txt | 11 +---------- @@ -10,7 +10,7 @@ Subject: [PATCH 2/2] remove bc_compute_full_version usage 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt -index 3bc9420a..27b418ee 100644 +index de7f917f..ee14ff78 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -21,17 +21,8 @@ @@ -30,8 +30,8 @@ index 3bc9420a..27b418ee 100644 - -project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}") + if(ENABLE_BUILD_VERBOSE) - #message("CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}") diff --git a/linphone-app/build/CMakeLists.txt b/linphone-app/build/CMakeLists.txt index 8ef03faa..97d94bd6 100644 --- a/linphone-app/build/CMakeLists.txt @@ -49,7 +49,7 @@ index 8ef03faa..97d94bd6 100644 set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) diff --git a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt -index baea03cf..08ffc1b5 100644 +index ac85c68a..e6af5a66 100644 --- a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt +++ b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt @@ -38,15 +38,7 @@ set(LINPHONE_QML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../ui") @@ -70,5 +70,5 @@ index baea03cf..08ffc1b5 100644 endif () string(REGEX REPLACE "([0-9.]+)-?.*" "\\1" LINPHONE_VERSION "${APP_PROJECT_VERSION}") -- -2.29.2 +2.25.1 |