Skip to content

Commit

Permalink
Merge pull request #244539 from tobim/pkgs/protobuf3_23
Browse files Browse the repository at this point in the history
protobuf3: 21.12 -> 23.4
  • Loading branch information
marsam authored Aug 5, 2023
2 parents a568098 + 9e397b9 commit c0f799f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
7 changes: 7 additions & 0 deletions pkgs/development/libraries/abseil-cpp/202301.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, stdenv
, fetchFromGitHub
, cmake
, gtest
, static ? stdenv.hostPlatform.isStatic
, cxxStandard ? null
}:
Expand All @@ -18,13 +19,19 @@ stdenv.mkDerivation (finalAttrs: {
};

cmakeFlags = [
"-DABSL_BUILD_TEST_HELPERS=ON"
"-DABSL_USE_EXTERNAL_GOOGLETEST=ON"
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
] ++ lib.optionals (cxxStandard != null) [
"-DCMAKE_CXX_STANDARD=${cxxStandard}"
];

strictDeps = true;

nativeBuildInputs = [ cmake ];

buildInputs = [ gtest ];

meta = with lib; {
description = "An open-source collection of C++ code designed to augment the C++ standard library";
homepage = "https://abseil.io/";
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/protobuf/3.23.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ callPackage, ... } @ args:

callPackage ./generic-v3-cmake.nix ({
version = "3.23.4";
sha256 = "sha256-eI+mrsZAOLEsdyTC3B+K+GjD3r16CmPx1KJ2KhCwFdg=";
} // args)
6 changes: 2 additions & 4 deletions pkgs/development/libraries/protobuf/generic-v3-cmake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ let
zlib
];

# After 3.20, CMakeLists.txt can now be found at the top-level, however
# a stub cmake/CMakeLists.txt still exists for compatibility with previous build assumptions
cmakeDir = "../cmake";
cmakeDir = if lib.versionOlder version "3.22" then "../cmake" else null;
cmakeFlags = [
"-Dprotobuf_ABSL_PROVIDER=package"
] ++ lib.optionals (!stdenv.targetPlatform.isStatic) [
] ++ lib.optionals (!stdenv.targetPlatform.isStatic) [
"-Dprotobuf_BUILD_SHARED_LIBS=ON"
]
# Tests fail to build on 32-bit platforms; fixed in 3.22
Expand Down
3 changes: 2 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24278,8 +24278,9 @@ with pkgs;

prospector = callPackage ../development/tools/prospector { };

protobuf = protobuf3_21;
protobuf = protobuf3_23;

protobuf3_23 = callPackage ../development/libraries/protobuf/3.23.nix { };
protobuf3_21 = callPackage ../development/libraries/protobuf/3.21.nix {
abseil-cpp = abseil-cpp_202103;
};
Expand Down

0 comments on commit c0f799f

Please sign in to comment.