summary refs log tree commit diff
path: root/pkgs/development/libraries/google-cloud-cpp/default.nix
diff options
context:
space:
mode:
authorPhillip Cloud <417981+cpcloud@users.noreply.github.com>2021-10-29 12:24:58 -0400
committerPhillip Cloud <417981+cpcloud@users.noreply.github.com>2021-11-04 05:47:13 -0400
commit33c991cf656b8b37ee6afd3fde889dd4c86bb0e3 (patch)
treea7764c75605293b6c035cc44d512650e66eb8978 /pkgs/development/libraries/google-cloud-cpp/default.nix
parentf0e0efabb0dbe2f68d02c1a84cf6074bb8539016 (diff)
downloadnixpkgs-33c991cf656b8b37ee6afd3fde889dd4c86bb0e3.tar
nixpkgs-33c991cf656b8b37ee6afd3fde889dd4c86bb0e3.tar.gz
nixpkgs-33c991cf656b8b37ee6afd3fde889dd4c86bb0e3.tar.bz2
nixpkgs-33c991cf656b8b37ee6afd3fde889dd4c86bb0e3.tar.lz
nixpkgs-33c991cf656b8b37ee6afd3fde889dd4c86bb0e3.tar.xz
nixpkgs-33c991cf656b8b37ee6afd3fde889dd4c86bb0e3.tar.zst
nixpkgs-33c991cf656b8b37ee6afd3fde889dd4c86bb0e3.zip
google-cloud-cpp: 0.14.0 -> 1.32.1
Diffstat (limited to 'pkgs/development/libraries/google-cloud-cpp/default.nix')
-rw-r--r--pkgs/development/libraries/google-cloud-cpp/default.nix88
1 files changed, 44 insertions, 44 deletions
diff --git a/pkgs/development/libraries/google-cloud-cpp/default.nix b/pkgs/development/libraries/google-cloud-cpp/default.nix
index d493f31d375..9a5b0cbc772 100644
--- a/pkgs/development/libraries/google-cloud-cpp/default.nix
+++ b/pkgs/development/libraries/google-cloud-cpp/default.nix
@@ -1,76 +1,76 @@
 { lib
 , stdenv
-, clang-tools
-, grpc
-, curl
+, fetchFromGitHub
+, abseil-cpp
+, c-ares
 , cmake
+, crc32c
+, curl
+, grpc
+, gbenchmark
+, gtest
+, ninja
+, nlohmann_json
 , pkg-config
-, fetchFromGitHub
-, doxygen
 , protobuf
-, crc32c
-, fetchurl
-, openssl
-, libnsl
+  # default list of APIs: https://github.com/googleapis/google-cloud-cpp/blob/v1.32.1/CMakeLists.txt#L173
+, apis ? [ "*" ]
 }:
 let
+  googleapisRev = "ed739492993c4a99629b6430affdd6c0fb59d435";
   googleapis = fetchFromGitHub {
     owner = "googleapis";
     repo = "googleapis";
-    rev = "9c9f778aedde02f9826d2ae5d0f9c96409ba0f25";
-    sha256 = "1gd3nwv8qf503wy6km0ad6akdvss9w5b1k3jqizy5gah1fkirkpi";
-  };
-  googleapis-cpp-cmakefiles = stdenv.mkDerivation rec {
-    pname = "googleapis-cpp-cmakefiles";
-    version = "0.1.5";
-    src = fetchFromGitHub {
-      owner = "googleapis";
-      repo = "cpp-cmakefiles";
-      rev = "v${version}";
-      sha256 = "02zkcq2wl831ayd9qy009xvfx7q80pgycx7mzz9vknwd0nn6dd0n";
-    };
-
-    nativeBuildInputs = [ cmake pkg-config ];
-    buildInputs = [ grpc openssl protobuf ];
-
-    postPatch = ''
-      sed -e 's,https://github.com/googleapis/googleapis/archive/9c9f778aedde02f9826d2ae5d0f9c96409ba0f25.tar.gz,file://${googleapis},' \
-      -i CMakeLists.txt
-    '';
-  };
-  _nlohmann_json = fetchurl {
-    url = "https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp";
-    sha256 = "0pw3jpi572irbp2dqclmyhgic6k9rxav5mpp9ygbp9xj48gnvnk3";
+    rev = googleapisRev;
+    hash = "sha256:1xrnh77vb8hxmf1ywqsifzd39kylhbdyah0b0b9bm7nw0mnahssl";
   };
-in stdenv.mkDerivation rec {
+in
+stdenv.mkDerivation rec {
   pname = "google-cloud-cpp";
-  version = "0.14.0";
+  version = "1.32.1";
 
   src = fetchFromGitHub {
     owner = "googleapis";
     repo = "google-cloud-cpp";
     rev = "v${version}";
-    sha256 = "15wci4m8h6py7fqfziq8mp5m6pxp2h1cbh5rp2k90mk5js4jb9pa";
+    sha256 = "0g720sni70nlncv4spm4rlfykdkpjnv81axfz2jd1arpdajm0mg9";
   };
 
-  buildInputs = [ curl crc32c googleapis-cpp-cmakefiles grpc protobuf libnsl ];
-  nativeBuildInputs = [ clang-tools cmake pkg-config doxygen ];
-
-  outputs = [ "out" "dev" ];
-
   postPatch = ''
-    sed -e 's,https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp,file://${_nlohmann_json},' \
-    -i cmake/DownloadNlohmannJson.cmake
+    substituteInPlace external/googleapis/CMakeLists.txt \
+      --replace "https://github.com/googleapis/googleapis/archive/${googleapisRev}.tar.gz" "file://${googleapis}"
   '';
 
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    abseil-cpp
+    c-ares
+    crc32c
+    curl
+    grpc
+    gbenchmark
+    gtest
+    nlohmann_json
+    protobuf
+  ];
+
   cmakeFlags = [
     "-DBUILD_SHARED_LIBS:BOOL=ON"
+    "-DBUILD_TESTING:BOOL=ON"
+    "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF"
+  ] ++ lib.optionals (apis != [ "*" ]) [
+    "-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}"
   ];
 
   meta = with lib; {
     license = with licenses; [ asl20 ];
     homepage = "https://github.com/googleapis/google-cloud-cpp";
     description = "C++ Idiomatic Clients for Google Cloud Platform services";
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ cpcloud ];
   };
 }