summary refs log tree commit diff
diff options
context:
space:
mode:
author06kellyjac <dev@j-k.io>2021-10-25 10:57:38 +0100
committer06kellyjac <dev@j-k.io>2021-10-25 10:57:45 +0100
commitf6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf (patch)
treef24c1eba2fc28978c58e2ab89ea53598679fd27b
parente674a4637730906d080924819870ea76d9e96896 (diff)
downloadnixpkgs-f6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf.tar
nixpkgs-f6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf.tar.gz
nixpkgs-f6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf.tar.bz2
nixpkgs-f6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf.tar.lz
nixpkgs-f6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf.tar.xz
nixpkgs-f6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf.tar.zst
nixpkgs-f6b9ffdd8aa9bd5306e9de0b9b4373ad2cfb5caf.zip
protoc-gen-grpc-web: 1.2.1 -> 1.3.0
-rw-r--r--pkgs/development/tools/protoc-gen-grpc-web/default.nix40
1 files changed, 25 insertions, 15 deletions
diff --git a/pkgs/development/tools/protoc-gen-grpc-web/default.nix b/pkgs/development/tools/protoc-gen-grpc-web/default.nix
index c50894b31e1..acbd23ec292 100644
--- a/pkgs/development/tools/protoc-gen-grpc-web/default.nix
+++ b/pkgs/development/tools/protoc-gen-grpc-web/default.nix
@@ -1,28 +1,17 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, protobuf }:
+{ lib, stdenv, fetchFromGitHub, protobuf }:
 
 stdenv.mkDerivation rec {
   pname = "protoc-gen-grpc-web";
-  version = "1.2.1";
+  version = "1.3.0";
 
   src = fetchFromGitHub {
     owner = "grpc";
     repo = "grpc-web";
     rev = version;
-    sha256 = "sha256-NBENyc01O8NPo84z1CeZ7YvFvVGY2GSlcdxacRrQALw=";
+    sha256 = "sha256-piKpaylzuanhGR+7BzApplv8e/CWPoR9tG3vHrF7WXw=";
   };
 
-  sourceRoot = "source/javascript/net/grpc/web";
-
-  # remove once PR merged
-  # https://github.com/grpc/grpc-web/pull/1107
-  patches = [
-    (fetchpatch {
-      name = "add-prefix.patch";
-      url = "https://github.com/06kellyjac/grpc-web/commit/b0803be1080fc635a8d5b88da971835a888a0c77.patch";
-      stripLen = 4;
-      sha256 = "sha256-Rw9Z7F8cYrc/UIGUN6yXOus4v+Qn9Yf1Nc301TFx85A=";
-    })
-  ];
+  sourceRoot = "source/javascript/net/grpc/web/generator";
 
   strictDeps = true;
   nativeBuildInputs = [ protobuf ];
@@ -30,11 +19,32 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=$(out)" ];
 
+  doCheck = true;
+  checkInputs = [ protobuf ];
+  checkPhase = ''
+    runHook preCheck
+
+    CHECK_TMPDIR="$TMPDIR/proto"
+    mkdir -p "$CHECK_TMPDIR"
+
+    protoc \
+      --proto_path="${src}/packages/grpc-web/test/protos" \
+      --plugin="./protoc-gen-grpc-web" \
+      --grpc-web_out="import_style=commonjs,mode=grpcwebtext:$CHECK_TMPDIR" \
+      echo.proto
+
+    # check for grpc-web generated file
+    [ -f "$CHECK_TMPDIR/echo_grpc_web_pb.js" ]
+
+    runHook postCheck
+  '';
+
   meta = with lib; {
     homepage = "https://github.com/grpc/grpc-web";
     changelog = "https://github.com/grpc/grpc-web/blob/${version}/CHANGELOG.md";
     description = "gRPC web support for Google's protocol buffers";
     license = licenses.asl20;
     maintainers = with maintainers; [ jk ];
+    platforms = platforms.unix;
   };
 }