diff options
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/ispell-for-linphone-cmake.patch | 43 | ||||
-rw-r--r-- | gnu/packages/patches/liblinphone-jsoncpp.patch | 82 | ||||
-rw-r--r-- | gnu/packages/patches/linphone-desktop-cmake-belcard.patch | 39 | ||||
-rw-r--r-- | gnu/packages/patches/linphone-desktop-cmake-find-modules.patch | 422 | ||||
-rw-r--r-- | gnu/packages/patches/linphone-desktop-ispell.patch | 24 | ||||
-rw-r--r-- | gnu/packages/patches/linphone-desktop-qtkeychain.patch | 36 | ||||
-rw-r--r-- | gnu/packages/patches/linphone-desktop-without-sdk.patch | 214 | ||||
-rw-r--r-- | gnu/packages/patches/linuxdcpp-openssl-1.1.patch | 26 | ||||
-rw-r--r-- | gnu/packages/patches/mediastreamer2-cmake-findgsm.patch | 63 | ||||
-rw-r--r-- | gnu/packages/patches/mswebrtc-b64-refactor.patch | 949 | ||||
-rw-r--r-- | gnu/packages/patches/mswebrtc-cmake.patch | 626 | ||||
-rw-r--r-- | gnu/packages/patches/nyacc-binary-literals.patch | 29 | ||||
-rw-r--r-- | gnu/packages/patches/soci-mysql-ddl-types.patch | 15 | ||||
-rw-r--r-- | gnu/packages/patches/zig-0.15-fix-runpath.patch | 122 |
14 files changed, 2421 insertions, 269 deletions
diff --git a/gnu/packages/patches/ispell-for-linphone-cmake.patch b/gnu/packages/patches/ispell-for-linphone-cmake.patch new file mode 100644 index 0000000000..6785ca4b7e --- /dev/null +++ b/gnu/packages/patches/ispell-for-linphone-cmake.patch @@ -0,0 +1,43 @@ +Retrieved from: https://git.pld-linux.org/?p=packages/bc-ispell.git;a=blob_plain;f=ispell-cmake.patch;hb=HEAD + +--- ispell-05574fe160222c3d0b6283c1433c9b087271fad1/CMakeLists.txt.orig 2023-11-07 11:53:37.000000000 +0100 ++++ ispell-05574fe160222c3d0b6283c1433c9b087271fad1/CMakeLists.txt 2024-03-28 20:53:45.068632010 +0100 +@@ -49,6 +49,26 @@ set(ISPELL_SOURCES + + add_library(${ISPELL_TARGET_NAME} SHARED ${ISPELL_SOURCES}) + ++set(CMAKE_MODULES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${ISPELL_TARGET_NAME}") ++configure_package_config_file("${ISPELL_TARGET_NAME}Config.cmake.in" "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake" ++ INSTALL_DESTINATION "${CMAKE_MODULES_INSTALL_DIR}" ++ NO_SET_AND_CHECK_MACRO ++) ++write_basic_package_version_file("${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}ConfigVersion.cmake" ++ VERSION ${PROJECT_VERSION} ++ COMPATIBILITY AnyNewerVersion ++) ++install(FILES ++ "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}Config.cmake" ++ "${PROJECT_BINARY_DIR}/${ISPELL_TARGET_NAME}ConfigVersion.cmake" ++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR} ++) ++ ++install(EXPORT ${ISPELL_TARGET_NAME}LibraryDepends ++ FILE "${ISPELL_TARGET_NAME}LibraryDepends.cmake" ++ DESTINATION ${CMAKE_MODULES_INSTALL_DIR} ++) ++ + install(TARGETS ${ISPELL_TARGET_NAME} + EXPORT ${ISPELL_TARGET_NAME}LibraryDepends + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +--- ispell-05574fe160222c3d0b6283c1433c9b087271fad1/ISpellConfig.cmake.in.orig 2023-11-07 11:53:37.000000000 +0100 ++++ ispell-05574fe160222c3d0b6283c1433c9b087271fad1/ISpellConfig.cmake.in 2024-03-28 21:54:40.692161132 +0100 +@@ -12,7 +12,7 @@ set(ISPELL_LIBRARIES "@ISPELL_TARGET_NAM + get_target_property(ISPELL_INCLUDE_DIRS "@ISPELL_TARGET_NAME@" INTERFACE_INCLUDE_DIRECTORIES) + + if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.18.0) +- add_library(@ISpell_TARGET_NAME@::@ISpell_TARGET_NAME@ ALIAS @ISpell_TARGET_NAME@) ++ add_library(@ISPELL_TARGET_NAME@::@ISPELL_TARGET_NAME@ ALIAS @ISPELL_TARGET_NAME@) + endif() + +-check_required_components(@ISpell_TARGET_NAME@) ++check_required_components(@ISPELL_TARGET_NAME@) diff --git a/gnu/packages/patches/liblinphone-jsoncpp.patch b/gnu/packages/patches/liblinphone-jsoncpp.patch new file mode 100644 index 0000000000..d012b07870 --- /dev/null +++ b/gnu/packages/patches/liblinphone-jsoncpp.patch @@ -0,0 +1,82 @@ +diff --git a/cmake/FindJsonCPP.cmake b/cmake/FindJsonCPP.cmake +index 59e971a58..18260fde8 100644 +--- a/cmake/FindJsonCPP.cmake ++++ b/cmake/FindJsonCPP.cmake +@@ -39,10 +39,11 @@ + # JsonCPP_FOUND - The jsoncpp library has been found + # JsonCPP_TARGET - The name of the CMake target for the jsoncpp library + ++if(TARGET jsoncpp_lib OR TARGET jsoncpp_static OR TARGET PkgConfig::jsoncpp) + +-if(TARGET jsoncpp_lib OR TARGET jsoncpp_static) +- +- if(TARGET jsoncpp_lib) ++ if(TARGET PkgConfig::jsoncpp) ++ set(JsonCPP_TARGET PkgConfig::jsoncpp) ++ elseif(TARGET jsoncpp_lib) + set(JsonCPP_TARGET jsoncpp_lib) + else() + set(JsonCPP_TARGET jsoncpp_static) +@@ -57,24 +58,50 @@ if(TARGET jsoncpp_lib OR TARGET jsoncpp_static) + mark_as_advanced(JsonCPP_TARGET) + + else() +- +- set(_OPTIONS "CONFIG") ++ find_package(PkgConfig QUIET) ++ ++ set(_OPTIONS1 "CONFIG") ++ set(_OPTIONS2 "IMPORTED_TARGET") # for pkg_check_modules fallback ++ + if(JsonCPP_FIND_REQUIRED) +- list(APPEND _OPTIONS "REQUIRED") +- endif() +- if(JsonCPP_FIND_QUIETLY) +- list(APPEND _OPTIONS "QUIET") ++ if(PKG_CONFIG_FOUND) ++ list(APPEND _OPTIONS2 "REQUIRED") ++ else() ++ list(APPEND _OPTIONS1 "REQUIRED") ++ endif() + endif() +- if(JsonCPP_FIND_VERSION) +- list(PREPEND _OPTIONS "${jsoncpp_FIND_VERSION}") ++ if(JsonCPP_FIND_QUIETLY) ++ list(APPEND _OPTIONS1 "QUIET") ++ list(APPEND _OPTIONS2 "QUIET") + endif() +- if(JsonCPP_FIND_EXACT) +- list(APPEND _OPTIONS "EXACT") ++ if(PKG_CONFIG_FOUND) ++ if(JsonCPP_FIND_VERSION) ++ if(JsonCPP_FIND_EXACT) ++ list(APPEND _OPTIONS2 "jsoncpp=${JsonCPP_FIND_VERSION}") ++ else() ++ list(APPEND _OPTIONS2 "jsoncpp>=${JsonCPP_FIND_VERSION}") ++ endif() ++ else() ++ list(APPEND _OPTIONS2 "jsoncpp") ++ endif() ++ else() ++ if(JsonCPP_FIND_VERSION) ++ list(PREPEND _OPTIONS1 "${jsoncpp_FIND_VERSION}") ++ endif() ++ if(JsonCPP_FIND_EXACT) ++ list(APPEND _OPTIONS1 "EXACT") ++ endif() + endif() + +- find_package(jsoncpp ${_OPTIONS}) ++ find_package(jsoncpp ${_OPTIONS1}) ++ ++ if(NOT JsonCPP_FOUND) ++ pkg_check_modules(jsoncpp ${_OPTIONS2}) ++ endif() + +- if(TARGET jsoncpp_lib) ++ if(TARGET PkgConfig::jsoncpp) ++ set(JsonCPP_TARGET jsoncpp) ++ elseif(TARGET jsoncpp_lib) + set(JsonCPP_TARGET jsoncpp_lib) + else() + set(JsonCPP_TARGET jsoncpp_static) diff --git a/gnu/packages/patches/linphone-desktop-cmake-belcard.patch b/gnu/packages/patches/linphone-desktop-cmake-belcard.patch new file mode 100644 index 0000000000..3cc573b938 --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-cmake-belcard.patch @@ -0,0 +1,39 @@ +From 0216b81c46f2612b8acf33b1a7c5886db25f45ff Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer <maxim.cournoyer@gmail.com> +Date: Thu, 13 Jun 2024 16:04:29 -0400 +Subject: [PATCH] cmake: Fix BelCard cmake module name. + +* linphone-app/CMakeLists.txt: cmake: Fix BelCard cmake module name. + +Fixes: <https://gitlab.linphone.org/BC/public/linphone-desktop/-/issues/32> +--- + linphone-app/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt +index d40842fa..f1c225a5 100644 +--- a/linphone-app/CMakeLists.txt ++++ b/linphone-app/CMakeLists.txt +@@ -24,7 +24,7 @@ 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") + +@@ -115,7 +115,7 @@ 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 + + #################################### + +base-commit: e34beffe06802efcc5904d5059006ac0d2f7ef32 +-- +2.45.1 + diff --git a/gnu/packages/patches/linphone-desktop-cmake-find-modules.patch b/gnu/packages/patches/linphone-desktop-cmake-find-modules.patch new file mode 100644 index 0000000000..96353eef28 --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-cmake-find-modules.patch @@ -0,0 +1,422 @@ +From 25bdfe9ad3a33e1db6e5db8290b3a5112f4d621e Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer <maxim.cournoyer@gmail.com> +Date: Fri, 14 Jun 2024 22:33:58 -0400 +Subject: [PATCH] cmake: Delete most CMake find modules. + +They do not appear to bring any value compared to the config files +installed by each project, and cause issues like the following, at +least when using system libraries: + + -- Trying to find LibLinphone + CMake Error at linphone-app/cmake/FindLibLinphone.cmake:31 (include): + include could not find requested file: + + LibLinphoneTargets + Call Stack (most recent call first): + linphone-app/CMakeLists.txt:108 (find_package) + +Fixes: <https://gitlab.linphone.org/BC/public/linphone-desktop/-/issues/30> +--- + linphone-app/cmake/FindBCToolbox.cmake | 60 --------------------- + linphone-app/cmake/FindBelcard.cmake | 44 --------------- + linphone-app/cmake/FindISpell.cmake | 47 ---------------- + linphone-app/cmake/FindLibLinphone.cmake | 46 ---------------- + linphone-app/cmake/FindLinphoneCxx.cmake | 45 ---------------- + linphone-app/cmake/FindMediastreamer2.cmake | 49 ----------------- + linphone-app/cmake/FindQtKeychain.cmake | 48 ----------------- + 7 files changed, 339 deletions(-) + delete mode 100644 linphone-app/cmake/FindBCToolbox.cmake + delete mode 100644 linphone-app/cmake/FindBelcard.cmake + delete mode 100644 linphone-app/cmake/FindISpell.cmake + delete mode 100644 linphone-app/cmake/FindLibLinphone.cmake + delete mode 100644 linphone-app/cmake/FindLinphoneCxx.cmake + delete mode 100644 linphone-app/cmake/FindMediastreamer2.cmake + delete mode 100644 linphone-app/cmake/FindQtKeychain.cmake + +diff --git a/linphone-app/cmake/FindBCToolbox.cmake b/linphone-app/cmake/FindBCToolbox.cmake +deleted file mode 100644 +index 707cc147..00000000 +--- a/linphone-app/cmake/FindBCToolbox.cmake ++++ /dev/null +@@ -1,60 +0,0 @@ +-############################################################################ +-# FindBctoolbox.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +- +-# This module will set the following variables in your project: +-# +-# BCToolbox_FOUND - The bctoolbox library has been found +-# BCToolbox_TARGET - The name of the CMake target for the bctoolbox library +-# BCToolbox_CMAKE_DIR - The bctoolbox CMake directory +-# BCToolbox_CMAKE_UTILS - The path to the bctoolbox CMake utils script +-# BCToolbox_tester_FOUND - The bctoolbox-tester library has been found +-# BCToolbox_tester_TARGET - The name of the CMake target for the bctoolbox-tester library +- +- +-if(NOT TARGET bctoolbox) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- set(BCToolbox_CMAKE_DIR ${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/bctoolbox/cmake) +- include(${BCToolbox_CMAKE_DIR}/bctoolboxTargets.cmake) +-endif() +- +-set(_BCToolbox_REQUIRED_VARS BCToolbox_TARGET BCToolbox_CMAKE_DIR BCToolbox_CMAKE_UTILS) +-set(_BCToolbox_CACHE_VARS ${_BCToolbox_REQUIRED_VARS}) +- +-if(TARGET bctoolbox) +- set(BCToolbox_TARGET bctoolbox) +- get_target_property(_BCToolbox_SOURCE_DIR ${BCToolbox_TARGET} SOURCE_DIR) +- set(BCToolbox_CMAKE_DIR "${_BCToolbox_SOURCE_DIR}/../cmake") +- set(BCToolbox_CMAKE_UTILS "${BCToolbox_CMAKE_DIR}/BCToolboxCMakeUtils.cmake") +- if(TARGET bctoolbox-tester) +- set(BCToolbox_tester_FOUND TRUE) +- set(BCToolbox_tester_TARGET bctoolbox-tester) +- list(APPEND _BCToolbox_CACHE_VARS BCToolbox_tester_TARGET) +- endif() +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(BCToolbox +- REQUIRED_VARS ${_BCToolbox_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_BCToolbox_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindBelcard.cmake b/linphone-app/cmake/FindBelcard.cmake +deleted file mode 100644 +index ce89497c..00000000 +--- a/linphone-app/cmake/FindBelcard.cmake ++++ /dev/null +@@ -1,44 +0,0 @@ +-############################################################################ +-# FindBelcard.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# Belcard_FOUND - The liblinphone library has been found +-# Belcard_TARGET - The name of the CMake target +- +-if(NOT TARGET belcard) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/Belcard/cmake/BelcardTargets.cmake) +-endif() +- +-set(_Belcard_REQUIRED_VARS Belcard_TARGET) +-set(_Belcard_CACHE_VARS ${_Belcard_REQUIRED_VARS}) +- +-if(TARGET belcard) +- set(Belcard_TARGET belcard) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(Belcard +- REQUIRED_VARS ${_Belcard_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_Belcard_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindISpell.cmake b/linphone-app/cmake/FindISpell.cmake +deleted file mode 100644 +index 7a9269fa..00000000 +--- a/linphone-app/cmake/FindISpell.cmake ++++ /dev/null +@@ -1,47 +0,0 @@ +-############################################################################ +-# FindISpell.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the ispell include files and library +-# +-# ISpell_FOUND - system has lib ispell +-# ISpell_SOURCE_DIR - the ispell include directory +-# ISpell_BINARY_DIR - the ispell library directory +- +-if(NOT TARGET ${ISPELL_TARGET_NAME}) +- set(EXPORT_PATH ${ISPELL_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake/${ISPELL_TARGET_NAME}/${ISPELL_TARGET_NAME}Config.cmake) +-endif() +- +-set(_ISpell_REQUIRED_VARS ISpell_TARGET) +-set(_ISpell_CACHE_VARS ${_ISpell_REQUIRED_VARS}) +- +-if(TARGET ${ISPELL_TARGET_NAME}) +- set(ISpell_TARGET ${ISPELL_TARGET_NAME}) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(ISpell +- REQUIRED_VARS ${_ISpell_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_ISpell_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindLibLinphone.cmake b/linphone-app/cmake/FindLibLinphone.cmake +deleted file mode 100644 +index 826bb0d8..00000000 +--- a/linphone-app/cmake/FindLibLinphone.cmake ++++ /dev/null +@@ -1,46 +0,0 @@ +-############################################################################ +-# FindLinphone.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# LibLinphone_FOUND - The liblinphone library has been found +-# LibLinphone_TARGET - The name of the CMake target for the liblinphone library +-# LibLinphone_PLUGINS_DIR - The directory where to install liblinphone plugins +- +-if(NOT TARGET liblinphone) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/linphone/cmake/linphoneTargets.cmake) +-endif() +- +-set(_LibLinphone_REQUIRED_VARS LibLinphone_TARGET LibLinphone_PLUGINS_DIR) +-set(_LibLinphone_CACHE_VARS ${_LibLinphone_REQUIRED_VARS}) +- +-if(TARGET liblinphone) +- set(LibLinphone_TARGET liblinphone) +- get_target_property(LibLinphone_PLUGINS_DIR ${LibLinphone_TARGET} LIBLINPHONE_PLUGINS_DIR) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(LibLinphone +- REQUIRED_VARS ${_LibLinphone_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_LibLinphone_CACHE_VARS}) +diff --git a/linphone-app/cmake/FindLinphoneCxx.cmake b/linphone-app/cmake/FindLinphoneCxx.cmake +deleted file mode 100644 +index 0f81fe20..00000000 +--- a/linphone-app/cmake/FindLinphoneCxx.cmake ++++ /dev/null +@@ -1,45 +0,0 @@ +-############################################################################ +-# FindLinphoneCxx.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# LinphoneCxx_FOUND - The liblinphone library has been found +-# LinphoneCxx_TARGET - The name of the CMake target for the liblinphone library +- +-if(NOT TARGET liblinphone++) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/LinphoneCxx/cmake/LinphoneCxxTargets.cmake) +-endif() +- +-set(_LinphoneCxx_REQUIRED_VARS LinphoneCxx_TARGET) +-set(_LinphoneCxx_CACHE_VARS ${_LinphoneCxx_REQUIRED_VARS}) +- +-if(TARGET liblinphone++) +- set(LinphoneCxx_TARGET liblinphone++) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(LinphoneCxx +- REQUIRED_VARS ${_LinphoneCxx_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_LinphoneCxx_CACHE_VARS}) +- +diff --git a/linphone-app/cmake/FindMediastreamer2.cmake b/linphone-app/cmake/FindMediastreamer2.cmake +deleted file mode 100644 +index dc41f187..00000000 +--- a/linphone-app/cmake/FindMediastreamer2.cmake ++++ /dev/null +@@ -1,49 +0,0 @@ +-############################################################################ +-# FindMediastreamer2.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# This module will set the following variables in your project: +-# +-# Mediastreamer2_FOUND - The mediastreamer2 library has been found +-# Mediastreamer2_TARGET - The name of the CMake target for the mediastreamer2 library +-# Mediastreamer2_PLUGINS_DIR - The directory where to install mediastreamer2 plugins +- +-if(NOT TARGET mediastreamer2) +- set(EXPORT_PATH ${LINPHONE_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_DATADIR}/Mediastreamer2/cmake/Mediastreamer2Targets.cmake) +-endif() +- +-set(_Mediastreamer2_REQUIRED_VARS Mediastreamer2_TARGET Mediastreamer2_PLUGINS_DIR) +-set(_Mediastreamer2_CACHE_VARS ${_Mediastreamer2_REQUIRED_VARS}) +- +-if(TARGET mediastreamer2) +- set(Mediastreamer2_TARGET mediastreamer2) +- get_target_property(Mediastreamer2_PLUGINS_DIR ${Mediastreamer2_TARGET} MS2_PLUGINS_DIR) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(Mediastreamer2 +- REQUIRED_VARS ${_Mediastreamer2_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_Mediastreamer2_CACHE_VARS}) +- +diff --git a/linphone-app/cmake/FindQtKeychain.cmake b/linphone-app/cmake/FindQtKeychain.cmake +deleted file mode 100644 +index 9b7911aa..00000000 +--- a/linphone-app/cmake/FindQtKeychain.cmake ++++ /dev/null +@@ -1,48 +0,0 @@ +-############################################################################ +-# FindQtKeychain.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the linphonecxx include files and library +-# +-# QtKeychain_FOUND - system has lib linphonecxx +-# QtKeychain_INCLUDE_DIRS - the linphonecxx include directory +-# QtKeychain_LIBRARIES - The library needed to use linphonecxx +-if(NOT TARGET ${QTKEYCHAIN_TARGET_NAME}) +- set(EXPORT_PATH ${QTKEYCHAIN_OUTPUT_DIR}) +- include(GNUInstallDirs) +- include(${EXPORT_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake/${QTKEYCHAIN_TARGET_NAME}/${QTKEYCHAIN_TARGET_NAME}Config.cmake) +-endif() +- +-set(_QtKeychain_REQUIRED_VARS QtKeychain_TARGET) +-set(_QtKeychain_CACHE_VARS ${_QtKeychain_REQUIRED_VARS}) +- +-if(TARGET ${QTKEYCHAIN_TARGET_NAME}) +- set(QtKeychain_TARGET ${QTKEYCHAIN_TARGET_NAME}) +- set(QtKeychain_USE_BUILD_INTERFACE TRUE) +-endif() +- +-include(FindPackageHandleStandardArgs) +-find_package_handle_standard_args(QtKeychain +- REQUIRED_VARS ${_QtKeychain_REQUIRED_VARS} +- HANDLE_COMPONENTS +-) +-mark_as_advanced(${_QtKeychain_CACHE_VARS}) +- + +base-commit: d69e033508265f756fb47b39b76b7d589be159c0 +prerequisite-patch-id: 1df5d6e9367036cd8ce918e1f3e3d7b3661f73c2 +-- +2.45.1 + diff --git a/gnu/packages/patches/linphone-desktop-ispell.patch b/gnu/packages/patches/linphone-desktop-ispell.patch new file mode 100644 index 0000000000..679703ec02 --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-ispell.patch @@ -0,0 +1,24 @@ +Retrieved from: https://git.pld-linux.org/?p=packages/linphone.git;a=blob_plain;f=linphone-ispell.patch;h=67bbae61835c7fa813edcc006b5b67901ca42abe;hb=HEAD + +--- linphone-desktop-5.2.2/linphone-app/src/components/other/spell-checker/SpellCheckerLinux.cpp.orig 2024-03-11 18:30:37.000000000 +0100 ++++ linphone-desktop-5.2.2/linphone-app/src/components/other/spell-checker/SpellCheckerLinux.cpp 2024-03-31 18:17:09.041543370 +0200 +@@ -20,7 +20,7 @@ + + + #include "SpellChecker.hpp" +-#include <libispell.h> ++#include <ISpell/libispell.h> + #include "app/paths/Paths.hpp" + #include <unistd.h> + #include <cstdio> +--- linphone-desktop-5.2.2/linphone-app/cmake_builder/linphone_package/CMakeLists.txt.orig 2024-04-01 08:06:42.275231951 +0200 ++++ linphone-desktop-5.2.2/linphone-app/cmake_builder/linphone_package/CMakeLists.txt 2024-04-01 17:44:16.670826307 +0200 +@@ -338,8 +338,6 @@ else()# Not Windows and Apple + if(ENABLE_APP_WEBVIEW) + install(FILES "${QT_PATH}/plugins/webview/libqtwebview_webengine.so" DESTINATION "plugins/webview") #Workaround : linuxdeploy doesn't deploy it + endif() +-# ISPELL +- install(DIRECTORY "${ISpell_SOURCE_DIR}/ispell_dictionaries" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}" USE_SOURCE_PERMISSIONS) + endif () + + diff --git a/gnu/packages/patches/linphone-desktop-qtkeychain.patch b/gnu/packages/patches/linphone-desktop-qtkeychain.patch new file mode 100644 index 0000000000..b19761672a --- /dev/null +++ b/gnu/packages/patches/linphone-desktop-qtkeychain.patch @@ -0,0 +1,36 @@ +Retrieved from https://git.pld-linux.org/?p=packages/linphone.git;a=blob_plain;f=linphone-qtkeychain.patch;hb=HEAD + +--- linphone-desktop-5.2.2/CMakeLists.txt.orig 2024-03-11 18:30:37.000000000 +0100 ++++ linphone-desktop-5.2.2/CMakeLists.txt 2024-03-31 17:21:32.069621299 +0200 +@@ -168,7 +168,7 @@ add_option(OPTION_LIST LIBSECRET_SUPPORT + if(WIN32) + add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name for a workaround with windeployqt" "EQt5Keychain") + else() +- add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name" "Qt5Keychain") ++ add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name" "qt5keychain") + endif() + if(WIN32) + add_option(OPTION_LIST ENABLE_OPENSSL_EXPORT "Enable OpenSSL deployment" YES) +--- linphone-desktop-5.2.2/linphone-app/CMakeLists.txt.orig 2024-03-31 16:15:24.501115462 +0200 ++++ linphone-desktop-5.2.2/linphone-app/CMakeLists.txt 2024-03-31 16:27:54.837050544 +0200 +@@ -118,10 +118,7 @@ set(APP_TARGETS ${LinphoneCxx_TARGET} + #################################### + + if(ENABLE_QT_KEYCHAIN) +- find_package(QtKeychain) +- if(NOT QtKeychain_FOUND) +- find_package(${QTKEYCHAIN_TARGET_NAME} CONFIG REQUIRED) +- endif() ++ find_package(Qt5Keychain) + + add_compile_definitions("ENABLE_QT_KEYCHAIN") + if(QtKeychain_USE_BUILD_INTERFACE) +@@ -197,7 +194,7 @@ if(ENABLE_VIDEO) + endif() + if( ENABLE_QT_KEYCHAIN) + if(NOT QTKEYCHAIN_TARGET_NAME) +- set(QTKEYCHAIN_TARGET_NAME "Qt5Keychain") ++ set(QTKEYCHAIN_TARGET_NAME "qt5keychain") + endif() + list(APPEND APP_TARGETS ${QTKEYCHAIN_TARGET_NAME}) + endif() diff --git a/gnu/packages/patches/linphone-desktop-without-sdk.patch b/gnu/packages/patches/linphone-desktop-without-sdk.patch deleted file mode 100644 index ef61b86707..0000000000 --- a/gnu/packages/patches/linphone-desktop-without-sdk.patch +++ /dev/null @@ -1,214 +0,0 @@ -From cfdf6d1c2051d6a20d0cbb94d81fe398f70dea4d Mon Sep 17 00:00:00 2001 -From: Raghav Gururajan <rg@raghavgururajan.name> -Date: Sun, 21 Mar 2021 21:13:53 -0400 -Subject: [PATCH] [PATCH]: Fix building from git. - ---- - CMakeLists.txt | 73 +------------------ - linphone-app/CMakeLists.txt | 12 +-- - .../cmake_builder/additional_steps.cmake | 2 +- - .../linphone_package/CMakeLists.txt | 38 ---------- - linphone-app/linphoneqt_version.cmake | 1 + - linphone-app/src/config.h.cmake | 1 + - 6 files changed, 6 insertions(+), 121 deletions(-) - create mode 100644 linphone-app/linphoneqt_version.cmake - -diff -ru a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 -+++ b/CMakeLists.txt 2023-04-08 16:00:45.487927870 +0200 -@@ -51,23 +51,6 @@ - - set(CMAKE_CXX_STANDARD 11) - --# Prepare gobal CMAKE configuration specific to the current project --set(SDK_BUILD_DIR "${CMAKE_BINARY_DIR}/WORK") # SDK build in WORK. Keep all in it. --set(LINPHONE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/linphone-sdk/desktop") -- --set(APPLICATION_OUTPUT_DIR "${CMAKE_BINARY_DIR}/OUTPUT") -- --set(CMAKE_PREFIX_PATH "${LINPHONE_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR}/include${PREFIX_PATH}") --if(WIN32) -- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}") --elseif(APPLE) -- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_NAME}.app/Contents/Frameworks") --else() -- set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") --endif() --string(REPLACE ";" "|" PREFIX_PATH "${CMAKE_PREFIX_PATH}") --#set(PREFIX_PATH "${LINPHONE_OUTPUT_DIR}|${APPLICATION_OUTPUT_DIR}${PREFIX_PATH}") -- - # Avoid cmake warning if CMP0071 is not set. - if (POLICY CMP0071) - cmake_policy(SET CMP0071 NEW) -@@ -177,10 +160,8 @@ - endif() - 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}") -@@ -195,7 +176,6 @@ - endif() - endif() - 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}") - elseif(APPLE) - list(APPEND APP_OPTIONS "-DENABLE_FAT_BINARY=ON") #Disable XCFrameworks as it is not supported. -@@ -222,28 +202,9 @@ - - - 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}" -- STAMP_DIR "${SDK_BUILD_DIR}/stamp" -- BINARY_DIR "${SDK_BUILD_DIR}" -- STEP_TARGETS build -- 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} -- BUILD_ALWAYS NO #${DO_BUILD} --) --ExternalProject_Add_Step(sdk force_build -- COMMENT "Forcing build for 'desktop'" -- DEPENDEES configure -- DEPENDERS build -- ALWAYS 1 --) - endif() - include(FindPkgConfig) - --set(APP_DEPENDS sdk) - find_package(Qt5 5.10 COMPONENTS Core REQUIRED) - - if ( NOT Qt5_FOUND ) -@@ -257,62 +218,5 @@ - 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" -- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" -- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" -- 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 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) -- 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) -- 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() --endif() --ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app" -- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" -- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" -- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" -- 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} -- EXCLUDE_FROM_ALL ON -- #BUILD_ALWAYS ON --) -+message("Adding Linphone Desktop in an IDE-friendly state") -+add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) -diff -ru a/linphone-app/cmake_builder/additional_steps.cmake ./linphone-app/cmake_builder/additional_steps.cmake ---- a/linphone-app/cmake_builder/additional_steps.cmake 1970-01-01 01:00:01.000000000 +0100 -+++ ./linphone-app/cmake_builder/additional_steps.cmake 2023-04-08 16:02:33.005843116 +0200 -@@ -61,7 +61,7 @@ - SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package" - DOWNLOAD_COMMAND "" - CMAKE_GENERATOR ${CMAKE_GENERATOR} -- CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY} -+ CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY} - ) - endif () - endif () -diff -ru a/linphone-app/CMakeLists.txt ./linphone-app/CMakeLists.txt ---- a/linphone-app/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100 -+++ ./linphone-app/CMakeLists.txt 2023-04-08 16:01:32.699012115 +0200 -@@ -21,17 +21,8 @@ - ################################################################################ - cmake_minimum_required(VERSION 3.1) - -+include(linphoneqt_version.cmake) - find_package(bctoolbox CONFIG) --set(FULL_VERSION ) --bc_compute_full_version(FULL_VERSION) --set(version_major ) --set(version_minor ) --set(version_patch ) --set(identifiers ) --set(metadata ) --bc_parse_full_version("${FULL_VERSION}" version_major version_minor version_patch identifiers metadata) -- --project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}") - - - if(ENABLE_BUILD_VERBOSE) -@@ -51,7 +42,6 @@ - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - endif() - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") --list(APPEND CMAKE_MODULE_PATH "${LINPHONE_OUTPUT_DIR}/cmake") - - set(APP_LIBRARY app-library) - set(APP_PLUGIN app-plugin) -diff --git a/linphone-app/linphoneqt_version.cmake b/linphone-app/linphoneqt_version.cmake -new file mode 100644 -index 00000000..a85d3455 ---- /dev/null -+++ b/linphone-app/linphoneqt_version.cmake -@@ -0,0 +1,1 @@ -+project(linphoneqt VERSION ${GUIX-SET-VERSION}) -\ No newline at end of file -diff -ru a/linphone-app/src/config.h.cmake b/linphone-app/src/config.h.cmake ---- a/linphone-app/src/config.h.cmake 1970-01-01 01:00:01.000000000 +0100 -+++ b/linphone-app/src/config.h.cmake 2023-04-08 16:05:33.458349986 +0200 -@@ -32,3 +32,4 @@ - #cmakedefine EXECUTABLE_NAME "${EXECUTABLE_NAME}" - #cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}" - #cmakedefine ENABLE_APP_WEBVIEW "${ENABLE_APP_WEBVIEW}" -+#define LINPHONE_QT_GIT_VERSION "${PROJECT_VERSION}" -\ No newline at end of file diff --git a/gnu/packages/patches/linuxdcpp-openssl-1.1.patch b/gnu/packages/patches/linuxdcpp-openssl-1.1.patch deleted file mode 100644 index 6f9912afd8..0000000000 --- a/gnu/packages/patches/linuxdcpp-openssl-1.1.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- a/dcpp/CryptoManager.cpp.orig 2011-04-17 17:57:09 UTC -+++ b/dcpp/CryptoManager.cpp -@@ -107,12 +107,20 @@ CryptoManager::CryptoManager() - }; - - if(dh) { -- dh->p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), 0); -- dh->g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), 0); -+ BIGNUM *p, *g; - -- if (!dh->p || !dh->g) { -+ p = BN_bin2bn(dh4096_p, sizeof(dh4096_p), 0); -+ g = BN_bin2bn(dh4096_g, sizeof(dh4096_g), 0); -+ -+ if (!p || !g) { - dh.reset(); - } else { -+#if OPENSSL_VERSION_NUMBER < 0x10100005L -+ dh->p = p; -+ dh->g = g; -+#else -+ DH_set0_pqg(dh, p, NULL, g); -+#endif - SSL_CTX_set_options(serverContext, SSL_OP_SINGLE_DH_USE); - SSL_CTX_set_options(serverVerContext, SSL_OP_SINGLE_DH_USE); - SSL_CTX_set_tmp_dh(serverContext, (DH*)dh); diff --git a/gnu/packages/patches/mediastreamer2-cmake-findgsm.patch b/gnu/packages/patches/mediastreamer2-cmake-findgsm.patch new file mode 100644 index 0000000000..7b48e310b5 --- /dev/null +++ b/gnu/packages/patches/mediastreamer2-cmake-findgsm.patch @@ -0,0 +1,63 @@ +Retrieved from: https://git.pld-linux.org/?p=packages/mediastreamer.git;a=blob_plain;f=mediastreamer-cmake-find.patch;h=4f1e3577f43bf791ed5cdb180ca455f919b80c8d;hb=HEAD + +--- mediastreamer2-5.3.29/cmake/FindGSM.cmake.orig 2024-02-21 12:02:03.000000000 +0100 ++++ mediastreamer2-5.3.29/cmake/FindGSM.cmake 2024-03-09 20:16:25.064077414 +0100 +@@ -58,7 +58,7 @@ else() + set(_GSM_ROOT_PATHS ${CMAKE_INSTALL_PREFIX}) + + find_path(_GSM_INCLUDE_DIRS +- NAMES gsm/gsm.h ++ NAMES gsm.h gsm/gsm.h + HINTS ${_GSM_ROOT_PATHS} + PATH_SUFFIXES include + ) +--- mediastreamer2-5.3.29/cmake/FindDav1d.cmake.orig 2024-02-21 12:02:03.000000000 +0100 ++++ mediastreamer2-5.3.29/cmake/FindDav1d.cmake 2024-03-09 20:44:17.671682787 +0100 +@@ -65,17 +65,17 @@ else() + PATH_SUFFIXES bin lib lib/Win32 + ) + +- if(_Dav1d_INCLUDE_DIRS AND _Dav1d_LIBRARY) ++ if(Dav1d_INCLUDE_DIRS AND Dav1d_LIBRARY) + add_library(libdav1d UNKNOWN IMPORTED) + if(WIN32) + set_target_properties(libdav1d PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Dav1d_INCLUDE_DIRS}" +- IMPORTED_IMPLIB "${_Dav1d_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Dav1d_INCLUDE_DIRS}" ++ IMPORTED_IMPLIB "${Dav1d_LIBRARY}" + ) + else() + set_target_properties(libdav1d PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Dav1d_INCLUDE_DIRS}" +- IMPORTED_LOCATION "${_Dav1d_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Dav1d_INCLUDE_DIRS}" ++ IMPORTED_LOCATION "${Dav1d_LIBRARY}" + ) + endif() + +--- mediastreamer2-5.3.29/cmake/FindAom.cmake.orig 2024-02-21 12:02:03.000000000 +0100 ++++ mediastreamer2-5.3.29/cmake/FindAom.cmake 2024-03-09 20:45:16.931361750 +0100 +@@ -65,17 +65,17 @@ else() + PATH_SUFFIXES bin lib lib/Win32 + ) + +- if(_Aom_INCLUDE_DIRS AND _Aom_LIBRARY) ++ if(Aom_INCLUDE_DIRS AND Aom_LIBRARY) + add_library(aom UNKNOWN IMPORTED) + if(WIN32) + set_target_properties(aom PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Aom_INCLUDE_DIRS}" +- IMPORTED_IMPLIB "${_Aom_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Aom_INCLUDE_DIRS}" ++ IMPORTED_IMPLIB "${Aom_LIBRARY}" + ) + else() + set_target_properties(aom PROPERTIES +- INTERFACE_INCLUDE_DIRECTORIES "${_Aom_INCLUDE_DIRS}" +- IMPORTED_LOCATION "${_Aom_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Aom_INCLUDE_DIRS}" ++ IMPORTED_LOCATION "${Aom_LIBRARY}" + ) + endif() + diff --git a/gnu/packages/patches/mswebrtc-b64-refactor.patch b/gnu/packages/patches/mswebrtc-b64-refactor.patch new file mode 100644 index 0000000000..af4a1e1682 --- /dev/null +++ b/gnu/packages/patches/mswebrtc-b64-refactor.patch @@ -0,0 +1,949 @@ +From 17e72f00831a36da387ceafe7f3076ffa8f66aba Mon Sep 17 00:00:00 2001 +From: Clemence Him <clemence.him@belledonne-communications.com> +Date: Fri, 22 Sep 2023 14:28:02 +0200 +Subject: [PATCH] Base64 functions refactoring + +--- + aec.c | 781 +++++++++++++++++++++++++++++----------------------------- + 1 file changed, 394 insertions(+), 387 deletions(-) + +diff --git a/aec.c b/aec.c +index 271f370..995f655 100644 +--- a/aec.c ++++ b/aec.c +@@ -24,19 +24,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + #include "mediastreamer2/msfilter.h" + #include "mediastreamer2/msticker.h" + #ifdef BUILD_AEC +-#include "echo_cancellation.h" + #include "aec_splitting_filter.h" ++#include "echo_cancellation.h" + #endif + #ifdef BUILD_AECM + #include "echo_control_mobile.h" + #endif +-#include "ortp/b64.h" + + #ifdef _WIN32 + #include <malloc.h> /* for alloca */ + #endif + +-//#define EC_DUMP 1 ++// #define EC_DUMP 1 + #ifdef ANDROID + #define EC_DUMP_PREFIX "/sdcard" + #else +@@ -48,466 +47,485 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + static const float smooth_factor = 0.05f; + static const int framesize = 80; + +- + typedef enum _WebRTCAECType { +- WebRTCAECTypeNormal, +- WebRTCAECTypeMobile ++ WebRTCAECTypeNormal, ++ WebRTCAECTypeMobile + } WebRTCAECType; + + typedef struct WebRTCAECState { +- void *aecInst; +- MSBufferizer delayed_ref; +- MSFlowControlledBufferizer ref; +- MSBufferizer echo; +- int framesize; +- int samplerate; +- int delay_ms; +- int nominal_ref_samples; +- char *state_str; ++ void *aecInst; ++ MSBufferizer delayed_ref; ++ MSFlowControlledBufferizer ref; ++ MSBufferizer echo; ++ int framesize; ++ int samplerate; ++ int delay_ms; ++ int nominal_ref_samples; ++ char *state_str; + #ifdef EC_DUMP +- FILE *echofile; +- FILE *reffile; +- FILE *cleanfile; ++ FILE *echofile; ++ FILE *reffile; ++ FILE *cleanfile; + #endif +- bool_t echostarted; +- bool_t bypass_mode; +- bool_t using_zeroes; +- WebRTCAECType aec_type; ++ bool_t echostarted; ++ bool_t bypass_mode; ++ bool_t using_zeroes; ++ WebRTCAECType aec_type; + #ifdef BUILD_AEC +- MSWebRtcAecSplittingFilter *splitting_filter; ++ MSWebRtcAecSplittingFilter *splitting_filter; + #endif + } WebRTCAECState; + + static void webrtc_aecgeneric_init(MSFilter *f, WebRTCAECType aec_type) { +- WebRTCAECState *s = (WebRTCAECState *) ms_new0(WebRTCAECState, 1); +- +- s->samplerate = 8000; +- ms_bufferizer_init(&s->delayed_ref); +- ms_bufferizer_init(&s->echo); +- ms_flow_controlled_bufferizer_init(&s->ref, f, s->samplerate, 1); +- s->delay_ms = 0; +- s->aecInst = NULL; +- s->framesize = framesize; +- s->state_str = NULL; +- s->using_zeroes = FALSE; +- s->echostarted = FALSE; +- s->bypass_mode = FALSE; +- s->aec_type = aec_type; ++ WebRTCAECState *s = (WebRTCAECState *)ms_new0(WebRTCAECState, 1); ++ ++ s->samplerate = 8000; ++ ms_bufferizer_init(&s->delayed_ref); ++ ms_bufferizer_init(&s->echo); ++ ms_flow_controlled_bufferizer_init(&s->ref, f, s->samplerate, 1); ++ s->delay_ms = 0; ++ s->aecInst = NULL; ++ s->framesize = framesize; ++ s->state_str = NULL; ++ s->using_zeroes = FALSE; ++ s->echostarted = FALSE; ++ s->bypass_mode = FALSE; ++ s->aec_type = aec_type; + + #ifdef EC_DUMP +- { +- char *fname = ms_strdup_printf("%s/mswebrtcaec-%p-echo.raw", EC_DUMP_PREFIX, f); +- s->echofile = fopen(fname, "w"); +- ms_free(fname); +- fname = ms_strdup_printf("%s/mswebrtcaec-%p-ref.raw", EC_DUMP_PREFIX, f); +- s->reffile = fopen(fname, "w"); +- ms_free(fname); +- fname = ms_strdup_printf("%s/mswebrtcaec-%p-clean.raw", EC_DUMP_PREFIX, f); +- s->cleanfile = fopen(fname, "w"); +- ms_free(fname); +- } ++ { ++ char *fname = ++ ms_strdup_printf("%s/mswebrtcaec-%p-echo.raw", EC_DUMP_PREFIX, f); ++ s->echofile = fopen(fname, "w"); ++ ms_free(fname); ++ fname = ms_strdup_printf("%s/mswebrtcaec-%p-ref.raw", EC_DUMP_PREFIX, f); ++ s->reffile = fopen(fname, "w"); ++ ms_free(fname); ++ fname = ms_strdup_printf("%s/mswebrtcaec-%p-clean.raw", EC_DUMP_PREFIX, f); ++ s->cleanfile = fopen(fname, "w"); ++ ms_free(fname); ++ } + #endif + +- f->data = s; ++ f->data = s; + } + + #ifdef BUILD_AEC + static void webrtc_aec_init(MSFilter *f) { +- webrtc_aecgeneric_init(f, WebRTCAECTypeNormal); ++ webrtc_aecgeneric_init(f, WebRTCAECTypeNormal); + } + #endif + + #ifdef BUILD_AECM + static void webrtc_aecm_init(MSFilter *f) { +- webrtc_aecgeneric_init(f, WebRTCAECTypeMobile); ++ webrtc_aecgeneric_init(f, WebRTCAECTypeMobile); + } + #endif + + static void webrtc_aec_uninit(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- if (s->state_str) ms_free(s->state_str); +- ms_bufferizer_uninit(&s->delayed_ref); ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ if (s->state_str) ++ ms_free(s->state_str); ++ ms_bufferizer_uninit(&s->delayed_ref); + #ifdef EC_DUMP +- if (s->echofile) +- fclose(s->echofile); +- if (s->reffile) +- fclose(s->reffile); ++ if (s->echofile) ++ fclose(s->echofile); ++ if (s->reffile) ++ fclose(s->reffile); + #endif +- ms_free(s); ++ ms_free(s); + } + + static void configure_flow_controlled_bufferizer(WebRTCAECState *s) { +- ms_flow_controlled_bufferizer_set_samplerate(&s->ref, s->samplerate); +- ms_flow_controlled_bufferizer_set_max_size_ms(&s->ref, s->delay_ms); +- ms_flow_controlled_bufferizer_set_granularity_ms(&s->ref, (s->framesize * 1000) / s->samplerate); ++ ms_flow_controlled_bufferizer_set_samplerate(&s->ref, s->samplerate); ++ ms_flow_controlled_bufferizer_set_max_size_ms(&s->ref, s->delay_ms); ++ ms_flow_controlled_bufferizer_set_granularity_ms( ++ &s->ref, (s->framesize * 1000) / s->samplerate); + } + + static void webrtc_aec_preprocess(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; + #ifdef BUILD_AEC +- AecConfig aec_config; ++ AecConfig aec_config; + #endif + #ifdef BUILD_AECM +- AecmConfig aecm_config; +- int error_code; ++ AecmConfig aecm_config; ++ int error_code; + #endif +- int delay_samples = 0; +- mblk_t *m; ++ int delay_samples = 0; ++ mblk_t *m; + +- s->echostarted = FALSE; +- delay_samples = s->delay_ms * s->samplerate / 1000; +- s->framesize=(framesize*s->samplerate)/8000; +- ms_message("Initializing WebRTC echo canceler with framesize=%i, delay_ms=%i, delay_samples=%i", s->framesize, s->delay_ms, delay_samples); +- configure_flow_controlled_bufferizer(s); ++ s->echostarted = FALSE; ++ delay_samples = s->delay_ms * s->samplerate / 1000; ++ s->framesize = (framesize * s->samplerate) / 8000; ++ ms_message("Initializing WebRTC echo canceler with framesize=%i, " ++ "delay_ms=%i, delay_samples=%i", ++ s->framesize, s->delay_ms, delay_samples); ++ configure_flow_controlled_bufferizer(s); + + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- if ((s->aecInst = WebRtcAec_Create()) == NULL) { +- s->bypass_mode = TRUE; +- ms_error("WebRtcAec_Create(): error, entering bypass mode"); +- return; +- } +- if ((WebRtcAec_Init(s->aecInst, MIN(48000, s->samplerate), s->samplerate)) < 0) { +- ms_error("WebRtcAec_Init(): WebRTC echo canceller does not support %d samplerate", s->samplerate); +- s->bypass_mode = TRUE; +- ms_error("Entering bypass mode"); +- return; +- } +- aec_config.nlpMode = kAecNlpAggressive; +- aec_config.skewMode = kAecFalse; +- aec_config.metricsMode = kAecFalse; +- aec_config.delay_logging = kAecFalse; +- if (WebRtcAec_set_config(s->aecInst, aec_config) != 0) { +- ms_error("WebRtcAec_set_config(): failed."); +- } +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ if ((s->aecInst = WebRtcAec_Create()) == NULL) { ++ s->bypass_mode = TRUE; ++ ms_error("WebRtcAec_Create(): error, entering bypass mode"); ++ return; ++ } ++ if ((WebRtcAec_Init(s->aecInst, MIN(48000, s->samplerate), s->samplerate)) < ++ 0) { ++ ms_error("WebRtcAec_Init(): WebRTC echo canceller does not support %d " ++ "samplerate", ++ s->samplerate); ++ s->bypass_mode = TRUE; ++ ms_error("Entering bypass mode"); ++ return; ++ } ++ aec_config.nlpMode = kAecNlpAggressive; ++ aec_config.skewMode = kAecFalse; ++ aec_config.metricsMode = kAecFalse; ++ aec_config.delay_logging = kAecFalse; ++ if (WebRtcAec_set_config(s->aecInst, aec_config) != 0) { ++ ms_error("WebRtcAec_set_config(): failed."); ++ } ++ } + #endif + #ifdef BUILD_AECM +- if (s->aec_type == WebRTCAECTypeMobile) { +- if ((s->aecInst = WebRtcAecm_Create()) == NULL) { +- s->bypass_mode = TRUE; +- ms_error("WebRtcAecm_Create(): error, entering bypass mode"); +- return; +- } +- if ((error_code = WebRtcAecm_Init(s->aecInst, s->samplerate)) < 0) { +- if (error_code == AECM_BAD_PARAMETER_ERROR) { +- ms_error("WebRtcAecm_Init(): WebRTC echo canceller does not support %d samplerate", s->samplerate); +- } +- s->bypass_mode = TRUE; +- ms_error("Entering bypass mode"); +- return; +- } +- aecm_config.cngMode = TRUE; +- aecm_config.echoMode = 3; +- if (WebRtcAecm_set_config(s->aecInst, aecm_config)!=0){ +- ms_error("WebRtcAecm_set_config(): failed."); +- } +- } ++ if (s->aec_type == WebRTCAECTypeMobile) { ++ if ((s->aecInst = WebRtcAecm_Create()) == NULL) { ++ s->bypass_mode = TRUE; ++ ms_error("WebRtcAecm_Create(): error, entering bypass mode"); ++ return; ++ } ++ if ((error_code = WebRtcAecm_Init(s->aecInst, s->samplerate)) < 0) { ++ if (error_code == AECM_BAD_PARAMETER_ERROR) { ++ ms_error("WebRtcAecm_Init(): WebRTC echo canceller does not support %d " ++ "samplerate", ++ s->samplerate); ++ } ++ s->bypass_mode = TRUE; ++ ms_error("Entering bypass mode"); ++ return; ++ } ++ aecm_config.cngMode = TRUE; ++ aecm_config.echoMode = 3; ++ if (WebRtcAecm_set_config(s->aecInst, aecm_config) != 0) { ++ ms_error("WebRtcAecm_set_config(): failed."); ++ } ++ } + #endif + +- /* fill with zeroes for the time of the delay*/ +- m = allocb(delay_samples * 2, 0); +- m->b_wptr += delay_samples * 2; +- ms_bufferizer_put(&s->delayed_ref, m); +- s->nominal_ref_samples = delay_samples; ++ /* fill with zeroes for the time of the delay*/ ++ m = allocb(delay_samples * 2, 0); ++ m->b_wptr += delay_samples * 2; ++ ms_bufferizer_put(&s->delayed_ref, m); ++ s->nominal_ref_samples = delay_samples; + } + + /* inputs[0]= reference signal from far end (sent to soundcard) + * inputs[1]= near speech & echo signal (read from soundcard) + * outputs[0]= is a copy of inputs[0] to be sent to soundcard + * outputs[1]= near end speech, echo removed - towards far end +-*/ ++ */ + static void webrtc_aec_process(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- int nbytes = s->framesize * sizeof(int16_t); +- mblk_t *refm; +- int16_t *ref, *echo; +- int nbands = 1; +- int bandsize = s->framesize; +- +- if (s->bypass_mode) { +- while ((refm = ms_queue_get(f->inputs[0])) != NULL) { +- ms_queue_put(f->outputs[0], refm); +- } +- while ((refm = ms_queue_get(f->inputs[1])) != NULL) { +- ms_queue_put(f->outputs[1], refm); +- } +- return; +- } +- +- if (f->inputs[0] != NULL) { +- if (s->echostarted) { +- while ((refm = ms_queue_get(f->inputs[0])) != NULL) { +- mblk_t *cp=dupmsg(refm); +- ms_bufferizer_put(&s->delayed_ref,cp); +- ms_flow_controlled_bufferizer_put(&s->ref,refm); +- } +- } else { +- ms_warning("Getting reference signal but no echo to synchronize on."); +- ms_queue_flush(f->inputs[0]); +- } +- } +- +- ms_bufferizer_put_from_queue(&s->echo, f->inputs[1]); +- +- ref = (int16_t *) alloca(nbytes); +- echo = (int16_t *) alloca(nbytes); ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ int nbytes = s->framesize * sizeof(int16_t); ++ mblk_t *refm; ++ int16_t *ref, *echo; ++ int nbands = 1; ++ int bandsize = s->framesize; ++ ++ if (s->bypass_mode) { ++ while ((refm = ms_queue_get(f->inputs[0])) != NULL) { ++ ms_queue_put(f->outputs[0], refm); ++ } ++ while ((refm = ms_queue_get(f->inputs[1])) != NULL) { ++ ms_queue_put(f->outputs[1], refm); ++ } ++ return; ++ } ++ ++ if (f->inputs[0] != NULL) { ++ if (s->echostarted) { ++ while ((refm = ms_queue_get(f->inputs[0])) != NULL) { ++ mblk_t *cp = dupmsg(refm); ++ ms_bufferizer_put(&s->delayed_ref, cp); ++ ms_flow_controlled_bufferizer_put(&s->ref, refm); ++ } ++ } else { ++ ms_warning("Getting reference signal but no echo to synchronize on."); ++ ms_queue_flush(f->inputs[0]); ++ } ++ } ++ ++ ms_bufferizer_put_from_queue(&s->echo, f->inputs[1]); ++ ++ ref = (int16_t *)alloca(nbytes); ++ echo = (int16_t *)alloca(nbytes); + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- if (s->samplerate > 16000) { +- nbands = s->samplerate / 16000; +- bandsize = 160; +- } +- if (!s->splitting_filter) { +- s->splitting_filter = mswebrtc_aec_splitting_filter_create(nbands, bandsize); +- } +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ if (s->samplerate > 16000) { ++ nbands = s->samplerate / 16000; ++ bandsize = 160; ++ } ++ if (!s->splitting_filter) { ++ s->splitting_filter = ++ mswebrtc_aec_splitting_filter_create(nbands, bandsize); ++ } ++ } + #endif +- while (ms_bufferizer_read(&s->echo, (uint8_t *)echo, (size_t)nbytes) >= (size_t)nbytes) { +- mblk_t *oecho = allocb(nbytes, 0); +- int avail; +- int avail_samples; +- +- if (!s->echostarted) s->echostarted = TRUE; +- if ((avail = ms_bufferizer_get_avail(&s->delayed_ref)) < ((s->nominal_ref_samples * 2) + nbytes)) { +- /*we don't have enough to read in a reference signal buffer, inject silence instead*/ +- refm = allocb(nbytes, 0); +- memset(refm->b_wptr, 0, nbytes); +- refm->b_wptr += nbytes; +- ms_bufferizer_put(&s->delayed_ref, refm); +- /* +- * However, we don't inject this silence buffer to the sound card, in order to break the following bad loop: +- * - the sound playback filter detects it has too many pending samples, then triggers an event to request samples to be dropped upstream. +- * - the upstream MSFlowControl filter is requested to drop samples, which it starts to do. +- * - necessarily shortly after the AEC goes into a situation where it has not enough reference samples while processing an audio buffer from mic. +- * - if the AEC injects a silence buffer as output, then it will RECREATE a situation where the sound playback filter has too many pending samples. +- * That's why we should not do this. +- * By not doing this, we will create a discrepancy between what we really injected to the soundcard, and what we told to the +- * echo canceller about the samples we injected. This shifts the echo. The echo canceller will re-converge quickly to take into +- * account the situation. +- * +- */ +- //ms_queue_put(f->outputs[0], dupmsg(refm)); +- if (!s->using_zeroes) { +- ms_warning("Not enough ref samples, using zeroes"); +- s->using_zeroes = TRUE; +- } +- } else { +- if (s->using_zeroes) { +- ms_message("Samples are back."); +- s->using_zeroes = FALSE; +- } +- /* read from our no-delay buffer and output */ +- refm = allocb(nbytes, 0); +- if (ms_flow_controlled_bufferizer_read(&s->ref, refm->b_wptr, nbytes) == 0) { +- ms_fatal("Should never happen"); +- } +- refm->b_wptr += nbytes; +- ms_queue_put(f->outputs[0], refm); +- } +- +- /*now read a valid buffer of delayed ref samples*/ +- if (ms_bufferizer_read(&s->delayed_ref, (uint8_t *)ref, nbytes) == 0) { +- ms_fatal("Should never happen"); +- } +- avail -= nbytes; +- avail_samples = avail / 2; ++ while (ms_bufferizer_read(&s->echo, (uint8_t *)echo, (size_t)nbytes) >= ++ (size_t)nbytes) { ++ mblk_t *oecho = allocb(nbytes, 0); ++ int avail; ++ int avail_samples; ++ ++ if (!s->echostarted) ++ s->echostarted = TRUE; ++ if ((avail = ms_bufferizer_get_avail(&s->delayed_ref)) < ++ ((s->nominal_ref_samples * 2) + nbytes)) { ++ /*we don't have enough to read in a reference signal buffer, inject ++ * silence instead*/ ++ refm = allocb(nbytes, 0); ++ memset(refm->b_wptr, 0, nbytes); ++ refm->b_wptr += nbytes; ++ ms_bufferizer_put(&s->delayed_ref, refm); ++ /* ++ * However, we don't inject this silence buffer to the sound card, in ++ * order to break the following bad loop: ++ * - the sound playback filter detects it has too many pending samples, ++ * then triggers an event to request samples to be dropped upstream. ++ * - the upstream MSFlowControl filter is requested to drop samples, which ++ * it starts to do. ++ * - necessarily shortly after the AEC goes into a situation where it has ++ * not enough reference samples while processing an audio buffer from mic. ++ * - if the AEC injects a silence buffer as output, then it will RECREATE ++ * a situation where the sound playback filter has too many pending ++ * samples. That's why we should not do this. By not doing this, we will ++ * create a discrepancy between what we really injected to the soundcard, ++ * and what we told to the echo canceller about the samples we injected. ++ * This shifts the echo. The echo canceller will re-converge quickly to ++ * take into account the situation. ++ * ++ */ ++ // ms_queue_put(f->outputs[0], dupmsg(refm)); ++ if (!s->using_zeroes) { ++ ms_warning("Not enough ref samples, using zeroes"); ++ s->using_zeroes = TRUE; ++ } ++ } else { ++ if (s->using_zeroes) { ++ ms_message("Samples are back."); ++ s->using_zeroes = FALSE; ++ } ++ /* read from our no-delay buffer and output */ ++ refm = allocb(nbytes, 0); ++ if (ms_flow_controlled_bufferizer_read(&s->ref, refm->b_wptr, nbytes) == ++ 0) { ++ ms_fatal("Should never happen"); ++ } ++ refm->b_wptr += nbytes; ++ ms_queue_put(f->outputs[0], refm); ++ } ++ ++ /*now read a valid buffer of delayed ref samples*/ ++ if (ms_bufferizer_read(&s->delayed_ref, (uint8_t *)ref, nbytes) == 0) { ++ ms_fatal("Should never happen"); ++ } ++ avail -= nbytes; ++ avail_samples = avail / 2; + + #ifdef EC_DUMP +- if (s->reffile) +- fwrite(ref, nbytes, 1, s->reffile); +- if (s->echofile) +- fwrite(echo, nbytes, 1, s->echofile); ++ if (s->reffile) ++ fwrite(ref, nbytes, 1, s->reffile); ++ if (s->echofile) ++ fwrite(echo, nbytes, 1, s->echofile); + #endif + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- mswebrtc_aec_splitting_filter_analysis(s->splitting_filter, ref, echo); +- if (WebRtcAec_BufferFarend(s->aecInst, +- mswebrtc_aec_splitting_filter_get_ref(s->splitting_filter), +- (size_t)mswebrtc_aec_splitting_filter_get_bandsize(s->splitting_filter)) != 0) +- ms_error("WebRtcAec_BufferFarend() failed."); +- if (WebRtcAec_Process(s->aecInst, +- mswebrtc_aec_splitting_filter_get_echo_bands(s->splitting_filter), +- mswebrtc_aec_splitting_filter_get_number_of_bands(s->splitting_filter), +- mswebrtc_aec_splitting_filter_get_output_bands(s->splitting_filter), +- (size_t)mswebrtc_aec_splitting_filter_get_bandsize(s->splitting_filter), 0, 0) != 0) +- ms_error("WebRtcAec_Process() failed."); +- mswebrtc_aec_splitting_filter_synthesis(s->splitting_filter, (int16_t *)oecho->b_wptr); +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ mswebrtc_aec_splitting_filter_analysis(s->splitting_filter, ref, echo); ++ if (WebRtcAec_BufferFarend( ++ s->aecInst, ++ mswebrtc_aec_splitting_filter_get_ref(s->splitting_filter), ++ (size_t)mswebrtc_aec_splitting_filter_get_bandsize( ++ s->splitting_filter)) != 0) ++ ms_error("WebRtcAec_BufferFarend() failed."); ++ if (WebRtcAec_Process( ++ s->aecInst, ++ mswebrtc_aec_splitting_filter_get_echo_bands(s->splitting_filter), ++ mswebrtc_aec_splitting_filter_get_number_of_bands( ++ s->splitting_filter), ++ mswebrtc_aec_splitting_filter_get_output_bands( ++ s->splitting_filter), ++ (size_t)mswebrtc_aec_splitting_filter_get_bandsize( ++ s->splitting_filter), ++ 0, 0) != 0) ++ ms_error("WebRtcAec_Process() failed."); ++ mswebrtc_aec_splitting_filter_synthesis(s->splitting_filter, ++ (int16_t *)oecho->b_wptr); ++ } + #endif + #ifdef BUILD_AECM +- if (s->aec_type == WebRTCAECTypeMobile) { +- if (WebRtcAecm_BufferFarend(s->aecInst, ref, (size_t)s->framesize) != 0) +- ms_error("WebRtcAecm_BufferFarend() failed."); +- if (WebRtcAecm_Process(s->aecInst, echo, NULL, (int16_t *)oecho->b_wptr, (size_t)s->framesize, 0) != 0) +- ms_error("WebRtcAecm_Process() failed."); +- } ++ if (s->aec_type == WebRTCAECTypeMobile) { ++ if (WebRtcAecm_BufferFarend(s->aecInst, ref, (size_t)s->framesize) != 0) ++ ms_error("WebRtcAecm_BufferFarend() failed."); ++ if (WebRtcAecm_Process(s->aecInst, echo, NULL, (int16_t *)oecho->b_wptr, ++ (size_t)s->framesize, 0) != 0) ++ ms_error("WebRtcAecm_Process() failed."); ++ } + #endif + #ifdef EC_DUMP +- if (s->cleanfile) +- fwrite(oecho->b_wptr, nbytes, 1, s->cleanfile); ++ if (s->cleanfile) ++ fwrite(oecho->b_wptr, nbytes, 1, s->cleanfile); + #endif +- oecho->b_wptr += nbytes; +- ms_queue_put(f->outputs[1], oecho); +- } ++ oecho->b_wptr += nbytes; ++ ms_queue_put(f->outputs[1], oecho); ++ } + } + + static void webrtc_aec_postprocess(MSFilter *f) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; + +- ms_bufferizer_flush(&s->delayed_ref); +- ms_bufferizer_flush(&s->echo); +- ms_flow_controlled_bufferizer_flush(&s->ref); ++ ms_bufferizer_flush(&s->delayed_ref); ++ ms_bufferizer_flush(&s->echo); ++ ms_flow_controlled_bufferizer_flush(&s->ref); + #ifdef BUILD_AEC +- if (s->splitting_filter) { +- mswebrtc_aec_splitting_filter_destroy(s->splitting_filter); +- s->splitting_filter = NULL; +- } ++ if (s->splitting_filter) { ++ mswebrtc_aec_splitting_filter_destroy(s->splitting_filter); ++ s->splitting_filter = NULL; ++ } + #endif +- if (s->aecInst != NULL) { ++ if (s->aecInst != NULL) { + #ifdef BUILD_AEC +- if (s->aec_type == WebRTCAECTypeNormal) { +- WebRtcAec_Free(s->aecInst); +- } ++ if (s->aec_type == WebRTCAECTypeNormal) { ++ WebRtcAec_Free(s->aecInst); ++ } + #endif + #ifdef BUILD_AECM +- if (s->aec_type == WebRTCAECTypeMobile) { +- WebRtcAecm_Free(s->aecInst); +- } ++ if (s->aec_type == WebRTCAECTypeMobile) { ++ WebRtcAecm_Free(s->aecInst); ++ } + #endif +- s->aecInst = NULL; +- } ++ s->aecInst = NULL; ++ } + } + + static int webrtc_aec_set_sr(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- int requested_sr = *(int *) arg; +- int sr = requested_sr; +- +- if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 48000)) { +- sr = 48000; +- } else if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 32000)) { +- sr = 32000; +- } else if (requested_sr >= 16000) { +- sr = 16000; +- } else { +- sr = 8000; +- } +- if (sr != requested_sr) +- ms_message("Webrtc %s does not support sampling rate %i, using %i instead", ((s->aec_type == WebRTCAECTypeNormal)?"aec":"aecm"),requested_sr, sr); +- +- s->samplerate = sr; +- configure_flow_controlled_bufferizer(s); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ int requested_sr = *(int *)arg; ++ int sr = requested_sr; ++ ++ if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 48000)) { ++ sr = 48000; ++ } else if ((s->aec_type == WebRTCAECTypeNormal) && (requested_sr >= 32000)) { ++ sr = 32000; ++ } else if (requested_sr >= 16000) { ++ sr = 16000; ++ } else { ++ sr = 8000; ++ } ++ if (sr != requested_sr) ++ ms_message("Webrtc %s does not support sampling rate %i, using %i instead", ++ ((s->aec_type == WebRTCAECTypeNormal) ? "aec" : "aecm"), ++ requested_sr, sr); ++ ++ s->samplerate = sr; ++ configure_flow_controlled_bufferizer(s); ++ return 0; + } + + static int webrtc_aec_get_sr(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- *(int *) arg=s->samplerate; +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ *(int *)arg = s->samplerate; ++ return 0; + } + + static int webrtc_aec_set_framesize(MSFilter *f, void *arg) { +- /* Do nothing because the WebRTC echo canceller only accept specific values: 80 and 160. We use 80 at 8khz, and 160 at 16khz */ +- return 0; ++ /* Do nothing because the WebRTC echo canceller only accept specific values: ++ * 80 and 160. We use 80 at 8khz, and 160 at 16khz */ ++ return 0; + } + + static int webrtc_aec_set_delay(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- s->delay_ms = *(int *) arg; +- configure_flow_controlled_bufferizer(s); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ s->delay_ms = *(int *)arg; ++ configure_flow_controlled_bufferizer(s); ++ return 0; + } + + static int webrtc_aec_set_tail_length(MSFilter *f, void *arg) { +- /* Do nothing because this is not needed by the WebRTC echo canceller. */ +- return 0; ++ /* Do nothing because this is not needed by the WebRTC echo canceller. */ ++ return 0; + } + static int webrtc_aec_set_bypass_mode(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- s->bypass_mode = *(bool_t *) arg; +- ms_message("set EC bypass mode to [%i]", s->bypass_mode); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ s->bypass_mode = *(bool_t *)arg; ++ ms_message("set EC bypass mode to [%i]", s->bypass_mode); ++ return 0; + } + static int webrtc_aec_get_bypass_mode(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- *(bool_t *) arg = s->bypass_mode; +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ *(bool_t *)arg = s->bypass_mode; ++ return 0; + } + + static int webrtc_aec_set_state(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- s->state_str = ms_strdup((const char *) arg); +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ s->state_str = ms_strdup((const char *)arg); ++ return 0; + } + + static int webrtc_aec_get_state(MSFilter *f, void *arg) { +- WebRTCAECState *s = (WebRTCAECState *) f->data; +- *(char **) arg = s->state_str; +- return 0; ++ WebRTCAECState *s = (WebRTCAECState *)f->data; ++ *(char **)arg = s->state_str; ++ return 0; + } + + static MSFilterMethod webrtc_aec_methods[] = { +- { MS_FILTER_SET_SAMPLE_RATE , webrtc_aec_set_sr }, +- { MS_FILTER_GET_SAMPLE_RATE , webrtc_aec_get_sr }, +- { MS_ECHO_CANCELLER_SET_TAIL_LENGTH , webrtc_aec_set_tail_length }, +- { MS_ECHO_CANCELLER_SET_DELAY , webrtc_aec_set_delay }, +- { MS_ECHO_CANCELLER_SET_FRAMESIZE , webrtc_aec_set_framesize }, +- { MS_ECHO_CANCELLER_SET_BYPASS_MODE , webrtc_aec_set_bypass_mode }, +- { MS_ECHO_CANCELLER_GET_BYPASS_MODE , webrtc_aec_get_bypass_mode }, +- { MS_ECHO_CANCELLER_GET_STATE_STRING , webrtc_aec_get_state }, +- { MS_ECHO_CANCELLER_SET_STATE_STRING , webrtc_aec_set_state }, +- { 0, NULL } +-}; +- ++ {MS_FILTER_SET_SAMPLE_RATE, webrtc_aec_set_sr}, ++ {MS_FILTER_GET_SAMPLE_RATE, webrtc_aec_get_sr}, ++ {MS_ECHO_CANCELLER_SET_TAIL_LENGTH, webrtc_aec_set_tail_length}, ++ {MS_ECHO_CANCELLER_SET_DELAY, webrtc_aec_set_delay}, ++ {MS_ECHO_CANCELLER_SET_FRAMESIZE, webrtc_aec_set_framesize}, ++ {MS_ECHO_CANCELLER_SET_BYPASS_MODE, webrtc_aec_set_bypass_mode}, ++ {MS_ECHO_CANCELLER_GET_BYPASS_MODE, webrtc_aec_get_bypass_mode}, ++ {MS_ECHO_CANCELLER_GET_STATE_STRING, webrtc_aec_get_state}, ++ {MS_ECHO_CANCELLER_SET_STATE_STRING, webrtc_aec_set_state}, ++ {0, NULL}}; + + #ifdef BUILD_AEC + +-#define MS_WEBRTC_AEC_NAME "MSWebRTCAEC" ++#define MS_WEBRTC_AEC_NAME "MSWebRTCAEC" + #define MS_WEBRTC_AEC_DESCRIPTION "Echo canceller using WebRTC library." +-#define MS_WEBRTC_AEC_CATEGORY MS_FILTER_OTHER +-#define MS_WEBRTC_AEC_ENC_FMT NULL +-#define MS_WEBRTC_AEC_NINPUTS 2 +-#define MS_WEBRTC_AEC_NOUTPUTS 2 +-#define MS_WEBRTC_AEC_FLAGS 0 ++#define MS_WEBRTC_AEC_CATEGORY MS_FILTER_OTHER ++#define MS_WEBRTC_AEC_ENC_FMT NULL ++#define MS_WEBRTC_AEC_NINPUTS 2 ++#define MS_WEBRTC_AEC_NOUTPUTS 2 ++#define MS_WEBRTC_AEC_FLAGS 0 + + #ifdef _MSC_VER + + MSFilterDesc ms_webrtc_aec_desc = { +- MS_FILTER_PLUGIN_ID, +- MS_WEBRTC_AEC_NAME, +- MS_WEBRTC_AEC_DESCRIPTION, +- MS_WEBRTC_AEC_CATEGORY, +- MS_WEBRTC_AEC_ENC_FMT, +- MS_WEBRTC_AEC_NINPUTS, +- MS_WEBRTC_AEC_NOUTPUTS, +- webrtc_aec_init, +- webrtc_aec_preprocess, +- webrtc_aec_process, +- webrtc_aec_postprocess, +- webrtc_aec_uninit, +- webrtc_aec_methods, +- MS_WEBRTC_AEC_FLAGS +-}; ++ MS_FILTER_PLUGIN_ID, MS_WEBRTC_AEC_NAME, MS_WEBRTC_AEC_DESCRIPTION, ++ MS_WEBRTC_AEC_CATEGORY, MS_WEBRTC_AEC_ENC_FMT, MS_WEBRTC_AEC_NINPUTS, ++ MS_WEBRTC_AEC_NOUTPUTS, webrtc_aec_init, webrtc_aec_preprocess, ++ webrtc_aec_process, webrtc_aec_postprocess, webrtc_aec_uninit, ++ webrtc_aec_methods, MS_WEBRTC_AEC_FLAGS}; + + #else + +-MSFilterDesc ms_webrtc_aec_desc = { +- .id = MS_FILTER_PLUGIN_ID, +- .name = MS_WEBRTC_AEC_NAME, +- .text = MS_WEBRTC_AEC_DESCRIPTION, +- .category = MS_WEBRTC_AEC_CATEGORY, +- .enc_fmt = MS_WEBRTC_AEC_ENC_FMT, +- .ninputs = MS_WEBRTC_AEC_NINPUTS, +- .noutputs = MS_WEBRTC_AEC_NOUTPUTS, +- .init = webrtc_aec_init, +- .preprocess = webrtc_aec_preprocess, +- .process = webrtc_aec_process, +- .postprocess = webrtc_aec_postprocess, +- .uninit = webrtc_aec_uninit, +- .methods = webrtc_aec_methods, +- .flags = MS_WEBRTC_AEC_FLAGS +-}; ++MSFilterDesc ms_webrtc_aec_desc = {.id = MS_FILTER_PLUGIN_ID, ++ .name = MS_WEBRTC_AEC_NAME, ++ .text = MS_WEBRTC_AEC_DESCRIPTION, ++ .category = MS_WEBRTC_AEC_CATEGORY, ++ .enc_fmt = MS_WEBRTC_AEC_ENC_FMT, ++ .ninputs = MS_WEBRTC_AEC_NINPUTS, ++ .noutputs = MS_WEBRTC_AEC_NOUTPUTS, ++ .init = webrtc_aec_init, ++ .preprocess = webrtc_aec_preprocess, ++ .process = webrtc_aec_process, ++ .postprocess = webrtc_aec_postprocess, ++ .uninit = webrtc_aec_uninit, ++ .methods = webrtc_aec_methods, ++ .flags = MS_WEBRTC_AEC_FLAGS}; + + #endif + +@@ -517,51 +535,40 @@ MS_FILTER_DESC_EXPORT(ms_webrtc_aec_desc) + + #ifdef BUILD_AECM + +-#define MS_WEBRTC_AECM_NAME "MSWebRTCAECM" +-#define MS_WEBRTC_AECM_DESCRIPTION "Echo canceller for mobile using WebRTC library." +-#define MS_WEBRTC_AECM_CATEGORY MS_FILTER_OTHER +-#define MS_WEBRTC_AECM_ENC_FMT NULL +-#define MS_WEBRTC_AECM_NINPUTS 2 +-#define MS_WEBRTC_AECM_NOUTPUTS 2 +-#define MS_WEBRTC_AECM_FLAGS 0 ++#define MS_WEBRTC_AECM_NAME "MSWebRTCAECM" ++#define MS_WEBRTC_AECM_DESCRIPTION \ ++ "Echo canceller for mobile using WebRTC library." ++#define MS_WEBRTC_AECM_CATEGORY MS_FILTER_OTHER ++#define MS_WEBRTC_AECM_ENC_FMT NULL ++#define MS_WEBRTC_AECM_NINPUTS 2 ++#define MS_WEBRTC_AECM_NOUTPUTS 2 ++#define MS_WEBRTC_AECM_FLAGS 0 + + #ifdef _MSC_VER + + MSFilterDesc ms_webrtc_aecm_desc = { +- MS_FILTER_PLUGIN_ID, +- MS_WEBRTC_AECM_NAME, +- MS_WEBRTC_AECM_DESCRIPTION, +- MS_WEBRTC_AECM_CATEGORY, +- MS_WEBRTC_AECM_ENC_FMT, +- MS_WEBRTC_AECM_NINPUTS, +- MS_WEBRTC_AECM_NOUTPUTS, +- webrtc_aecm_init, +- webrtc_aec_preprocess, +- webrtc_aec_process, +- webrtc_aec_postprocess, +- webrtc_aec_uninit, +- webrtc_aec_methods, +- MS_WEBRTC_AECM_FLAGS +-}; ++ MS_FILTER_PLUGIN_ID, MS_WEBRTC_AECM_NAME, MS_WEBRTC_AECM_DESCRIPTION, ++ MS_WEBRTC_AECM_CATEGORY, MS_WEBRTC_AECM_ENC_FMT, MS_WEBRTC_AECM_NINPUTS, ++ MS_WEBRTC_AECM_NOUTPUTS, webrtc_aecm_init, webrtc_aec_preprocess, ++ webrtc_aec_process, webrtc_aec_postprocess, webrtc_aec_uninit, ++ webrtc_aec_methods, MS_WEBRTC_AECM_FLAGS}; + + #else + +-MSFilterDesc ms_webrtc_aecm_desc = { +- .id = MS_FILTER_PLUGIN_ID, +- .name = MS_WEBRTC_AECM_NAME, +- .text = MS_WEBRTC_AECM_DESCRIPTION, +- .category = MS_WEBRTC_AECM_CATEGORY, +- .enc_fmt = MS_WEBRTC_AECM_ENC_FMT, +- .ninputs = MS_WEBRTC_AECM_NINPUTS, +- .noutputs = MS_WEBRTC_AECM_NOUTPUTS, +- .init = webrtc_aecm_init, +- .preprocess = webrtc_aec_preprocess, +- .process = webrtc_aec_process, +- .postprocess = webrtc_aec_postprocess, +- .uninit = webrtc_aec_uninit, +- .methods = webrtc_aec_methods, +- .flags = MS_WEBRTC_AECM_FLAGS +-}; ++MSFilterDesc ms_webrtc_aecm_desc = {.id = MS_FILTER_PLUGIN_ID, ++ .name = MS_WEBRTC_AECM_NAME, ++ .text = MS_WEBRTC_AECM_DESCRIPTION, ++ .category = MS_WEBRTC_AECM_CATEGORY, ++ .enc_fmt = MS_WEBRTC_AECM_ENC_FMT, ++ .ninputs = MS_WEBRTC_AECM_NINPUTS, ++ .noutputs = MS_WEBRTC_AECM_NOUTPUTS, ++ .init = webrtc_aecm_init, ++ .preprocess = webrtc_aec_preprocess, ++ .process = webrtc_aec_process, ++ .postprocess = webrtc_aec_postprocess, ++ .uninit = webrtc_aec_uninit, ++ .methods = webrtc_aec_methods, ++ .flags = MS_WEBRTC_AECM_FLAGS}; + + #endif + +-- +GitLab + diff --git a/gnu/packages/patches/mswebrtc-cmake.patch b/gnu/packages/patches/mswebrtc-cmake.patch new file mode 100644 index 0000000000..19d0c31b10 --- /dev/null +++ b/gnu/packages/patches/mswebrtc-cmake.patch @@ -0,0 +1,626 @@ +From e52911c291e5ebe16da764e53cb740b7deb77e75 Mon Sep 17 00:00:00 2001 +From: Ghislain MARY <ghislain.mary@belledonne-communications.com> +Date: Mon, 13 Mar 2023 19:05:30 +0100 +Subject: [PATCH] Update CMakeLists.txt so that the project can be added as a + subdirectory of linphone-sdk. + +Rename CMake targets for uniform naming. +--- + CMakeLists.txt | 68 ++++++++++++++++++---------------- + cmake/FindBcToolbox.cmake | 67 +++++++++++++++++++++++++++++++++ + cmake/FindMediastreamer2.cmake | 46 +++++++++++++++++++++++ + cmake/FindOrtp.cmake | 43 +++++++++++++++++++++ + 4 files changed, 193 insertions(+), 31 deletions(-) + create mode 100644 cmake/FindBcToolbox.cmake + create mode 100644 cmake/FindMediastreamer2.cmake + create mode 100644 cmake/FindOrtp.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0f26f4f..fd5b52e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ + ############################################################################ + # CMakeLists.txt +-# Copyright (C) 2014 Belledonne Communications, Grenoble France ++# Copyright (C) 2014-2023 Belledonne Communications, Grenoble France + # + ############################################################################ + # +@@ -20,7 +20,8 @@ + # + ############################################################################ + +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.22) ++ + project(mswebrtc VERSION 1.1.1 LANGUAGES C CXX) + + +@@ -34,8 +35,6 @@ set(PACKAGE_URL "") + set(VERSION "${PACKAGE_VERSION}") + + +-option(ENABLE_SHARED "Build shared library." YES) +-option(ENABLE_STATIC "Build static library." YES) + option(ENABLE_AEC "Enable the WebRTC echo canceller support." YES) + option(ENABLE_AECM "Enable the WebRTC echo canceller for mobile support." YES) + option(ENABLE_ISAC "Enable the ISAC audio codec support." YES) +@@ -60,9 +59,20 @@ if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX) + message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}") + endif() + +-find_package(Mediastreamer2 REQUIRED CONFIG) +-find_package(ortp REQUIRED CONFIG) +-find_package(bctoolbox REQUIRED CONFIG) ++list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ++ ++find_package(BcToolbox) ++if(NOT BCTOOLBOX_FOUND) ++ find_package(bctoolbox REQUIRED CONFIG) ++endif() ++find_package(Ortp) ++if(NOT ORTP_FOUND) ++ find_package(ortp REQUIRED CONFIG) ++endif() ++find_package(Mediastreamer2) ++if(NOT MEDIASTREAMER2_FOUND) ++ find_package(Mediastreamer2 REQUIRED CONFIG) ++endif() + + find_library(LIBM NAMES m) + +@@ -410,24 +420,18 @@ endif() + + set(MS2_PLUGINS_DIR "${MEDIASTREAMER2_PLUGINS_LOCATION}") + +-if(ENABLE_STATIC) +- add_library(mswebrtc-static STATIC ${SOURCE_FILES}) +- set_target_properties(mswebrtc-static PROPERTIES OUTPUT_NAME mswebrtc) +- set_target_properties(mswebrtc-static PROPERTIES LINKER_LANGUAGE CXX) +- target_link_libraries(mswebrtc-static ${LIBS}) +- install(TARGETS mswebrtc-static +- ARCHIVE DESTINATION "${MS2_PLUGINS_DIR}" +- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- ) +-endif() +-if(ENABLE_SHARED) +- if(NOT IOS) +- add_library(mswebrtc MODULE ${SOURCE_FILES}) +- else() ++if(BUILD_SHARED_LIBS) ++ if(IOS) + add_library(mswebrtc SHARED ${SOURCE_FILES}) ++ else() ++ add_library(mswebrtc MODULE ${SOURCE_FILES}) + endif() +- target_link_libraries(mswebrtc PRIVATE mediastreamer ortp bctoolbox ${LIBS}) +- set_target_properties(mswebrtc PROPERTIES LINKER_LANGUAGE CXX) ++else() ++ add_library(mswebrtc STATIC ${SOURCE_FILES}) ++endif() ++target_link_libraries(mswebrtc PRIVATE mediastreamer2 ortp bctoolbox ${LIBS}) ++set_target_properties(mswebrtc PROPERTIES LINKER_LANGUAGE CXX) ++if(BUILD_SHARED_LIBS) + if(APPLE) + if(IOS) + set(MIN_OS ${LINPHONE_IOS_DEPLOYMENT_TARGET}) +@@ -441,7 +445,7 @@ if(ENABLE_SHARED) + set(MIN_OS ${CMAKE_OSX_DEPLOYMENT_TARGET}) + endif() + +- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/osx/") ++ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/build/osx/") + endif() + if(MSVC) + if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") +@@ -454,14 +458,16 @@ if(ENABLE_SHARED) + set_target_properties(mswebrtc PROPERTIES PREFIX "lib") + endif() + endif() +- install(TARGETS mswebrtc +- RUNTIME DESTINATION ${MS2_PLUGINS_DIR} +- LIBRARY DESTINATION ${MS2_PLUGINS_DIR} +- ARCHIVE DESTINATION ${MS2_PLUGINS_DIR} +- FRAMEWORK DESTINATION Frameworks +- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +- ) + endif() + ++install(TARGETS mswebrtc ++ RUNTIME DESTINATION ${MS2_PLUGINS_DIR} ++ LIBRARY DESTINATION ${MS2_PLUGINS_DIR} ++ ARCHIVE DESTINATION ${MS2_PLUGINS_DIR} ++ FRAMEWORK DESTINATION Frameworks ++ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ++) ++ ++ + add_subdirectory(build) + +diff --git a/cmake/FindBcToolbox.cmake b/cmake/FindBcToolbox.cmake +new file mode 100644 +index 0000000..5766478 +--- /dev/null ++++ b/cmake/FindBcToolbox.cmake +@@ -0,0 +1,67 @@ ++############################################################################ ++# FindBctoolbox.cmake ++# Copyright (C) 2023 Belledonne Communications, Grenoble France ++# ++############################################################################ ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License ++# as published by the Free Software Foundation; either version 2 ++# of the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# ++############################################################################ ++# ++# - Find the bctoolbox include files and library ++# ++# BCTOOLBOX_FOUND - System has lib bctoolbox ++# BCTOOLBOX_INCLUDE_DIRS - The bctoolbox include directories ++# BCTOOLBOX_LIBRARIES - The libraries needed to use bctoolbox ++# BCTOOLBOX_CMAKE_DIR - The bctoolbox cmake directory ++# BCTOOLBOX_CORE_FOUND - System has core bctoolbox ++# BCTOOLBOX_CORE_INCLUDE_DIRS - The core bctoolbox include directories ++# BCTOOLBOX_CORE_LIBRARIES - The core bctoolbox libraries ++# BCTOOLBOX_TESTER_FOUND - System has bctoolbox tester ++# BCTOOLBOX_TESTER_INCLUDE_DIRS - The bctoolbox tester include directories ++# BCTOOLBOX_TESTER_LIBRARIES - The bctoolbox tester libraries ++ ++if(TARGET bctoolbox) ++ ++ set(BCTOOLBOX_CORE_LIBRARIES bctoolbox) ++ get_target_property(BCTOOLBOX_CORE_INCLUDE_DIRS bctoolbox INTERFACE_INCLUDE_DIRECTORIES) ++ set(BCTOOLBOX_CORE_FOUND TRUE) ++ get_target_property(BCTOOLBOX_SOURCE_DIR bctoolbox SOURCE_DIR) ++ set(BCTOOLBOX_CMAKE_DIR "${BCTOOLBOX_SOURCE_DIR}/../cmake") ++ if(TARGET bctoolbox-tester) ++ set(BCTOOLBOX_TESTER_LIBRARIES bctoolbox-tester) ++ get_target_property(BCTOOLBOX_TESTER_INCLUDE_DIRS bctoolbox-tester INTERFACE_INCLUDE_DIRECTORIES) ++ set(BCTOOLBOX_TESTER_FOUND TRUE) ++ set(BCTOOLBOX_TESTER_COMPONENT_VARIABLES BCTOOLBOX_TESTER_FOUND BCTOOLBOX_TESTER_INCLUDE_DIRS BCTOOLBOX_TESTER_LIBRARIES) ++ endif() ++ set(BCTOOLBOX_LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BCTOOLBOX_TESTER_LIBRARIES}) ++ set(BCTOOLBOX_INCLUDE_DIRS ${BCTOOLBOX_CORE_INCLUDE_DIRS} ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) ++ ++ ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(BcToolbox ++ DEFAULT_MSG ++ BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR ++ BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES ++ ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} ++ ) ++ ++ mark_as_advanced( ++ BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR ++ BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES ++ ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} ++ ) ++ ++endif() +diff --git a/cmake/FindMediastreamer2.cmake b/cmake/FindMediastreamer2.cmake +new file mode 100644 +index 0000000..64ac8f2 +--- /dev/null ++++ b/cmake/FindMediastreamer2.cmake +@@ -0,0 +1,46 @@ ++############################################################################ ++# FindMediastreamer2.cmake ++# Copyright (C) 2023 Belledonne Communications, Grenoble France ++# ++############################################################################ ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License ++# as published by the Free Software Foundation; either version 2 ++# of the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# ++############################################################################ ++# ++# - Find the mediastreamer2 include files and library ++# ++# MEDIASTREAMER2_FOUND - system has lib mediastreamer2 ++# MEDIASTREAMER2_INCLUDE_DIRS - the mediasteamer2 include directory ++# MEDIASTREAMER2_LIBRARIES - The library needed to use mediasteamer2 ++# MEDIASTREAMER2_PLUGINS_LOCATION - The location of the mediastreamer2 plugins ++ ++if(TARGET mediastreamer2) ++ ++ set(MEDIASTREAMER2_LIBRARIES mediastreamer2) ++ get_target_property(MEDIASTREAMER2_INCLUDE_DIRS mediastreamer2 INTERFACE_INCLUDE_DIRECTORIES) ++ define_property(TARGET PROPERTY "MS2_PLUGINS" BRIEF_DOCS "Stores the location of mediastreamer2 plugins" FULL_DOCS "Stores the location of mediastreamer2 plugins") ++ get_target_property(MEDIASTREAMER2_PLUGINS_LOCATION mediastreamer2 MS2_PLUGINS) ++ ++ ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(Mediastreamer2 ++ DEFAULT_MSG ++ MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES ++ ) ++ ++ mark_as_advanced(MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES) ++ ++endif() +diff --git a/cmake/FindOrtp.cmake b/cmake/FindOrtp.cmake +new file mode 100644 +index 0000000..13121fb +--- /dev/null ++++ b/cmake/FindOrtp.cmake +@@ -0,0 +1,43 @@ ++############################################################################ ++# FindOrtp.cmake ++# Copyright (C) 2023 Belledonne Communications, Grenoble France ++# ++############################################################################ ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License ++# as published by the Free Software Foundation; either version 2 ++# of the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# ++############################################################################ ++# ++# - Find the ortp include files and library ++# ++# ORTP_FOUND - system has lib ortp ++# ORTP_INCLUDE_DIRS - the ortp include directory ++# ORTP_LIBRARIES - The library needed to use ortp ++ ++if(TARGET ortp) ++ ++ set(ORTP_LIBRARIES ortp) ++ get_target_property(ORTP_INCLUDE_DIRS ortp INTERFACE_INCLUDE_DIRECTORIES) ++ ++ ++ include(FindPackageHandleStandardArgs) ++ find_package_handle_standard_args(Ortp ++ DEFAULT_MSG ++ ORTP_INCLUDE_DIRS ORTP_LIBRARIES ++ ) ++ ++ mark_as_advanced(ORTP_INCLUDE_DIRS ORTP_LIBRARIES) ++ ++endif() +-- +GitLab + +From b5aea9bdaeecd99f6fc5601bfb88541d4e55841b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= + <mickael.turnel@belledonne-communications.com> +Date: Fri, 23 Jun 2023 11:05:24 +0200 +Subject: [PATCH] Change the library path in the binary dir so it can be + retrieved easily by testers + +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fd5b52e..ab3e651 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -24,6 +24,7 @@ cmake_minimum_required(VERSION 3.22) + + project(mswebrtc VERSION 1.1.1 LANGUAGES C CXX) + ++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/mediastreamer2/plugins") + + set(PACKAGE "${PROJECT_NAME}") + set(PACKAGE_NAME "${PROJECT_NAME}") +-- +GitLab + +From 1809337d6191ec40f88191b5ce07cfb01ed07b20 Mon Sep 17 00:00:00 2001 +From: Ghislain MARY <ghislain.mary@belledonne-communications.com> +Date: Tue, 20 Jun 2023 11:47:00 +0200 +Subject: [PATCH] Improve CMake find_package functionality. + +--- + CMakeLists.txt | 30 ++++----------- + build/CMakeLists.txt | 3 +- + cmake/FindBcToolbox.cmake | 67 ---------------------------------- + cmake/FindMediastreamer2.cmake | 46 ----------------------- + cmake/FindOrtp.cmake | 43 ---------------------- + 5 files changed, 10 insertions(+), 179 deletions(-) + delete mode 100644 cmake/FindBcToolbox.cmake + delete mode 100644 cmake/FindMediastreamer2.cmake + delete mode 100644 cmake/FindOrtp.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ab3e651..a869908 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,7 +22,7 @@ + + cmake_minimum_required(VERSION 3.22) + +-project(mswebrtc VERSION 1.1.1 LANGUAGES C CXX) ++project(MSWebRTC VERSION 1.1.1 LANGUAGES C CXX) + + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/mediastreamer2/plugins") + +@@ -60,20 +60,8 @@ if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX) + message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}") + endif() + +-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +- +-find_package(BcToolbox) +-if(NOT BCTOOLBOX_FOUND) +- find_package(bctoolbox REQUIRED CONFIG) +-endif() +-find_package(Ortp) +-if(NOT ORTP_FOUND) +- find_package(ortp REQUIRED CONFIG) +-endif() +-find_package(Mediastreamer2) +-if(NOT MEDIASTREAMER2_FOUND) +- find_package(Mediastreamer2 REQUIRED CONFIG) +-endif() ++find_package(BCToolbox 5.3.0 REQUIRED) ++find_package(Mediastreamer2 5.3.0 REQUIRED) + + find_library(LIBM NAMES m) + +@@ -92,7 +80,7 @@ endif() + if(ENABLE_VAD) + set(BUILD_VAD 1) + endif() +-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) ++configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h") + + set(WEBRTC_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/webrtc") + set(WEBRTC_SRC_DIR "${WEBRTC_ROOT_DIR}/webrtc") +@@ -419,8 +407,6 @@ if(LIBM) + list(APPEND LIBS ${LIBM}) + endif() + +-set(MS2_PLUGINS_DIR "${MEDIASTREAMER2_PLUGINS_LOCATION}") +- + if(BUILD_SHARED_LIBS) + if(IOS) + add_library(mswebrtc SHARED ${SOURCE_FILES}) +@@ -430,7 +416,7 @@ if(BUILD_SHARED_LIBS) + else() + add_library(mswebrtc STATIC ${SOURCE_FILES}) + endif() +-target_link_libraries(mswebrtc PRIVATE mediastreamer2 ortp bctoolbox ${LIBS}) ++target_link_libraries(mswebrtc PRIVATE ${Mediastreamer2_TARGET} ${LIBS}) + set_target_properties(mswebrtc PROPERTIES LINKER_LANGUAGE CXX) + if(BUILD_SHARED_LIBS) + if(APPLE) +@@ -462,9 +448,9 @@ if(BUILD_SHARED_LIBS) + endif() + + install(TARGETS mswebrtc +- RUNTIME DESTINATION ${MS2_PLUGINS_DIR} +- LIBRARY DESTINATION ${MS2_PLUGINS_DIR} +- ARCHIVE DESTINATION ${MS2_PLUGINS_DIR} ++ RUNTIME DESTINATION ${Mediastreamer2_PLUGINS_DIR} ++ LIBRARY DESTINATION ${Mediastreamer2_PLUGINS_DIR} ++ ARCHIVE DESTINATION ${Mediastreamer2_PLUGINS_DIR} + FRAMEWORK DESTINATION Frameworks + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) +diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt +index 82694c6..8f9108b 100755 +--- a/build/CMakeLists.txt ++++ b/build/CMakeLists.txt +@@ -21,7 +21,8 @@ + ############################################################################ + + if(NOT CPACK_PACKAGE_NAME) +- set(CPACK_PACKAGE_NAME "${PROJECT_NAME}") ++ string(TOLOWER "${PROJECT_NAME}" LOWERCASE_PROJECT_NAME) ++ set(CPACK_PACKAGE_NAME "${LOWERCASE_PROJECT_NAME}") + endif() + + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../COPYING") +diff --git a/cmake/FindBcToolbox.cmake b/cmake/FindBcToolbox.cmake +deleted file mode 100644 +index 5766478..0000000 +--- a/cmake/FindBcToolbox.cmake ++++ /dev/null +@@ -1,67 +0,0 @@ +-############################################################################ +-# FindBctoolbox.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the bctoolbox include files and library +-# +-# BCTOOLBOX_FOUND - System has lib bctoolbox +-# BCTOOLBOX_INCLUDE_DIRS - The bctoolbox include directories +-# BCTOOLBOX_LIBRARIES - The libraries needed to use bctoolbox +-# BCTOOLBOX_CMAKE_DIR - The bctoolbox cmake directory +-# BCTOOLBOX_CORE_FOUND - System has core bctoolbox +-# BCTOOLBOX_CORE_INCLUDE_DIRS - The core bctoolbox include directories +-# BCTOOLBOX_CORE_LIBRARIES - The core bctoolbox libraries +-# BCTOOLBOX_TESTER_FOUND - System has bctoolbox tester +-# BCTOOLBOX_TESTER_INCLUDE_DIRS - The bctoolbox tester include directories +-# BCTOOLBOX_TESTER_LIBRARIES - The bctoolbox tester libraries +- +-if(TARGET bctoolbox) +- +- set(BCTOOLBOX_CORE_LIBRARIES bctoolbox) +- get_target_property(BCTOOLBOX_CORE_INCLUDE_DIRS bctoolbox INTERFACE_INCLUDE_DIRECTORIES) +- set(BCTOOLBOX_CORE_FOUND TRUE) +- get_target_property(BCTOOLBOX_SOURCE_DIR bctoolbox SOURCE_DIR) +- set(BCTOOLBOX_CMAKE_DIR "${BCTOOLBOX_SOURCE_DIR}/../cmake") +- if(TARGET bctoolbox-tester) +- set(BCTOOLBOX_TESTER_LIBRARIES bctoolbox-tester) +- get_target_property(BCTOOLBOX_TESTER_INCLUDE_DIRS bctoolbox-tester INTERFACE_INCLUDE_DIRECTORIES) +- set(BCTOOLBOX_TESTER_FOUND TRUE) +- set(BCTOOLBOX_TESTER_COMPONENT_VARIABLES BCTOOLBOX_TESTER_FOUND BCTOOLBOX_TESTER_INCLUDE_DIRS BCTOOLBOX_TESTER_LIBRARIES) +- endif() +- set(BCTOOLBOX_LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BCTOOLBOX_TESTER_LIBRARIES}) +- set(BCTOOLBOX_INCLUDE_DIRS ${BCTOOLBOX_CORE_INCLUDE_DIRS} ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) +- +- +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(BcToolbox +- DEFAULT_MSG +- BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR +- BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES +- ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} +- ) +- +- mark_as_advanced( +- BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR +- BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES +- ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} +- ) +- +-endif() +diff --git a/cmake/FindMediastreamer2.cmake b/cmake/FindMediastreamer2.cmake +deleted file mode 100644 +index 64ac8f2..0000000 +--- a/cmake/FindMediastreamer2.cmake ++++ /dev/null +@@ -1,46 +0,0 @@ +-############################################################################ +-# FindMediastreamer2.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the mediastreamer2 include files and library +-# +-# MEDIASTREAMER2_FOUND - system has lib mediastreamer2 +-# MEDIASTREAMER2_INCLUDE_DIRS - the mediasteamer2 include directory +-# MEDIASTREAMER2_LIBRARIES - The library needed to use mediasteamer2 +-# MEDIASTREAMER2_PLUGINS_LOCATION - The location of the mediastreamer2 plugins +- +-if(TARGET mediastreamer2) +- +- set(MEDIASTREAMER2_LIBRARIES mediastreamer2) +- get_target_property(MEDIASTREAMER2_INCLUDE_DIRS mediastreamer2 INTERFACE_INCLUDE_DIRECTORIES) +- define_property(TARGET PROPERTY "MS2_PLUGINS" BRIEF_DOCS "Stores the location of mediastreamer2 plugins" FULL_DOCS "Stores the location of mediastreamer2 plugins") +- get_target_property(MEDIASTREAMER2_PLUGINS_LOCATION mediastreamer2 MS2_PLUGINS) +- +- +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(Mediastreamer2 +- DEFAULT_MSG +- MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES +- ) +- +- mark_as_advanced(MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES) +- +-endif() +diff --git a/cmake/FindOrtp.cmake b/cmake/FindOrtp.cmake +deleted file mode 100644 +index 13121fb..0000000 +--- a/cmake/FindOrtp.cmake ++++ /dev/null +@@ -1,43 +0,0 @@ +-############################################################################ +-# FindOrtp.cmake +-# Copyright (C) 2023 Belledonne Communications, Grenoble France +-# +-############################################################################ +-# +-# This program is free software; you can redistribute it and/or +-# modify it under the terms of the GNU General Public License +-# as published by the Free Software Foundation; either version 2 +-# of the License, or (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +-# +-############################################################################ +-# +-# - Find the ortp include files and library +-# +-# ORTP_FOUND - system has lib ortp +-# ORTP_INCLUDE_DIRS - the ortp include directory +-# ORTP_LIBRARIES - The library needed to use ortp +- +-if(TARGET ortp) +- +- set(ORTP_LIBRARIES ortp) +- get_target_property(ORTP_INCLUDE_DIRS ortp INTERFACE_INCLUDE_DIRECTORIES) +- +- +- include(FindPackageHandleStandardArgs) +- find_package_handle_standard_args(Ortp +- DEFAULT_MSG +- ORTP_INCLUDE_DIRS ORTP_LIBRARIES +- ) +- +- mark_as_advanced(ORTP_INCLUDE_DIRS ORTP_LIBRARIES) +- +-endif() +-- +GitLab + diff --git a/gnu/packages/patches/nyacc-binary-literals.patch b/gnu/packages/patches/nyacc-binary-literals.patch deleted file mode 100644 index 8159d74032..0000000000 --- a/gnu/packages/patches/nyacc-binary-literals.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6a08014b77bf435f025ecdac08396580b85f159a Mon Sep 17 00:00:00 2001 -From: Jan Nieuwenhuizen <janneke@gnu.org> -Date: Sat, 8 Sep 2018 20:22:45 +0200 -Subject: [PATCH] fix binary literals. - ---- - module/nyacc/lex.scm | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/module/nyacc/lex.scm b/module/nyacc/lex.scm -index 2ec9895..b205212 100644 ---- a/module/nyacc/lex.scm -+++ b/module/nyacc/lex.scm -@@ -345,10 +345,11 @@ - ((char-numeric? ch) (iter chl '$fixed ba 1 ch)) - ((char=? #\. ch) (iter (cons ch chl) #f ba 15 (read-char))) - (else #f))) -- ((10) ;; allow x after 0 -+ ((10) ;; allow x, b after 0 - (cond - ((eof-object? ch) (iter chl ty ba 5 ch)) - ((char=? #\x ch) (iter (cons ch chl) ty 16 1 (read-char))) -+ ((char=? #\b ch) (iter (cons ch chl) ty 2 1 (read-char))) - (else (iter chl ty ba 1 ch)))) - ((15) ;; got `.' only - (cond --- -2.18.0 - diff --git a/gnu/packages/patches/soci-mysql-ddl-types.patch b/gnu/packages/patches/soci-mysql-ddl-types.patch new file mode 100644 index 0000000000..e92fb117d1 --- /dev/null +++ b/gnu/packages/patches/soci-mysql-ddl-types.patch @@ -0,0 +1,15 @@ +Description: Add two unusual column type entries to make liblinphone work +Author: Dennis Filder <d.filder@web.de> +Bug-Debian: https://bugs.debian.org/984534 +Last-Update: 2021-03-10 +--- a/src/backends/sqlite3/statement.cpp ++++ b/src/backends/sqlite3/statement.cpp +@@ -440,6 +440,8 @@ + m["mediumint"] = dt_integer; + m["smallint"] = dt_integer; + m["tinyint"] = dt_integer; ++ m["tinyintunsigned"] = dt_integer; ++ m["intunsigned"] = dt_integer; + + // dt_long_long + m["bigint"] = dt_long_long; diff --git a/gnu/packages/patches/zig-0.15-fix-runpath.patch b/gnu/packages/patches/zig-0.15-fix-runpath.patch new file mode 100644 index 0000000000..7216c97b57 --- /dev/null +++ b/gnu/packages/patches/zig-0.15-fix-runpath.patch @@ -0,0 +1,122 @@ +From d35c341322f6e84607350058007bd5be3d1d294a Mon Sep 17 00:00:00 2001 +From: Hilton Chain <hako@ultrarare.space> +Date: Fri, 29 Nov 2024 14:13:46 +0800 +Subject: [PATCH] Fix RUNPATH issue. + +Add needed libraries and libc to RUNPATH when CROSS_LIBRARY_PATH or LIBRARY_PATH +is set. +--- + lib/std/Build/Step/Compile.zig | 2 ++ + src/link/Elf.zig | 7 +++++++ + src/link/Lld.zig | 7 +++++++ + src/main.zig | 34 +++++++++++++++++++++++++++++++++- + 4 files changed, 49 insertions(+), 1 deletion(-) + +diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig +index 79d3694c02..7f6bddbea6 100644 +--- a/lib/std/Build/Step/Compile.zig ++++ b/lib/std/Build/Step/Compile.zig +@@ -794,6 +794,8 @@ fn runPkgConfig(compile: *Compile, lib_name: []const u8) !PkgConfigResult { + try zig_cflags.append(arg); + } else if (mem.startsWith(u8, arg, wl_rpath_prefix)) { + try zig_cflags.appendSlice(&[_][]const u8{ "-rpath", arg[wl_rpath_prefix.len..] }); ++ } else if (mem.startsWith(u8, arg, "-Wl,-rpath=")) { ++ try zig_libs.appendSlice(&[_][]const u8{ "-L", arg["-Wl,-rpath=".len..] }); + } else if (b.debug_pkg_config) { + return compile.step.fail("unknown pkg-config flag '{s}'", .{arg}); + } +diff --git a/src/link/Elf.zig b/src/link/Elf.zig +index 99d0ad71b0..8017f4c088 100644 +--- a/src/link/Elf.zig ++++ b/src/link/Elf.zig +@@ -988,6 +988,13 @@ fn dumpArgvInit(self: *Elf, arena: Allocator) !void { + try argv.appendSlice(gpa, &.{ "-rpath", rpath }); + } + ++ if (std.zig.system.NativePaths.isGuix(arena) and comp.config.link_libc and comp.config.link_mode == .dynamic) { ++ if (self.base.comp.libc_installation) |libc_installation| { ++ try argv.append(gpa, "-rpath"); ++ try argv.append(gpa, libc_installation.crt_dir.?); ++ } ++ } ++ + try argv.appendSlice(gpa, &.{ + "-z", + try std.fmt.allocPrint(arena, "stack-size={d}", .{self.base.stack_size}), +diff --git a/src/link/Lld.zig b/src/link/Lld.zig +index 48872f7077..814f661692 100644 +--- a/src/link/Lld.zig ++++ b/src/link/Lld.zig +@@ -1071,6 +1071,13 @@ fn elfLink(lld: *Lld, arena: Allocator) !void { + } + } + ++ if (std.zig.system.NativePaths.isGuix(arena) and comp.config.link_libc and link_mode == .dynamic) { ++ if (comp.libc_installation) |libc_installation| { ++ try argv.append("-rpath"); ++ try argv.append(libc_installation.crt_dir.?); ++ } ++ } ++ + if (have_dynamic_linker and + (comp.config.link_libc or comp.root_mod.resolved_target.is_explicit_dynamic_linker)) + { +diff --git a/src/main.zig b/src/main.zig +index 02b1b8f84b..ddc4ae8014 100644 +--- a/src/main.zig ++++ b/src/main.zig +@@ -3910,7 +3910,7 @@ fn createModule( + create_module.want_native_include_dirs = true; + } + +- if (create_module.each_lib_rpath orelse resolved_target.is_native_os) { ++ if (create_module.each_lib_rpath orelse false) { + try create_module.rpath_list.ensureUnusedCapacity(arena, create_module.lib_directories.items.len); + for (create_module.lib_directories.items) |lib_directory| { + create_module.rpath_list.appendAssumeCapacity(lib_directory.path.?); +@@ -3982,6 +3982,28 @@ fn createModule( + else => {}, + }; + ++ if (std.zig.system.NativePaths.isGuix(arena)) { ++ for (create_module.link_inputs.items) |link_input| { ++ if (link_input.path()) |lib| { ++ const lib_name = lib.sub_path; ++ if (Compilation.classifyFileExt(lib_name) == .shared_library) { ++ if (fs.path.isAbsolute(lib_name)) { ++ const lib_dir_path = fs.path.dirname(lib_name).?; ++ try create_module.rpath_list.append(arena, lib_dir_path); ++ continue; ++ } ++ for (create_module.lib_directories.items) |lib_dir| { ++ const lib_dir_path = lib_dir.path.?; ++ if (try libPathExists(arena, lib_dir_path, lib_name)) { ++ try create_module.rpath_list.append(arena, lib_dir_path); ++ break; ++ } ++ } ++ } ++ } ++ } ++ } ++ + create_module.resolved_options = Compilation.Config.resolve(create_module.opts) catch |err| switch (err) { + error.WasiExecModelRequiresWasi => fatal("only WASI OS targets support execution model", .{}), + error.SharedMemoryIsWasmOnly => fatal("only WebAssembly CPU targets support shared memory", .{}), +@@ -7633,3 +7655,13 @@ fn addLibDirectoryWarn2( + .path = path, + }); + } ++ ++fn libPathExists(arena: Allocator, lib_dir_path: []const u8, lib_name: []const u8) !bool { ++ const lib_path = try std.fmt.allocPrint(arena, "{s}{s}{s}", .{ ++ lib_dir_path, ++ fs.path.sep_str, ++ lib_name, ++ }); ++ fs.cwd().access(lib_path, .{}) catch return false; ++ return true; ++} +-- +2.50.1 + |