diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix index d39ac978d8d3..5cbb2d974701 100644 --- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix @@ -29,6 +29,7 @@ , webkitgtk , jemalloc , rnnoise +, abseil-cpp # Transitive dependencies: , util-linuxMinimal , pcre @@ -57,7 +58,11 @@ # - https://github.com/void-linux/void-packages/blob/master/srcpkgs/telegram-desktop/template let - tg_owt = callPackage ./tg_owt.nix { }; + tg_owt = callPackage ./tg_owt.nix { + abseil-cpp = abseil-cpp.override { + cxxStandard = "17"; + }; + }; in mkDerivation rec { pname = "telegram-desktop"; diff --git a/pkgs/development/libraries/abseil-cpp/default.nix b/pkgs/development/libraries/abseil-cpp/default.nix index 072af53757bc..2ade512de310 100644 --- a/pkgs/development/libraries/abseil-cpp/default.nix +++ b/pkgs/development/libraries/abseil-cpp/default.nix @@ -1,4 +1,11 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, static ? stdenv.hostPlatform.isStatic }: +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, cmake +, static ? stdenv.hostPlatform.isStatic +, cxxStandard ? null +}: stdenv.mkDerivation rec { pname = "abseil-cpp"; @@ -21,8 +28,9 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DCMAKE_CXX_STANDARD=17" "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" + ] ++ lib.optionals (cxxStandard != null) [ + "-DCMAKE_CXX_STANDARD=${cxxStandard}" ]; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index 5d2b58aa3dba..8cd26ab31052 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -57,14 +57,13 @@ stdenv.mkDerivation rec { "-DgRPC_ABSL_PROVIDER=package" "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" + ] ++ lib.optionals ((stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0") [ # Needs to be compiled with -std=c++11 for clang < 11. Interestingly this is # only an issue with the useLLVM stdenv, not the darwin stdenv… # https://github.com/grpc/grpc/issues/26473#issuecomment-860885484 - (if (stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0" - then "-DCMAKE_CXX_STANDARD=11" - else "-DCMAKE_CXX_STANDARD=17") - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" + "-DCMAKE_CXX_STANDARD=11" ]; # CMake creates a build directory by default, this conflicts with the diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c9031bddc810..6fb04c959048 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5050,7 +5050,11 @@ with pkgs; fcitx5-chinese-addons = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-chinese-addons.nix { }; - fcitx5-mozc = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { }; + fcitx5-mozc = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-mozc.nix { + abseil-cpp = abseil-cpp.override { + cxxStandard = "17"; + }; + }; fcitx5-configtool = libsForQt5.callPackage ../tools/inputmethods/fcitx5/fcitx5-configtool.nix { }; @@ -31195,7 +31199,12 @@ with pkgs; or-tools = callPackage ../development/libraries/science/math/or-tools { python = python3; - abseil-cpp = abseil-cpp.override { static = true; }; + # or-tools builds with -std=c++17, so abseil-cpp must + # also be built that way + abseil-cpp = abseil-cpp.override { + static = true; + cxxStandard = "17"; + }; }; rubiks = callPackage ../development/libraries/science/math/rubiks { };