grpc: fixup build on darwin

https://hydra.nixos.org/build/301792425/nixlog/2
This commit is contained in:
Vladimír Čunát 2025-07-11 10:19:38 +02:00
parent 77e81dbfc2
commit c14ffc40d9
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA

View File

@ -3,6 +3,7 @@
stdenv,
fetchFromGitHub,
fetchpatch,
fetchurl,
buildPackages,
cmake,
zlib,
@ -42,15 +43,24 @@ stdenv.mkDerivation rec {
fetchSubmodules = true;
};
patches = [
(fetchpatch {
# armv6l support, https://github.com/grpc/grpc/pull/21341
name = "grpc-link-libatomic.patch";
url = "https://github.com/lopsided98/grpc/commit/a9b917666234f5665c347123d699055d8c2537b2.patch";
hash = "sha256-Lm0GQsz/UjBbXXEE14lT0dcRzVmCKycrlrdBJj+KLu8=";
})
# fix build of 1.63.0 and newer on darwin: https://github.com/grpc/grpc/issues/36654
] ++ (lib.optional stdenv.hostPlatform.isDarwin ./dynamic-lookup-darwin.patch);
patches =
[
(fetchpatch {
# armv6l support, https://github.com/grpc/grpc/pull/21341
name = "grpc-link-libatomic.patch";
url = "https://github.com/lopsided98/grpc/commit/a9b917666234f5665c347123d699055d8c2537b2.patch";
hash = "sha256-Lm0GQsz/UjBbXXEE14lT0dcRzVmCKycrlrdBJj+KLu8=";
})
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# fix build of 1.63.0 and newer on darwin: https://github.com/grpc/grpc/issues/36654
./dynamic-lookup-darwin.patch
# https://github.com/grpc/grpc/issues/39170
(fetchurl {
url = "https://raw.githubusercontent.com/rdhafidh/vcpkg/0ae97b7b81562bd66ab99d022551db1449c079f9/ports/grpc/00017-add-src-upb.patch";
hash = "sha256-0zaJqeCM90DTtUR6xCUorahUpiJF3D/KODYkUXQh2ok=";
})
];
nativeBuildInputs = [
cmake