$OpenBSD: patch-third_party_closure_compiler_js_binary_py,v 1.2 2019/03/24 12:24:45 robert Exp $

Index: third_party/closure_compiler/js_binary.py
--- third_party/closure_compiler/js_binary.py.orig
+++ third_party/closure_compiler/js_binary.py
@@ -12,6 +12,8 @@ extern files can also be passed in using the --extern 
 """
 
 import argparse
+import subprocess
+import platform
 import os
 import sys
 
@@ -121,7 +123,17 @@ def main():
     compiler_args += ['--checks-only']
     open(args.output, 'w').close()
 
-  returncode, errors = compiler.Compiler().run_jar(args.compiler, compiler_args)
+  if platform.machine() == 'amd64':
+    returncode, errors = compiler.Compiler().run_jar(args.compiler, compiler_args)
+  else:
+    shell_command = " ".join(["cat"] + sources + [">"] + [args.output])
+    print("Running: %s" % shell_command)
+    devnull = open(os.devnull, "w")
+    kwargs = {"stdout": devnull, "stderr": subprocess.PIPE, "shell": True}
+    process = subprocess.Popen(shell_command, **kwargs)
+    _, stderr = process.communicate()
+    returncode, errors = process.returncode, stderr
+
   if returncode != 0:
     print errors
 
