From c14ffc40d969a8e6967a849f5c140f8bacb85ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 11 Jul 2025 10:19:38 +0200 Subject: [PATCH] grpc: fixup build on darwin https://hydra.nixos.org/build/301792425/nixlog/2 --- pkgs/by-name/gr/grpc/package.nix | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/gr/grpc/package.nix b/pkgs/by-name/gr/grpc/package.nix index daf25b04a555..0d5df0db0002 100644 --- a/pkgs/by-name/gr/grpc/package.nix +++ b/pkgs/by-name/gr/grpc/package.nix @@ -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