nix: Add grpc-tools as explicit dependency

The grpc-tools gem is just a bundle of prebuilt binaries with a thin
layer of wiring to invoke the correct binary given the calling system.
On Nix, prebuilt binaries don't work because they can't find their
dynamically linked libraries in the "normal" places you'd expect on a
Linux machine. Nix has tooling (`autoPatchelf`) which can fixup a given
binary and wire it correctly to the Nix store. We need to have Nix fetch
and build `grpc-tools` so we can invoke this tooling rather than just
letting `bundle install` get the gem.
This commit is contained in:
Paul Hinze 2021-11-18 13:56:13 -06:00
parent 92ab5828b1
commit 7a38f46633
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
3 changed files with 14 additions and 0 deletions

10
nix/grpc-tools.nix Normal file
View File

@ -0,0 +1,10 @@
{ autoPatchelfHook, buildRubyGem, ruby }:
buildRubyGem rec {
inherit ruby;
name = "${gemName}-${version}";
gemName = "grpc-tools";
version = "1.41.1";
source.sha256 = "sha256-NlBwd8NRc8niZyOWUheqTgeYs6QP200jDWmEATeBXOE=";
nativeBuildInputs = [ autoPatchelfHook ];
}

View File

@ -12,6 +12,8 @@ final: prev: rec {
go-tools = prev.callPackage ./go-tools.nix { };
grpc-tools = prev.callPackage ./grpc-tools.nix { };
go-mockery = prev.callPackage ./go-mockery.nix { };
go-changelog = prev.callPackage ./go-changelog.nix { };

View File

@ -10,6 +10,7 @@
, go-protobuf
, go-protobuf-json
, go-tools
, grpc-tools
, grpcurl
, libpng
, libtool
@ -41,6 +42,7 @@ mkShell rec {
go-tools
go-mockery
go-changelog
grpc-tools
# Needed for website/
autoconf