From f711865b1b8e121308ce6af7ad6dc2517d4fb391 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 15 Nov 2025 14:33:26 +0000 Subject: [PATCH 1/2] google-cloud-cpp: 2.38.0 -> 2.43.0 Diff: https://github.com/googleapis/google-cloud-cpp/compare/v2.38.0...v2.43.0 --- pkgs/by-name/go/google-cloud-cpp/package.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/go/google-cloud-cpp/package.nix b/pkgs/by-name/go/google-cloud-cpp/package.nix index 4446c8105dc2..da911db925be 100644 --- a/pkgs/by-name/go/google-cloud-cpp/package.nix +++ b/pkgs/by-name/go/google-cloud-cpp/package.nix @@ -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 { 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="; + sha256 = "sha256-2OnzObCTmB6E4Ut0blmL7CRAJJ9EKl6eSVdfuPS4B2Y="; }; patches = [ @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { grpc nlohmann_json openssl - protobuf_31 + protobuf gbenchmark gtest ]; From 51c7fb6b1c67fa8d616004fa5a8d9c723b065b75 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 15 Nov 2025 16:47:28 +0000 Subject: [PATCH 2/2] google-cloud-cpp: modernize --- pkgs/by-name/go/google-cloud-cpp/package.nix | 29 ++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/go/google-cloud-cpp/package.nix b/pkgs/by-name/go/google-cloud-cpp/package.nix index da911db925be..c2433ca8ed77 100644 --- a/pkgs/by-name/go/google-cloud-cpp/package.nix +++ b/pkgs/by-name/go/google-cloud-cpp/package.nix @@ -31,15 +31,15 @@ let hash = "sha256-M+3ywDd1kyo6U/9o7fpsqYIPuulf8fDe3a4mjJKEN2U="; }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "google-cloud-cpp"; version = "2.43.0"; src = fetchFromGitHub { owner = "googleapis"; repo = "google-cloud-cpp"; - rev = "v${version}"; - sha256 = "sha256-2OnzObCTmB6E4Ut0blmL7CRAJJ9EKl6eSVdfuPS4B2Y="; + tag = "v${finalAttrs.version}"; + hash = "sha256-2OnzObCTmB6E4Ut0blmL7CRAJJ9EKl6eSVdfuPS4B2Y="; }; patches = [ @@ -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 ]; }; -} +})