lol

Merge pull request #259771 from lorenz/liblinphone-qr

liblinphone: add back QR support

authored by

Weijia Wang and committed by
GitHub
1ebdfa7d aae6b0bd

+106 -1
+98
pkgs/development/libraries/liblinphone/backport-cpp17.patch
··· 1 + From 9ece6e77dcf6545c3b8104068302c6243e3a5e88 Mon Sep 17 00:00:00 2001 2 + From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= 3 + <mickael.turnel@belledonne-communications.com> 4 + Date: Wed, 1 Mar 2023 09:14:53 +0100 5 + Subject: [PATCH] Set c++ version 17 and fix compilation errors 6 + 7 + Backported-by: Lorenz Brun <lorenz@brun.one> 8 + 9 + --- 10 + CMakeLists.txt | 2 +- 11 + daemon/daemon.cc | 2 +- 12 + libxsd/xsd/cxx/config.hxx | 2 +- 13 + src/conference/session/streams-group.cpp | 10 +++++----- 14 + 4 files changed, 8 insertions(+), 8 deletions(-) 15 + 16 + diff --git a/CMakeLists.txt b/CMakeLists.txt 17 + index 475ff16a8..a771e4595 100644 18 + --- a/CMakeLists.txt 19 + +++ b/CMakeLists.txt 20 + @@ -92,7 +92,7 @@ cmake_dependent_option(ENABLE_QRCODE "Enable QRCode support" YES "ENABLE_VIDEO" 21 + # * DISABLE_BC_PACKAGE_SEARCH: skip find_package() for every BC package (bctoolbox, ortp, etc.) 22 + # * DISABLE_SOCI_PACKAGE_SEARCH: skip find_package() for Soci. 23 + 24 + -set(CMAKE_CXX_STANDARD 14) 25 + +set(CMAKE_CXX_STANDARD 17) 26 + set(CMAKE_CXX_EXTENSIONS NO) 27 + 28 + if(NOT CMAKE_BUILD_TYPE) 29 + diff --git a/daemon/daemon.cc b/daemon/daemon.cc 30 + index 197fc22ef..fd09edb26 100644 31 + --- a/daemon/daemon.cc 32 + +++ b/daemon/daemon.cc 33 + @@ -628,7 +628,7 @@ void Daemon::execCommand(const string &command) { 34 + ist.get(argsbuf); 35 + string args = argsbuf.str(); 36 + if (!args.empty() && (args[0] == ' ')) args.erase(0, 1); 37 + - list<DaemonCommand*>::iterator it = find_if(mCommands.begin(), mCommands.end(), bind2nd(mem_fun(&DaemonCommand::matches), name)); 38 + + list<DaemonCommand*>::iterator it = find_if(mCommands.begin(), mCommands.end(), [&name](const DaemonCommand *dc) { return dc->matches(name); }); 39 + if (it != mCommands.end()) { 40 + ms_mutex_lock(&mMutex); 41 + (*it)->exec(this, args); 42 + diff --git a/libxsd/xsd/cxx/config.hxx b/libxsd/xsd/cxx/config.hxx 43 + index 076b107f5..385841731 100644 44 + --- a/libxsd/xsd/cxx/config.hxx 45 + +++ b/libxsd/xsd/cxx/config.hxx 46 + @@ -19,7 +19,7 @@ 47 + # endif 48 + #else 49 + # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L 50 + -# ifdef __GNUC__ 51 + +# if defined(__GNUC__) && !defined(__clang__) 52 + # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4 53 + # define XSD_CXX11_NULLPTR 54 + # endif 55 + diff --git a/src/conference/session/streams-group.cpp b/src/conference/session/streams-group.cpp 56 + index bff739dda..84277a6b7 100644 57 + --- a/src/conference/session/streams-group.cpp 58 + +++ b/src/conference/session/streams-group.cpp 59 + @@ -447,11 +447,11 @@ float StreamsGroup::computeOverallQuality(_functor func){ 60 + } 61 + 62 + float StreamsGroup::getAverageQuality(){ 63 + - return computeOverallQuality(mem_fun(&Stream::getAverageQuality)); 64 + + return computeOverallQuality(mem_fn(&Stream::getAverageQuality)); 65 + } 66 + 67 + float StreamsGroup::getCurrentQuality(){ 68 + - return computeOverallQuality(mem_fun(&Stream::getCurrentQuality)); 69 + + return computeOverallQuality(mem_fn(&Stream::getCurrentQuality)); 70 + } 71 + 72 + int StreamsGroup::getAvpfRrInterval()const{ 73 + @@ -481,11 +481,11 @@ bool StreamsGroup::avpfEnabled() const{ 74 + } 75 + 76 + void StreamsGroup::refreshSockets(){ 77 + - forEach<Stream>(mem_fun(&Stream::refreshSockets)); 78 + + forEach<Stream>(mem_fn(&Stream::refreshSockets)); 79 + } 80 + 81 + void StreamsGroup::computeAndReportBandwidth(){ 82 + - forEach<Stream>(mem_fun(&Stream::updateBandwidthReports)); 83 + + forEach<Stream>(mem_fn(&Stream::updateBandwidthReports)); 84 + 85 + if (!bctbx_log_level_enabled(BCTBX_LOG_DOMAIN, BCTBX_LOG_MESSAGE)) return; 86 + 87 + @@ -540,7 +540,7 @@ void StreamsGroup::finish(){ 88 + mIceService->finish(); // finish ICE first, as it has actions on the streams. 89 + for (auto & ss : mSharedServices) ss.second->checkDestroy(); 90 + mSharedServices.clear(); 91 + - forEach<Stream>(mem_fun(&Stream::finish)); 92 + + forEach<Stream>(mem_fn(&Stream::finish)); 93 + mFinished = true; 94 + } 95 + 96 + -- 97 + 2.41.0 98 +
+8 -1
pkgs/development/libraries/liblinphone/default.nix
··· 13 13 , sqlite 14 14 , stdenv 15 15 , xercesc 16 + , zxing-cpp 16 17 }: 17 18 18 19 stdenv.mkDerivation rec { ··· 28 29 hash = "sha256-kQZePMa7MTaSJLEObM8khfSFYLqhlgTcVyKfTPLwKYU="; 29 30 }; 30 31 32 + patches = [ 33 + # zxing-cpp 2.0+ requires C++ 17 34 + # Manual backport as upstream ran formatters in the meantime 35 + ./backport-cpp17.patch 36 + ]; 37 + 31 38 postPatch = '' 32 39 substituteInPlace src/CMakeLists.txt \ 33 40 --replace "jsoncpp_object" "jsoncpp" \ ··· 38 45 "-DENABLE_STATIC=NO" # Do not build static libraries 39 46 "-DENABLE_UNIT_TESTS=NO" # Do not build test executables 40 47 "-DENABLE_STRICT=NO" # Do not build with -Werror 41 - "-DENABLE_QRCODE=NO" # Does not build with zxing-cpp 2 42 48 ]; 43 49 44 50 buildInputs = [ ··· 56 62 (python3.withPackages (ps: [ ps.pystache ps.six ])) 57 63 sqlite 58 64 xercesc 65 + zxing-cpp 59 66 ]; 60 67 61 68 nativeBuildInputs = [