···1# The cmake version of this build is meant to enable both cmake and .pc being exported
2# this is important because grpc exports a .cmake file which also expects for protobuf
3# to have been exported through cmake as well.
4-{ lib
5-, stdenv
6-, abseil-cpp
7-, buildPackages
8-, cmake
9-, fetchFromGitHub
10-, fetchpatch
11-, gtest
12-, zlib
13-, version
14-, hash
01516 # downstream dependencies
17-, python3
18-, grpc
19-, enableShared ? !stdenv.hostPlatform.isStatic
2021-, testers
22-, protobuf
23-, ...
24}:
2526stdenv.mkDerivation (finalAttrs: {
···48 })
49 ];
5051- nativeBuildInputs = [
52- cmake
53- ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
54- # protoc of the same version must be available for build. For non-cross builds, it's able to
55- # re-use the executable generated as part of the build
56- buildPackages."protobuf_${lib.versions.major version}"
57- ];
005859 buildInputs = [
60 gtest
···68 strictDeps = true;
6970 cmakeDir = if lib.versionOlder version "22" then "../cmake" else null;
71- cmakeFlags = [
72- "-Dprotobuf_USE_EXTERNAL_GTEST=ON"
73- "-Dprotobuf_ABSL_PROVIDER=package"
74- ] ++ lib.optionals enableShared [
75- "-Dprotobuf_BUILD_SHARED_LIBS=ON"
76- ]
77- ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [
78- "-Dprotobuf_BUILD_TESTS=OFF"
79- ];
008081 doCheck =
82 # FIXME: investigate. 24.x and 23.x have different errors.
···1# The cmake version of this build is meant to enable both cmake and .pc being exported
2# this is important because grpc exports a .cmake file which also expects for protobuf
3# to have been exported through cmake as well.
4+{
5+ lib,
6+ stdenv,
7+ abseil-cpp,
8+ buildPackages,
9+ cmake,
10+ fetchFromGitHub,
11+ fetchpatch,
12+ gtest,
13+ zlib,
14+ version,
15+ hash,
1617 # downstream dependencies
18+ python3,
19+ grpc,
20+ enableShared ? !stdenv.hostPlatform.isStatic,
2122+ testers,
23+ protobuf,
24+ ...
25}:
2627stdenv.mkDerivation (finalAttrs: {
···49 })
50 ];
5152+ nativeBuildInputs =
53+ [
54+ cmake
55+ ]
56+ ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
57+ # protoc of the same version must be available for build. For non-cross builds, it's able to
58+ # re-use the executable generated as part of the build
59+ buildPackages."protobuf_${lib.versions.major version}"
60+ ];
6162 buildInputs = [
63 gtest
···71 strictDeps = true;
7273 cmakeDir = if lib.versionOlder version "22" then "../cmake" else null;
74+ cmakeFlags =
75+ [
76+ "-Dprotobuf_USE_EXTERNAL_GTEST=ON"
77+ "-Dprotobuf_ABSL_PROVIDER=package"
78+ ]
79+ ++ lib.optionals enableShared [
80+ "-Dprotobuf_BUILD_SHARED_LIBS=ON"
81+ ]
82+ ++ lib.optionals (!finalAttrs.finalPackage.doCheck) [
83+ "-Dprotobuf_BUILD_TESTS=OFF"
84+ ];
8586 doCheck =
87 # FIXME: investigate. 24.x and 23.x have different errors.