Unverified Commit 020d8c50 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

google-cloud-cpp: enable darwin, fix cross (#348317)

parents 3a5940b5 21d546b7
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
, openssl
, pkg-config
, protobuf
, pkgsBuildHost
  # default list of APIs: https://github.com/googleapis/google-cloud-cpp/blob/v1.32.1/CMakeLists.txt#L173
, apis ? [ "*" ]
, staticOnly ? stdenv.hostPlatform.isStatic
@@ -97,14 +98,21 @@ stdenv.mkDerivation rec {
      ''
    );

  installCheckPhase = lib.optionalString doInstallCheck ''
  installCheckPhase = let
    disabledTests = lib.optionalString stdenv.hostPlatform.isDarwin ''
      common_internal_async_connection_ready_test
      bigtable_async_read_stream_test
      bigtable_metadata_update_policy_test
      bigtable_bigtable_benchmark_test
      bigtable_embedded_server_test
    '';
  in ''
    runHook preInstallCheck

    # Disable any integration tests, which need to contact the internet.
    # Also disable the `storage_benchmark_*` tests.
    # With Protobuf < 23.x they require -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_WORKAROUND=ON.
    # With Protobuf >= 23.x they require They require setting -DGOOGLE_CLOUD_CPP_ENABLE_CTYPE_WORKAROUND=OFF
    ctest --label-exclude integration-test --exclude-regex storage_benchmarks_
    ctest \
      --label-exclude integration-test \
      --exclude-from-file <(echo '${disabledTests}')

    runHook postInstallCheck
  '';
@@ -122,6 +130,8 @@ stdenv.mkDerivation rec {
    "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF"
  ] ++ lib.optionals (apis != [ "*" ]) [
    "-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}"
  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
    "-DGOOGLE_CLOUD_CPP_GRPC_PLUGIN_EXECUTABLE=${lib.getBin pkgsBuildHost.grpc}/bin/grpc_cpp_plugin"
  ];

  requiredSystemFeatures = [ "big-parallel" ];
@@ -130,7 +140,7 @@ stdenv.mkDerivation rec {
    license = with licenses; [ asl20 ];
    homepage = "https://github.com/googleapis/google-cloud-cpp";
    description = "C++ Idiomatic Clients for Google Cloud Platform services";
    platforms = [ "x86_64-linux" "aarch64-linux" ];
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
    maintainers = with maintainers; [ cpcloud ];
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -46,8 +46,6 @@ stdenv.mkDerivation (finalAttrs: {
      url = "https://github.com/protocolbuffers/protobuf/commit/a7324f88e92bc16b57f3683403b6c993bf68070b.patch";
      hash = "sha256-SmwaUjOjjZulg/wgNmR/F5b8rhYA2wkKAjHIOxjcQdQ=";
    })
  ] ++ lib.optionals stdenv.hostPlatform.isStatic [
    ./static-executables-have-no-rpath.patch
  ];

  nativeBuildInputs = [
+0 −18
Original line number Diff line number Diff line
diff --git a/cmake/install.cmake b/cmake/install.cmake
index 26a55be8b..b6823c3f9 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -32,13 +32,6 @@ if (protobuf_BUILD_PROTOC_BINARIES)
   install(TARGETS protoc EXPORT protobuf-targets
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc
     BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc)
-  if (UNIX AND NOT APPLE)
-    set_property(TARGET protoc
-      PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
-  elseif (APPLE)
-    set_property(TARGET protoc
-      PROPERTY INSTALL_RPATH "@loader_path/../lib")
-  endif()
 endif (protobuf_BUILD_PROTOC_BINARIES)
 
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/protobuf.pc ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")