google-cloud-cpp: 2.38.0 -> 2.43.0, modernize (#461974)
This commit is contained in:
@@ -14,32 +14,32 @@
|
||||
nlohmann_json,
|
||||
openssl,
|
||||
pkg-config,
|
||||
protobuf_31,
|
||||
protobuf,
|
||||
pkgsBuildHost,
|
||||
# default list of APIs: https://github.com/googleapis/google-cloud-cpp/blob/v1.32.1/CMakeLists.txt#L173
|
||||
# default list of APIs: https://github.com/googleapis/google-cloud-cpp/blob/v2.43.0/cmake/GoogleCloudCppFeatures.cmake#L24
|
||||
apis ? [ "*" ],
|
||||
staticOnly ? stdenv.hostPlatform.isStatic,
|
||||
}:
|
||||
let
|
||||
# defined in cmake/GoogleapisConfig.cmake
|
||||
googleapisRev = "f01a17a560b4fbc888fd552c978f4e1f8614100b";
|
||||
googleapisRev = "2193a2bfcecb92b92aad7a4d81baa428cafd7dfd";
|
||||
googleapis = fetchFromGitHub {
|
||||
name = "googleapis-src";
|
||||
owner = "googleapis";
|
||||
repo = "googleapis";
|
||||
rev = googleapisRev;
|
||||
hash = "sha256-eJA3KM/CZMKTR3l6omPJkxqIBt75mSNsxHnoC+1T4gw=";
|
||||
hash = "sha256-M+3ywDd1kyo6U/9o7fpsqYIPuulf8fDe3a4mjJKEN2U=";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "google-cloud-cpp";
|
||||
version = "2.38.0";
|
||||
version = "2.43.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "googleapis";
|
||||
repo = "google-cloud-cpp";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-TF3MLBmjUbKJkZVcaPXbagXrAs3eEhlNQBjYQf0VtT8=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-2OnzObCTmB6E4Ut0blmL7CRAJJ9EKl6eSVdfuPS4B2Y=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
|
||||
grpc
|
||||
nlohmann_json
|
||||
openssl
|
||||
protobuf_31
|
||||
protobuf
|
||||
gbenchmark
|
||||
gtest
|
||||
];
|
||||
@@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
ldLibraryPathName = "${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH";
|
||||
in
|
||||
lib.optionalString doInstallCheck (
|
||||
lib.optionalString finalAttrs.doInstallCheck (
|
||||
lib.optionalString (!staticOnly) ''
|
||||
export ${ldLibraryPathName}=${lib.concatStringsSep ":" additionalLibraryPaths}
|
||||
''
|
||||
@@ -114,32 +114,33 @@ stdenv.mkDerivation rec {
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = lib.optionals doInstallCheck [
|
||||
nativeInstallCheckInputs = lib.optionals finalAttrs.doInstallCheck [
|
||||
gbenchmark
|
||||
gtest
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS:BOOL=${if staticOnly then "OFF" else "ON"}"
|
||||
(lib.cmakeBool "BUILD_SHARED_LIBS" (!staticOnly))
|
||||
# unconditionally build tests to catch linker errors as early as possible
|
||||
# this adds a good chunk of time to the build
|
||||
"-DBUILD_TESTING:BOOL=ON"
|
||||
"-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES:BOOL=OFF"
|
||||
(lib.cmakeBool "BUILD_TESTING" true)
|
||||
(lib.cmakeBool "GOOGLE_CLOUD_CPP_ENABLE_EXAMPLES" false)
|
||||
]
|
||||
++ lib.optionals (apis != [ "*" ]) [
|
||||
"-DGOOGLE_CLOUD_CPP_ENABLE=${lib.concatStringsSep ";" apis}"
|
||||
(lib.cmakeFeature "GOOGLE_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"
|
||||
(lib.cmakeFeature "GOOGLE_CLOUD_CPP_GRPC_PLUGIN_EXECUTABLE" "${lib.getBin pkgsBuildHost.grpc}/bin/grpc_cpp_plugin")
|
||||
];
|
||||
|
||||
requiredSystemFeatures = [ "big-parallel" ];
|
||||
|
||||
meta = with lib; {
|
||||
license = with licenses; [ asl20 ];
|
||||
meta = {
|
||||
license = with lib.licenses; [ asl20 ];
|
||||
homepage = "https://github.com/googleapis/google-cloud-cpp";
|
||||
description = "C++ Idiomatic Clients for Google Cloud Platform services";
|
||||
changelog = "https://github.com/googleapis/google-cloud-cpp/blob/v${finalAttrs.version}/CHANGELOG.md";
|
||||
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
||||
maintainers = with maintainers; [ cpcloud ];
|
||||
maintainers = with lib.maintainers; [ cpcloud ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user