From 676021d4a742aad8745a9b5b7f37eb363a6cb49a Mon Sep 17 00:00:00 2001 From: 06kellyjac Date: Fri, 25 Feb 2022 15:25:12 +0000 Subject: [PATCH] protoc-gen-grpc-web: 1.3.0 -> 1.3.1 --- .../tools/protoc-gen-grpc-web/default.nix | 11 ++++++++--- .../protoc-gen-grpc-web/optional-static.patch | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/tools/protoc-gen-grpc-web/optional-static.patch diff --git a/pkgs/development/tools/protoc-gen-grpc-web/default.nix b/pkgs/development/tools/protoc-gen-grpc-web/default.nix index acbd23ec292..279f8101f78 100644 --- a/pkgs/development/tools/protoc-gen-grpc-web/default.nix +++ b/pkgs/development/tools/protoc-gen-grpc-web/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "protoc-gen-grpc-web"; - version = "1.3.0"; + version = "1.3.1"; src = fetchFromGitHub { owner = "grpc"; repo = "grpc-web"; rev = version; - sha256 = "sha256-piKpaylzuanhGR+7BzApplv8e/CWPoR9tG3vHrF7WXw="; + sha256 = "sha256-NRShN4X9JmCjqPVY/q9oSxSOvv1bP//vM9iOZ6ap5vc="; }; sourceRoot = "source/javascript/net/grpc/web/generator"; @@ -17,7 +17,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ protobuf ]; buildInputs = [ protobuf ]; - makeFlags = [ "PREFIX=$(out)" ]; + makeFlags = [ "PREFIX=$(out)" "STATIC=no" ]; + + patches = [ + # https://github.com/grpc/grpc-web/pull/1210 + ./optional-static.patch + ]; doCheck = true; checkInputs = [ protobuf ]; diff --git a/pkgs/development/tools/protoc-gen-grpc-web/optional-static.patch b/pkgs/development/tools/protoc-gen-grpc-web/optional-static.patch new file mode 100644 index 00000000000..a7ca112749c --- /dev/null +++ b/pkgs/development/tools/protoc-gen-grpc-web/optional-static.patch @@ -0,0 +1,19 @@ +--- a/Makefile ++++ b/Makefile +@@ -18,12 +18,15 @@ CXXFLAGS += -std=c++11 + LDFLAGS += -L/usr/local/lib -lprotoc -lprotobuf -lpthread -ldl + PREFIX ?= /usr/local + MIN_MACOS_VERSION := 10.7 # Supports OS X Lion ++STATIC ?= yes + + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S),Darwin) + CXXFLAGS += -stdlib=libc++ -mmacosx-version-min=$(MIN_MACOS_VERSION) + else ifeq ($(UNAME_S),Linux) +- LDFLAGS += -static ++ ifeq ($(STATIC),yes) ++ LDFLAGS += -static ++ endif + endif + + all: protoc-gen-grpc-web