1 { lib, stdenv, fetchFromGitHub, protobuf }:
3 stdenv.mkDerivation rec {
4 pname = "protoc-gen-grpc-web";
7 src = fetchFromGitHub {
11 sha256 = "sha256-NRShN4X9JmCjqPVY/q9oSxSOvv1bP//vM9iOZ6ap5vc=";
14 sourceRoot = "source/javascript/net/grpc/web/generator";
17 nativeBuildInputs = [ protobuf ];
18 buildInputs = [ protobuf ];
20 makeFlags = [ "PREFIX=$(out)" "STATIC=no" ];
23 # https://github.com/grpc/grpc-web/pull/1210
24 ./optional-static.patch
28 checkInputs = [ protobuf ];
32 CHECK_TMPDIR="$TMPDIR/proto"
33 mkdir -p "$CHECK_TMPDIR"
36 --proto_path="${src}/packages/grpc-web/test/protos" \
37 --plugin="./protoc-gen-grpc-web" \
38 --grpc-web_out="import_style=commonjs,mode=grpcwebtext:$CHECK_TMPDIR" \
41 # check for grpc-web generated file
42 [ -f "$CHECK_TMPDIR/echo_grpc_web_pb.js" ]
48 homepage = "https://github.com/grpc/grpc-web";
49 changelog = "https://github.com/grpc/grpc-web/blob/${version}/CHANGELOG.md";
50 description = "gRPC web support for Google's protocol buffers";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ jk ];
53 platforms = platforms.unix;