diff --git a/pkgs/applications/networking/instant-messengers/linphone/default.nix b/pkgs/applications/networking/instant-messengers/linphone/default.nix index 6b6eb8ff58f3..814437cdac2a 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/default.nix @@ -8,8 +8,8 @@ makeScopeWithSplicing' { extra = self: { mkLinphoneDerivation = self.mk-linphone-derivation; - linphoneSdkVersion = "5.4.48"; - linphoneSdkHash = "sha256-sOkq73YWbhpKJOk1dVc4tkg2+RuGyRK8/t4ckMIVVG8="; + linphoneSdkVersion = "5.4.85"; + linphoneSdkHash = "sha256-mdJDCuCaZlcQ92P6oMgH/8iWgm8hGz8gTVUilC+yaSU="; }; f = self: diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/always-install-desktop-files.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/always-install-desktop-files.patch new file mode 100644 index 000000000000..ab7300320148 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/always-install-desktop-files.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/install/install.cmake b/cmake/install/install.cmake +index 710e8fa31..636e3cff4 100644 +--- a/cmake/install/install.cmake ++++ b/cmake/install/install.cmake +@@ -325,3 +325,11 @@ if(${ENABLE_APP_PACKAGING}) + endif() + include(CPack) + endif() ++ ++configure_file("${CMAKE_SOURCE_DIR}/cmake/install/linux/linphone.desktop.cmake" "${CMAKE_BINARY_DIR}/cmake/install/linux/${EXECUTABLE_NAME}.desktop" @ONLY) ++install(FILES "${CMAKE_BINARY_DIR}/cmake/install/linux/${EXECUTABLE_NAME}.desktop" DESTINATION "${CMAKE_INSTALL_DATADIR}/applications" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) ++install(FILES "${CMAKE_SOURCE_DIR}/Linphone/data/image/logo.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps/" RENAME "${EXECUTABLE_NAME}.svg") ++set(ICON_DIRS 16x16 22x22 24x24 32x32 64x64 128x128 256x256) ++foreach (DIR ${ICON_DIRS}) ++ install(FILES "${CMAKE_SOURCE_DIR}/Linphone/data/icon/hicolor/${DIR}/apps/icon.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${DIR}/apps/" RENAME "${EXECUTABLE_NAME}.png") ++endforeach () + diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/default.nix b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/default.nix index efa510c3aad5..adb2dacb2d5f 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/default.nix @@ -11,13 +11,14 @@ fetchFromGitLab, lib, liblinphone, - libsForQt5, lime, + linphoneSdkVersion, mediastreamer2, minizip-ng, msopenh264, python3, python3Packages, + qt6Packages, stdenv, symlinkJoin, xercesc, @@ -39,23 +40,21 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "linphone-desktop"; - version = "5.3.1"; + version = "6.1.0"; src = fetchFromGitLab { domain = "gitlab.linphone.org"; owner = "public"; group = "BC"; repo = "linphone-desktop"; - rev = finalAttrs.version; - hash = "sha256-TO9JNsOnx4sTJEkai0nDKNyZWcLuGoWfuKLBM79tQvs="; + tag = finalAttrs.version; + hash = "sha256-jCnovCFdPJExD0+ZLhU9np1R5uN+mPlSPi/Nb1aOD0U="; }; patches = [ - ./require-finding-packages.patch - ./remove-bc-versions.patch ./do-not-override-install-prefix.patch - ./fix-translation-dirs.patch - ./unset-qml-dir.patch + ./do-not-manually-compute-sdk-version.patch + ./always-install-desktop-files.patch # .mkv recordings are broken in NixOS and other distros (see # https://github.com/NixOS/nixpkgs/issues/219551), and simply changing the @@ -67,7 +66,6 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ # Made by BC bctoolbox - belcard belle-sip belr liblinphone @@ -79,9 +77,8 @@ stdenv.mkDerivation (finalAttrs: { xercesc minizip-ng - libsForQt5.qtgraphicaleffects - libsForQt5.qtmultimedia - libsForQt5.qtquickcontrols2 + qt6Packages.qtbase + qt6Packages.qtnetworkauth zxing-cpp boost @@ -91,8 +88,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake - libsForQt5.qttools - libsForQt5.wrapQtAppsHook + qt6Packages.qttools + qt6Packages.wrapQtAppsHook python3 doxygen ]; @@ -115,18 +112,26 @@ stdenv.mkDerivation (finalAttrs: { "-DLINPHONEAPP_VERSION=${finalAttrs.version}" "-DLINPHONE_QT_ONLY=ON" "-DLINPHONEAPP_INSTALL_PREFIX=${placeholder "out"}" - "-DLINPHONE_QML_DIR=${placeholder "out"}/${libsForQt5.qtbase.qtQmlPrefix}/ui" + "-DLINPHONE_QML_DIR=${placeholder "out"}/${qt6Packages.qtbase.qtQmlPrefix}/ui" + "-DLINPHONESDK_VERSION=${linphoneSdkVersion}" + "-DENABLE_APP_PACKAGE_ROOTCA=OFF" # normally set by the custom find modules, which we have disabled "-DLibLinphone_TARGET=liblinphone" "-DLinphoneCxx_TARGET=liblinphone++" "-DISpell_SOURCE_DIR=${bc-ispell.src}" + + # used in Linphone's CMakeLists.txt + "-DLINPHONEAPP_VERSION=${finalAttrs.version}" ]; + # error: invalid conversion from 'int' to 'const char*' + env.NIX_CFLAGS_COMPILE = "-fpermissive"; + preConfigure = '' # custom "find" modules are causing issues during build, # as they are blinding cmake to nix dependencies - rm -rf linphone-app/cmake + rm -rf cmake/Modules ''; preInstall = '' diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/do-not-manually-compute-sdk-version.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/do-not-manually-compute-sdk-version.patch new file mode 100644 index 000000000000..59166e610cb1 --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/do-not-manually-compute-sdk-version.patch @@ -0,0 +1,20 @@ +diff --git a/Linphone/CMakeLists.txt b/Linphone/CMakeLists.txt +index 776fd415a..8fa2d3ab6 100644 +--- a/Linphone/CMakeLists.txt ++++ b/Linphone/CMakeLists.txt +@@ -71,14 +71,6 @@ execute_process( + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + +-set(LINPHONESDK_VERSION) +-execute_process( +- COMMAND git describe +- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/external/linphone-sdk +- OUTPUT_VARIABLE LINPHONESDK_VERSION +- OUTPUT_STRIP_TRAILING_WHITESPACE +-) +- + include(application_info.cmake) + string(TIMESTAMP CURRENT_YEAR "%Y") + if(NOT APPLICATION_START_LICENCE OR "${CURRENT_YEAR}" STREQUAL "${APPLICATION_START_LICENCE}") + diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/do-not-override-install-prefix.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/do-not-override-install-prefix.patch index fced960ba7fb..10c993251270 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/do-not-override-install-prefix.patch +++ b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/do-not-override-install-prefix.patch @@ -1,16 +1,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 312df041d..43500be48 100644 +index 793a4bb15..446d5b721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -116,11 +116,6 @@ endif () +@@ -117,10 +117,6 @@ endif () #------------------------------------------------------------------------------ # Prepare gobal CMAKE configuration specific to the current project - + set(CMAKE_POSITION_INDEPENDENT_CODE ON)#Needed for Qt -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/OUTPUT" CACHE PATH "Default linphone-app installation prefix" FORCE) - set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE) -endif() -- + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified") - set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE) diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/fix-translation-dirs.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/fix-translation-dirs.patch deleted file mode 100644 index 9d2609d9dd8b..000000000000 --- a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/fix-translation-dirs.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/linphone-app/assets/languages/CMakeLists.txt b/linphone-app/assets/languages/CMakeLists.txt -index ffe2b6a5b..12f02bdfe 100644 ---- a/linphone-app/assets/languages/CMakeLists.txt -+++ b/linphone-app/assets/languages/CMakeLists.txt -@@ -32,8 +32,8 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${I18N_FILENAME}" "${I18N_CONTENT}") - - #Files or directories to inspect for translations references - set(TRANSLATION_SOURCES) --list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/src") --list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/ui") -+list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/linphone-app/src") -+list(APPEND TRANSLATION_SOURCES "${PROJECT_SOURCE_DIR}/linphone-app/ui") - - if (WIN32) - foreach (lang ${LANGUAGES}) diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/record-in-wav-format.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/record-in-wav-format.patch index 1e71073968f1..b32a05f3257e 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/record-in-wav-format.patch +++ b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/record-in-wav-format.patch @@ -1,48 +1,39 @@ -diff --git a/linphone-app/src/components/call/CallModel.cpp b/linphone-app/src/components/call/CallModel.cpp -index d0286a89a..483bc35e4 100644 ---- a/linphone-app/src/components/call/CallModel.cpp -+++ b/linphone-app/src/components/call/CallModel.cpp -@@ -289,7 +289,7 @@ void CallModel::setRecordFile (const shared_ptr &callParam - callParams->setRecordFile(Utils::appStringToCoreString( - CoreManager::getInstance()->getSettingsModel()->getSavedCallsFolder() - .append(generateSavedFilename()) -- .append(".mkv") -+ .append(".wav") - )); - } - -@@ -303,7 +303,7 @@ void CallModel::setRecordFile (const shared_ptr &callParam - callParams->setRecordFile(Utils::appStringToCoreString( - CoreManager::getInstance()->getSettingsModel()->getSavedCallsFolder() - .append(generateSavedFilename(from, to)) -- .append(".mkv") -+ .append(".wav") - )); - } - -diff --git a/linphone-app/src/components/conference/ConferenceProxyModel.cpp b/linphone-app/src/components/conference/ConferenceProxyModel.cpp -index 0cf654dd4..931c0e5cf 100644 ---- a/linphone-app/src/components/conference/ConferenceProxyModel.cpp -+++ b/linphone-app/src/components/conference/ConferenceProxyModel.cpp -@@ -84,7 +84,7 @@ void ConferenceProxyModel::startRecording () { - - - mLastRecordFile = -- QStringLiteral("%1%2.mkv") -+ QStringLiteral("%1%2.wav") - .arg(coreManager->getSettingsModel()->getSavedCallsFolder()) - .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss")); - conference->startRecording(Utils::appStringToCoreString(mLastRecordFile) ); -diff --git a/linphone-app/src/components/recorder/RecorderModel.cpp b/linphone-app/src/components/recorder/RecorderModel.cpp -index 0d17ff6f8..5c6d7c679 100644 ---- a/linphone-app/src/components/recorder/RecorderModel.cpp -+++ b/linphone-app/src/components/recorder/RecorderModel.cpp -@@ -83,7 +83,7 @@ QDateTime RecorderModel::getDateTimeSavedFilename(const QString& filename){ - - void RecorderModel::start(){ +diff --git a/Linphone/model/call/CallModel.cpp b/Linphone/model/call/CallModel.cpp +index 366bbe86f..7bac43ad5 100644 +--- a/Linphone/model/call/CallModel.cpp ++++ b/Linphone/model/call/CallModel.cpp +@@ -56,7 +56,7 @@ void CallModel::accept(bool withVideo) { + params->setRecordFile( + Paths::getCapturesDirPath() + .append(Utils::generateSavedFilename(QString::fromStdString(mMonitor->getToAddress()->getUsername()), "")) +- .append(".mkv") ++ .append(".wav") + .toStdString()); + // Answer with local call address. + auto localAddress = mMonitor->getCallLog()->getLocalAddress(); +diff --git a/Linphone/model/recorder/RecorderModel.cpp b/Linphone/model/recorder/RecorderModel.cpp +index 7883ed150..1b1820620 100644 +--- a/Linphone/model/recorder/RecorderModel.cpp ++++ b/Linphone/model/recorder/RecorderModel.cpp +@@ -82,7 +82,7 @@ void RecorderModel::start() { + mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); bool soFarSoGood; -- QString filename = QStringLiteral("vocal_%1.mkv") -+ QString filename = QStringLiteral("vocal_%1.wav") - .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss-zzz")); + QString filename = +- QStringLiteral("vocal_%1.mka").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss-zzz")); ++ QStringLiteral("vocal_%1.wav").arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss-zzz")); const QString safeFilePath = Utils::getSafeFilePath( - QStringLiteral("%1%2") + QStringLiteral("%1%2").arg(SettingsModel::getInstance()->getSavedCallsFolder()).arg(filename), &soFarSoGood); + +diff --git a/Linphone/model/tool/ToolModel.cpp b/Linphone/model/tool/ToolModel.cpp +index 18edeca7c..70c88516f 100644 +--- a/Linphone/model/tool/ToolModel.cpp ++++ b/Linphone/model/tool/ToolModel.cpp +@@ -353,7 +353,7 @@ bool ToolModel::createCall(const QString &sipAddress, + params->setRecordFile( + Paths::getCapturesDirPath() + .append(Utils::generateSavedFilename(QString::fromStdString(address->getUsername()), "")) +- .append(".mkv") ++ .append(".wav") + .toStdString()); + } + diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/remove-bc-versions.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/remove-bc-versions.patch deleted file mode 100644 index a1f8642b9979..000000000000 --- a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/remove-bc-versions.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt -index d40842fa2..7d7bc57d8 100644 ---- a/linphone-app/CMakeLists.txt -+++ b/linphone-app/CMakeLists.txt -@@ -40,10 +40,8 @@ set(version_minor) - set(version_patch) - set(identifiers ) - set(metadata ) --bc_parse_full_version("${LINPHONEAPP_VERSION}" version_major version_minor version_patch identifiers metadata) - - --project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}") - - if(ENABLE_BUILD_VERBOSE) - #message("CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}") diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/require-finding-packages.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/require-finding-packages.patch deleted file mode 100644 index 2efcb4a9d2fb..000000000000 --- a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/require-finding-packages.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt -index d40842fa2..5ea1330ca 100644 ---- a/linphone-app/CMakeLists.txt -+++ b/linphone-app/CMakeLists.txt -@@ -24,14 +24,11 @@ cmake_minimum_required(VERSION 3.22) - - - #Linphone targets --set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 Belcard LibLinphone) -+set(LINPHONE_PACKAGES LinphoneCxx Mediastreamer2 BelCard LibLinphone) - - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") - --find_package(BCToolbox) --if(NOT BCToolbox_FOUND) -- find_package(bctoolbox CONFIG REQUIRED) --endif() -+find_package(BCToolbox REQUIRED) - if(NOT LINPHONEAPP_VERSION) - bc_compute_full_version(LINPHONEAPP_VERSION) - endif() -@@ -105,17 +102,14 @@ set(ENABLE_DB_STORAGE ON CACHE BOOLEAN "Enable Storage") - - foreach(PACKAGE ${LINPHONE_PACKAGES}) - message(STATUS "Trying to find ${PACKAGE}") -- find_package(${PACKAGE}) -- if(NOT ${PACKAGE}_FOUND) -- find_package(${PACKAGE} CONFIG REQUIRED) -- endif() -+ find_package(${PACKAGE} REQUIRED) - endforeach() - - set(PLUGIN_TARGETS ${LinphoneCxx_TARGET}) - set(APP_TARGETS ${LinphoneCxx_TARGET} - ${BCToolbox_TARGET}#Logger/App - ${Mediastreamer2_TARGET}#MediastreamerUtils -- ${Belcard_TARGET}#VCard Model -+ ${BelCard_TARGET}#VCard Model - ${LibLinphone_TARGET})#MediastreamerUtils - - #################################### diff --git a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/unset-qml-dir.patch b/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/unset-qml-dir.patch deleted file mode 100644 index 3d559f2d871c..000000000000 --- a/pkgs/applications/networking/instant-messengers/linphone/linphone-desktop/unset-qml-dir.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt -index d40842fa2..112d45711 100644 ---- a/linphone-app/CMakeLists.txt -+++ b/linphone-app/CMakeLists.txt -@@ -54,7 +54,6 @@ include(CheckCXXCompilerFlag) - - - set(TARGET_NAME linphone-qt) --set(LINPHONE_QML_DIR "WORK/qml_files/ui") - set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS true) - set(CMAKE_CXX_STANDARD 14) - - diff --git a/pkgs/applications/networking/instant-messengers/linphone/mediastreamer2/default.nix b/pkgs/applications/networking/instant-messengers/linphone/mediastreamer2/default.nix index 4f8affb14418..0ed276b28b89 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/mediastreamer2/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/mediastreamer2/default.nix @@ -9,7 +9,7 @@ libxext, libopus, libpulseaudio, - libsForQt5, + qt6Packages, libv4l, libvpx, mkLinphoneDerivation, @@ -35,8 +35,8 @@ mkLinphoneDerivation (finalAttrs: { nativeBuildInputs = [ python3 - libsForQt5.qtbase - libsForQt5.qtdeclarative + qt6Packages.qtbase + qt6Packages.qtdeclarative ]; propagatedBuildInputs = [ diff --git a/pkgs/applications/networking/instant-messengers/linphone/mk-linphone-derivation/default.nix b/pkgs/applications/networking/instant-messengers/linphone/mk-linphone-derivation/default.nix index 8382fef530ac..81b8e9e05279 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/mk-linphone-derivation/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/mk-linphone-derivation/default.nix @@ -1,11 +1,38 @@ { stdenv, - fetchFromGitLab, + fetchFromGitHub, lib, cmake, linphoneSdkVersion, linphoneSdkHash, }: +let + # linphone-sdk is hosted on BC's Gitlab instance, however since it imposes + # a heavy rate limit / throttling when attempting to fetch submodules, we use their + # GitHub mirror instead. + src = fetchFromGitHub { + owner = "BelledonneCommunications"; + repo = "linphone-sdk"; + tag = linphoneSdkVersion; + hash = linphoneSdkHash; + leaveDotGit = true; + postFetch = '' + cd $out + git remote add origin https://github.com/BelledonneCommunications/linphone-sdk.git + git reset --hard HEAD + # `external` submodules are hardcoded to resolve to BC's Gitlab instance, + # however, since we manually package all required external modules anyway, + # we do not need to also fetch them here. + # + # We also use `--jobs 1` to avoid hitting BC's rate limit for the handful of + # hardcoded submodules that we _do_ need. + for submodule in $(git config --file .gitmodules --get-regexp path | awk '{print $2}' | grep -v '^external/.*$'); do + git submodule update --init --recursive --jobs 1 "$submodule" + done + find "$out" -name .git -type d -print0 | xargs -0 rm -rf + ''; + }; +in lib.extendMkDerivation { constructDrv = stdenv.mkDerivation; @@ -25,15 +52,7 @@ lib.extendMkDerivation { { version = linphoneSdkVersion; - src = fetchFromGitLab { - domain = "gitlab.linphone.org"; - owner = "public"; - group = "BC"; - repo = "linphone-sdk"; - tag = linphoneSdkVersion; - hash = linphoneSdkHash; - fetchSubmodules = true; - }; + inherit src; nativeBuildInputs = [ cmake