From af3444ffc5ad73d5efc351acae8bd0fa79a8c1df Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 31 Oct 2021 06:02:08 -0400 Subject: [PATCH 1/6] abseil-cpp: add cxxStandard input --- pkgs/development/libraries/abseil-cpp/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/abseil-cpp/default.nix b/pkgs/development/libraries/abseil-cpp/default.nix index 072af53757bc..9f532519faec 100644 --- a/pkgs/development/libraries/abseil-cpp/default.nix +++ b/pkgs/development/libraries/abseil-cpp/default.nix @@ -1,4 +1,4 @@ -{ 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 +21,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=${toString cxxStandard}" ]; nativeBuildInputs = [ cmake ]; From f918954e0673c768ff4a3be5f38e3ff555d813bd Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 31 Oct 2021 06:02:34 -0400 Subject: [PATCH 2/6] abseil-cpp: format --- pkgs/development/libraries/abseil-cpp/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/abseil-cpp/default.nix b/pkgs/development/libraries/abseil-cpp/default.nix index 9f532519faec..4836417aafa2 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, cxxStandard ? null }: +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, cmake +, static ? stdenv.hostPlatform.isStatic +, cxxStandard ? null +}: stdenv.mkDerivation rec { pname = "abseil-cpp"; From 1a590c529c847207e510fc614fb790f6bebb25ad Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 31 Oct 2021 06:04:02 -0400 Subject: [PATCH 3/6] grpc: remove explicit cxx17 requirement coming from abseil-cpp --- pkgs/development/libraries/grpc/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index 5d2b58aa3dba..d155826042c8 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -57,14 +57,14 @@ 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 From f506ecdca92d55c99fc3b8d8c7ef2f03218f9386 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Sun, 31 Oct 2021 06:06:06 -0400 Subject: [PATCH 4/6] all-packages: pass cxxStandard to or-tools --- pkgs/development/libraries/abseil-cpp/default.nix | 2 +- pkgs/development/libraries/grpc/default.nix | 3 +-- pkgs/top-level/all-packages.nix | 7 ++++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/abseil-cpp/default.nix b/pkgs/development/libraries/abseil-cpp/default.nix index 4836417aafa2..2ade512de310 100644 --- a/pkgs/development/libraries/abseil-cpp/default.nix +++ b/pkgs/development/libraries/abseil-cpp/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}" ] ++ lib.optionals (cxxStandard != null) [ - "-DCMAKE_CXX_STANDARD=${toString cxxStandard}" + "-DCMAKE_CXX_STANDARD=${cxxStandard}" ]; nativeBuildInputs = [ cmake ]; diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index d155826042c8..8cd26ab31052 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -59,8 +59,7 @@ stdenv.mkDerivation rec { "-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") [ + ] ++ 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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index be13115ad159..171a4c865412 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31181,7 +31181,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 { }; From 76079c145bdce2aef8642eb49190272df279b0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 1 Nov 2021 21:39:41 +0100 Subject: [PATCH 5/6] fcitx5-mozc: fix build --- pkgs/top-level/all-packages.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 171a4c865412..696280ecfd46 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5048,7 +5048,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 { }; From e884e2840e9a6e3b3bffb332514b944e13b85f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 1 Nov 2021 21:49:45 +0100 Subject: [PATCH 6/6] tdesktop: fix build --- .../instant-messengers/telegram/tdesktop/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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";