nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 61 lines 1.5 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 protobuf, 6 isStatic ? stdenv.hostPlatform.isStatic, 7}: 8 9stdenv.mkDerivation (finalAttrs: { 10 pname = "protoc-gen-grpc-web"; 11 version = "1.5.0"; 12 13 src = fetchFromGitHub { 14 owner = "grpc"; 15 repo = "grpc-web"; 16 rev = finalAttrs.version; 17 sha256 = "sha256-yqiSuqan4vynE3AS8OnYdzA+3AVlVFTBkxTuJe17114="; 18 }; 19 20 sourceRoot = "${finalAttrs.src.name}/javascript/net/grpc/web/generator"; 21 22 enableParallelBuilding = true; 23 strictDeps = true; 24 nativeBuildInputs = [ protobuf ]; 25 buildInputs = [ protobuf ]; 26 27 makeFlags = [ 28 "PREFIX=$(out)" 29 "STATIC=${lib.boolToYesNo isStatic}" 30 ]; 31 32 doCheck = true; 33 nativeCheckInputs = [ protobuf ]; 34 checkPhase = '' 35 runHook preCheck 36 37 CHECK_TMPDIR="$TMPDIR/proto" 38 mkdir -p "$CHECK_TMPDIR" 39 40 protoc \ 41 --proto_path="$src/packages/grpc-web/test/protos" \ 42 --plugin="./protoc-gen-grpc-web" \ 43 --grpc-web_out="import_style=commonjs,mode=grpcwebtext:$CHECK_TMPDIR" \ 44 echo.proto 45 46 # check for grpc-web generated file 47 [ -f "$CHECK_TMPDIR/echo_grpc_web_pb.js" ] 48 49 runHook postCheck 50 ''; 51 52 meta = { 53 homepage = "https://github.com/grpc/grpc-web"; 54 changelog = "https://github.com/grpc/grpc-web/blob/${finalAttrs.version}/CHANGELOG.md"; 55 description = "gRPC web support for Google's protocol buffers"; 56 mainProgram = "protoc-gen-grpc-web"; 57 license = lib.licenses.asl20; 58 maintainers = with lib.maintainers; [ jk ]; 59 platforms = lib.platforms.unix; 60 }; 61})