Add remaining changes for bootstrap build on OpenBSD.
I have tested these changes via a bootstrap build on OpenBSD 6.6-current (amd64 architecture). The resulting `bazel` binary appeared to work in some simple testing involving `cc_library`, `cc_binary`, `java_library`, and `java_binary`.
Known issues/limitations:
- Building a `java_binary`'s deploy JAR fails because the `singlejar` tool fails to build. I intend to investigate soon.
- Running Bazel requires a `--host_javabase=@local_jdk//:jdk` flag.
- Sandboxing is unsupported.
This change, split out of the larger PR https://github.com/bazelbuild/bazel/pull/10274, is part of the OpenBSD port in https://github.com/bazelbuild/bazel/issues/10250. Most of the changes in that larger PR have already been committed via several smaller PRs (see the PRs linked from https://github.com/bazelbuild/bazel/issues/10250). This PR collects the remaining changes.
Closes #10567.
PiperOrigin-RevId: 290745757
diff --git a/scripts/packages/template_bin.sh b/scripts/packages/template_bin.sh
index ca97e72..0c27a4d 100755
--- a/scripts/packages/template_bin.sh
+++ b/scripts/packages/template_bin.sh
@@ -115,6 +115,10 @@
JAVA_HOME="/usr/local/openjdk8"
BASHRC="~/.bashrc"
;;
+ openbsd)
+ JAVA_HOME="/usr/local/jdk-1.8.0"
+ BASHRC="~/.bashrc"
+ ;;
darwin)
JAVA_HOME="$(/usr/libexec/java_home -v ${JAVA_VERSION}+ 2> /dev/null)" || true
BASHRC="~/.bash_profile"