python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / tools / protoc-gen-grpc-web / default.nix
blob279f8101f78f4401c251c230b64c83e23293e0f8
1 { lib, stdenv, fetchFromGitHub, protobuf }:
3 stdenv.mkDerivation rec {
4   pname = "protoc-gen-grpc-web";
5   version = "1.3.1";
7   src = fetchFromGitHub {
8     owner = "grpc";
9     repo = "grpc-web";
10     rev = version;
11     sha256 = "sha256-NRShN4X9JmCjqPVY/q9oSxSOvv1bP//vM9iOZ6ap5vc=";
12   };
14   sourceRoot = "source/javascript/net/grpc/web/generator";
16   strictDeps = true;
17   nativeBuildInputs = [ protobuf ];
18   buildInputs = [ protobuf ];
20   makeFlags = [ "PREFIX=$(out)" "STATIC=no" ];
22   patches = [
23     # https://github.com/grpc/grpc-web/pull/1210
24     ./optional-static.patch
25   ];
27   doCheck = true;
28   checkInputs = [ protobuf ];
29   checkPhase = ''
30     runHook preCheck
32     CHECK_TMPDIR="$TMPDIR/proto"
33     mkdir -p "$CHECK_TMPDIR"
35     protoc \
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" \
39       echo.proto
41     # check for grpc-web generated file
42     [ -f "$CHECK_TMPDIR/echo_grpc_web_pb.js" ]
44     runHook postCheck
45   '';
47   meta = with lib; {
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;
54   };