Skip to content

Commit

Permalink
grpc: unroll recursive git retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
Isidor Zeuner committed Nov 4, 2024
1 parent 9c9383f commit 5af1575
Show file tree
Hide file tree
Showing 2 changed files with 404 additions and 9 deletions.
49 changes: 40 additions & 9 deletions pkgs/development/libraries/grpc/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{ lib
, stdenv
, runCommand
, callPackage
, writeShellScript
, fetchFromGitHub
, fetchFromGitea
, fetchpatch
, buildPackages
, cmake
, lndir
, zlib
, c-ares
, pkg-config
Expand All @@ -19,18 +24,41 @@
, arrow-cpp
}:

let
git-unroll = fetchFromGitea {
domain = "codeberg.org";
owner = "gm6k";
repo = "git-unroll";
rev = "9243bb8a6a9f6875e21a5c64320b66f7fdaf9b3f";
hash = "sha256-1MjbB1EVgmU0HlUibrKOkjmxQ8wseocSJENiAqyHcjU=";
};

unroll-src = writeShellScript "unroll-src" ''
echo "{
version,
fetchFromGitHub,
runCommand,
lndir,
}:
assert version == "'"'$1'"'";"
${git-unroll}/unroll --lndir https://github.com/grpc/grpc v$1
echo
echo "# Update using: unroll-src [version]"
'';
in
stdenv.mkDerivation rec {
pname = "grpc";
version = "1.66.1"; # N.B: if you change this, please update:
# pythonPackages.grpcio-tools
# pythonPackages.grpcio-status

src = fetchFromGitHub {
owner = "grpc";
repo = "grpc";
rev = "v${version}";
hash = "sha256-CmQUUbIYPWRS7q7OX+TmkTvoqtJAUEwhL/lev8JdB8U=";
fetchSubmodules = true;
src = callPackage ./src.nix {
inherit
version
fetchFromGitHub
runCommand
lndir
;
};

patches = [
Expand Down Expand Up @@ -99,9 +127,12 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

passthru.tests = {
inherit (python3.pkgs) grpcio-status grpcio-tools jaxlib;
inherit arrow-cpp;
passthru = {
inherit unroll-src;
tests = {
inherit (python3.pkgs) grpcio-status grpcio-tools jaxlib;
inherit arrow-cpp;
};
};

meta = with lib; {
Expand Down
Loading

0 comments on commit 5af1575

Please sign in to comment.