diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2022-12-22 17:51:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-22 17:51:41 -0500 |
commit | 379949a549d739293aba13a1fb56c568004f3d58 (patch) | |
tree | c9950fae033349b08f73ab15b34a27fafe6449ad /pkgs/development | |
parent | 01e42501066afe76a53b7bf9a16cca7f6121a8a1 (diff) | |
parent | 6f2d0134d154897f3888792533cccd6ea87d7fc9 (diff) |
Merge pull request #206798 from wegank/grpc-aarch64-linux
google-cloud-cpp: fix build on aarch64-linux
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/libraries/arrow-cpp/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/libraries/google-cloud-cpp/default.nix | 2 | ||||
-rw-r--r-- | pkgs/development/libraries/grpc/default.nix | 45 |
3 files changed, 25 insertions, 24 deletions
diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix index 81e5763aa3eb..f5e88b1203ac 100644 --- a/pkgs/development/libraries/arrow-cpp/default.nix +++ b/pkgs/development/libraries/arrow-cpp/default.nix @@ -206,7 +206,7 @@ stdenv.mkDerivation rec { "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables ] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF" ++ lib.optional enableS3 "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp}/include/aws/core/Aws.h" - ++ lib.optionals enableGcs [ "-DCMAKE_CXX_STANDARD=17" ]; + ++ lib.optionals enableGcs [ "-DCMAKE_CXX_STANDARD=${grpc.cxxStandard}" ]; doInstallCheck = true; ARROW_TEST_DATA = lib.optionalString doInstallCheck "${arrow-testing}/data"; diff --git a/pkgs/development/libraries/google-cloud-cpp/default.nix b/pkgs/development/libraries/google-cloud-cpp/default.nix index 3ffaedb6b729..be6da726456a 100644 --- a/pkgs/development/libraries/google-cloud-cpp/default.nix +++ b/pkgs/development/libraries/google-cloud-cpp/default.nix @@ -117,7 +117,7 @@ stdenv.mkDerivation rec { # this adds a good chunk of time to the build "-DBUILD_TESTING:BOOL=ON" "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF" - "-DCMAKE_CXX_STANDARD=17" + "-DCMAKE_CXX_STANDARD=${grpc.cxxStandard}" ] ++ lib.optionals (apis != [ "*" ]) [ "-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}" ]; diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index b924f3f51d34..8a3a936b1453 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -54,28 +54,18 @@ stdenv.mkDerivation rec { buildInputs = [ openssl protobuf ] ++ lib.optionals stdenv.isLinux [ libnsl ]; - cmakeFlags = - let - # 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 - useLLVMAndOldCC = (stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0"; - # With GCC 9 (current aarch64-linux) it fails with c++17 but OK with c++14. - useOldGCC = !(stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "10"; - cxxStandard = if useLLVMAndOldCC then "11" else if useOldGCC then "14" else "17"; - in - [ - "-DgRPC_ZLIB_PROVIDER=package" - "-DgRPC_CARES_PROVIDER=package" - "-DgRPC_RE2_PROVIDER=package" - "-DgRPC_SSL_PROVIDER=package" - "-DgRPC_PROTOBUF_PROVIDER=package" - "-DgRPC_ABSL_PROVIDER=package" - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_CXX_STANDARD=${cxxStandard}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" - ]; + cmakeFlags = [ + "-DgRPC_ZLIB_PROVIDER=package" + "-DgRPC_CARES_PROVIDER=package" + "-DgRPC_RE2_PROVIDER=package" + "-DgRPC_SSL_PROVIDER=package" + "-DgRPC_PROTOBUF_PROVIDER=package" + "-DgRPC_ABSL_PROVIDER=package" + "-DBUILD_SHARED_LIBS=ON" + "-DCMAKE_CXX_STANDARD=${passthru.cxxStandard}" + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" + ]; # CMake creates a build directory by default, this conflicts with the # basel BUILD file on case-insensitive filesystems. @@ -97,6 +87,17 @@ stdenv.mkDerivation rec { enableParallelBuilds = true; + passthru.cxxStandard = + let + # 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 + useLLVMAndOldCC = (stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0"; + # With GCC 9 (current aarch64-linux) it fails with c++17 but OK with c++14. + useOldGCC = !(stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "10"; + in + (if useLLVMAndOldCC then "11" else if useOldGCC then "14" else "17"); + passthru.tests = { inherit (python3.pkgs) grpcio-status grpcio-tools; inherit arrow-cpp; |