1 { stdenv, lib, buildBazelPackage, bazel_6, fetchFromGitHub, cctools }:
3 buildBazelPackage rec {
4 pname = "protoc-gen-js";
7 src = fetchFromGitHub {
8 owner = "protocolbuffers";
9 repo = "protobuf-javascript";
11 hash = "sha256-TmP6xftUVTD7yML7UEM/DB8bcsL5RFlKPyCpcboD86U=";
15 bazelTargets = [ "generator:protoc-gen-js" ];
16 bazelBuildFlags = lib.optionals stdenv.cc.isClang [ "--cxxopt=-x" "--cxxopt=c++" "--host_cxxopt=-x" "--host_cxxopt=c++" ];
17 removeRulesCC = false;
18 removeLocalConfigCC = false;
20 LIBTOOL = lib.optionalString stdenv.hostPlatform.isDarwin "${cctools}/bin/libtool";
22 fetchAttrs.hash = "sha256-WOBlZ0XNrl5UxIaSDxZeOfzS2a8ZkrKdTLKHBDC9UNQ=";
24 buildAttrs.installPhase = ''
26 install -Dm755 bazel-bin/generator/protoc-gen-js $out/bin/
30 description = "Protobuf plugin for generating JavaScript code";
31 mainProgram = "protoc-gen-js";
32 homepage = "https://github.com/protocolbuffers/protobuf-javascript";
33 platforms = platforms.linux ++ platforms.darwin;
34 license = with licenses; [ asl20 bsd3 ];
35 sourceProvenance = [ sourceTypes.fromSource ];