pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/bazel



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Mon Jan  1 12:01:01 UTC 2024

Added Files:
        pkgsrc/devel/bazel: DESCR Makefile PLIST distinfo
        pkgsrc/devel/bazel/patches: patch-distdir__deps.bzl
            patch-scripts_bootstrap_buildenv.sh patch-scripts_packages_BUILD
            patch-scripts_packages_template__bin.sh patch-src_BUILD
            patch-src_conditions_BUILD patch-src_conditions_BUILD.tools
            patch-src_main_cpp_BUILD patch-src_main_cpp_blaze__util__bsd.cc
            patch-src_main_java_com_google_devtools_build_lib_analysis_ShellConfiguration.java
            patch-src_main_java_com_google_devtools_build_lib_analysis_config_AutoCpuConverter.java
            patch-src_main_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunction.java
            patch-src_main_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProvider.java
            patch-src_main_java_com_google_devtools_build_lib_jni_JniLoader.java
            patch-src_main_java_com_google_devtools_build_lib_runtime_CommonCommandOptions.java
            patch-src_main_java_com_google_devtools_build_lib_runtime_ConfigExpander.java
            patch-src_main_java_com_google_devtools_build_lib_util_OS.java
            patch-src_main_native_BUILD patch-src_main_native_unix__jni.h
            patch-src_main_native_unix__jni__bsd.cc patch-src_main_tools_BUILD
            patch-src_main_tools_process-tools-darwin.cc
            patch-src_test_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunctionTest.java
            patch-src_test_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProviderTest.java
            patch-src_test_java_com_google_devtools_build_lib_packages_util_MockPlatformSupport.java
            patch-src_test_java_com_google_devtools_build_lib_platform_SleepPreventionModuleTest.java
            patch-src_test_java_com_google_devtools_build_lib_runtime_BlazeOptionHandlerTest.java
            patch-src_test_java_com_google_devtools_build_lib_runtime_commands_CleanCommandRecommendsAsyncTest.java
            patch-src_test_shell_bazel_remote_remote__execution__test.sh
            patch-src_test_shell_bazel_unicode__filenames__test.sh
            patch-src_test_shell_shell__utils.sh
            patch-src_tools_singlejar_BUILD patch-src_tools_singlejar_diag.h
            patch-src_tools_singlejar_mapped__file__posix.inc
            patch-src_tools_singlejar_port.h
            patch-src_tools_singlejar_zip__headers.h patch-third__party_BUILD
            patch-third__party_abseil-cpp_netbsd-sunos.patch
            patch-third__party_grpc_netbsd-config.patch
            patch-third__party_upb_upb-bazel-clang.patch
            patch-third__party_zstd-jni_zstd-jni.BUILD
            patch-tools_cpp_BUILD.static.bsd
            patch-tools_cpp_bsd__cc__toolchain__config.bzl
            patch-tools_cpp_cc__configure.bzl
            patch-tools_cpp_lib__cc__configure.bzl
            patch-tools_cpp_unix__cc__configure.bzl
            patch-tools_jdk_BUILD.java__tools patch-tools_jdk_BUILD.tools
            patch-tools_jdk_jdk__build__file.bzl patch-tools_platforms_BUILD
            patch-tools_platforms_BUILD.tools

Log Message:
devel/bazel: import bazel-6.4.0

{Fast, Correct} - Choose two

Build and test software of any size, quickly and reliably.

* Speed up your builds and tests:
  Bazel rebuilds only what is necessary.
  With advanced local and distributed caching, optimized dependency analysis
  and parallel execution, you get fast and incremental builds.

* One tool, multiple languages:
  Build and test Java, C++, Android, iOS, Go,
  and a wide variety of other language platforms.
  Bazel runs on Windows, macOS, and Linux.

* Scalable:
  Bazel helps you scale your organization, codebase, and
  continuous integration solution. It handles codebases of any size,
  in multiple repositories or a huge monorepo.

* Extensible to your needs:
  Easily add support for new languages and platforms with Bazel's familiar
  extension language. Share and re-use language rules written
  by the growing Bazel community.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 pkgsrc/devel/bazel/DESCR pkgsrc/devel/bazel/PLIST \
    pkgsrc/devel/bazel/distinfo
cvs rdiff -u -r0 -r1.5 pkgsrc/devel/bazel/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/bazel/patches/patch-distdir__deps.bzl \
    pkgsrc/devel/bazel/patches/patch-scripts_bootstrap_buildenv.sh \
    pkgsrc/devel/bazel/patches/patch-scripts_packages_BUILD \
    pkgsrc/devel/bazel/patches/patch-scripts_packages_template__bin.sh \
    pkgsrc/devel/bazel/patches/patch-src_BUILD \
    pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD \
    pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD.tools \
    pkgsrc/devel/bazel/patches/patch-src_main_cpp_BUILD \
    pkgsrc/devel/bazel/patches/patch-src_main_cpp_blaze__util__bsd.cc \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_ShellConfiguration.java \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_config_AutoCpuConverter.java \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunction.java \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProvider.java \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_jni_JniLoader.java \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_CommonCommandOptions.java \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_ConfigExpander.java \
    pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_util_OS.java \
    pkgsrc/devel/bazel/patches/patch-src_main_native_BUILD \
    pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni.h \
    pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni__bsd.cc \
    pkgsrc/devel/bazel/patches/patch-src_main_tools_BUILD \
    pkgsrc/devel/bazel/patches/patch-src_main_tools_process-tools-darwin.cc \
    pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunctionTest.java \
    pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProviderTest.java \
    pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_packages_util_MockPlatformSupport.java \
    pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_platform_SleepPreventionModuleTest.java \
    pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_BlazeOptionHandlerTest.java \
    pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_commands_CleanCommandRecommendsAsyncTest.java \
    pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_remote_remote__execution__test.sh \
    pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_unicode__filenames__test.sh \
    pkgsrc/devel/bazel/patches/patch-src_test_shell_shell__utils.sh \
    pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_BUILD \
    pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_diag.h \
    pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_mapped__file__posix.inc \
    pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_port.h \
    pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_zip__headers.h \
    pkgsrc/devel/bazel/patches/patch-third__party_BUILD \
    pkgsrc/devel/bazel/patches/patch-third__party_abseil-cpp_netbsd-sunos.patch \
    pkgsrc/devel/bazel/patches/patch-third__party_grpc_netbsd-config.patch \
    pkgsrc/devel/bazel/patches/patch-third__party_upb_upb-bazel-clang.patch \
    pkgsrc/devel/bazel/patches/patch-third__party_zstd-jni_zstd-jni.BUILD \
    pkgsrc/devel/bazel/patches/patch-tools_cpp_BUILD.static.bsd \
    pkgsrc/devel/bazel/patches/patch-tools_cpp_bsd__cc__toolchain__config.bzl \
    pkgsrc/devel/bazel/patches/patch-tools_cpp_cc__configure.bzl \
    pkgsrc/devel/bazel/patches/patch-tools_cpp_lib__cc__configure.bzl \
    pkgsrc/devel/bazel/patches/patch-tools_cpp_unix__cc__configure.bzl \
    pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.java__tools \
    pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.tools \
    pkgsrc/devel/bazel/patches/patch-tools_jdk_jdk__build__file.bzl \
    pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD \
    pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD.tools

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/devel/bazel/DESCR
diff -u /dev/null pkgsrc/devel/bazel/DESCR:1.3
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/DESCR    Mon Jan  1 12:00:58 2024
@@ -0,0 +1,23 @@
+{Fast, Correct} - Choose two
+
+Build and test software of any size, quickly and reliably.
+
+* Speed up your builds and tests:
+  Bazel rebuilds only what is necessary.
+  With advanced local and distributed caching, optimized dependency analysis
+  and parallel execution, you get fast and incremental builds.
+
+* One tool, multiple languages:
+  Build and test Java, C++, Android, iOS, Go,
+  and a wide variety of other language platforms.
+  Bazel runs on Windows, macOS, and Linux.
+
+* Scalable:
+  Bazel helps you scale your organization, codebase, and
+  continuous integration solution. It handles codebases of any size,
+  in multiple repositories or a huge monorepo.
+
+* Extensible to your needs:
+  Easily add support for new languages and platforms with Bazel's familiar
+  extension language. Share and re-use language rules written
+  by the growing Bazel community.
Index: pkgsrc/devel/bazel/PLIST
diff -u /dev/null pkgsrc/devel/bazel/PLIST:1.3
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/PLIST    Mon Jan  1 12:00:58 2024
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.3 2024/01/01 12:00:58 ryoon Exp $
+bin/bazel
Index: pkgsrc/devel/bazel/distinfo
diff -u /dev/null pkgsrc/devel/bazel/distinfo:1.3
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/distinfo Mon Jan  1 12:00:58 2024
@@ -0,0 +1,56 @@
+$NetBSD: distinfo,v 1.3 2024/01/01 12:00:58 ryoon Exp $
+
+BLAKE2s (bazel-6.4.0-dist-netbsd.tar.gz) = a740abafc058fe6569dd181611fa6521f82dfc8aea26897a6349709842f388dc
+SHA512 (bazel-6.4.0-dist-netbsd.tar.gz) = 0f1edab7673148a4c5d077de0435d05ca8f25abc280416261d05ee2c3a79d028485d60e046babec23757d0b3b90576e9467b2fdc41b6f5c03ce6e805a00cb5ee
+Size (bazel-6.4.0-dist-netbsd.tar.gz) = 198661065 bytes
+SHA1 (patch-distdir__deps.bzl) = 83dead7d5c7374ae7ada4feec5ec3bbd18d9112b
+SHA1 (patch-scripts_bootstrap_buildenv.sh) = 7590cf62b1b7abe722addeddd3d4f0595ebc2a1f
+SHA1 (patch-scripts_packages_BUILD) = 9cbd73caefe9f7b1b23cbbedf3657ee849d4dfdc
+SHA1 (patch-scripts_packages_template__bin.sh) = 8e5c504041bd7a74c3f83177c58844428fc03c07
+SHA1 (patch-src_BUILD) = cd8858313bec19f56c148944eea0962c9ef83d98
+SHA1 (patch-src_conditions_BUILD) = 5e099200f294e5905a09d323d95161784586e91c
+SHA1 (patch-src_conditions_BUILD.tools) = aec0d6cb07d19229a0e29827b4716c35816c4a7e
+SHA1 (patch-src_main_cpp_BUILD) = f14c549105eeba47593842569822fb2f65a01479
+SHA1 (patch-src_main_cpp_blaze__util__bsd.cc) = 1495bac14b4644e5317c4866bcfa2941eb99af34
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_analysis_ShellConfiguration.java) = 2030b61056c3919b68dfa22a133e2c66f14ad3c7
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_analysis_config_AutoCpuConverter.java) = 2e4158f0c25afab27abf4316f0580ba99cbbd1eb
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunction.java) = fb8e2c15b99af685daffa23577da09223fc8cd4b
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProvider.java) = 1cd3916bd1d46a4a3f138abced90d935d5efe0fe
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_jni_JniLoader.java) = 67bd0f3c49b4578788f7915a66e289f9eff811e6
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_runtime_CommonCommandOptions.java) = f4a3ee5d9a2cbb59f0523c8eb4b040e9b1f5b67b
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_runtime_ConfigExpander.java) = 88d0fa5f4ba3ce24f4ff5ccdae8733928ce7ae31
+SHA1 (patch-src_main_java_com_google_devtools_build_lib_util_OS.java) = c6a3cbbfad7ed93c98b5c3ff1a7180896e9bec47
+SHA1 (patch-src_main_native_BUILD) = 6c836b178c62086912f5d04f3033ac3ddd6e54fc
+SHA1 (patch-src_main_native_unix__jni.h) = c400b1c16e24bc4aa6d3bed9b3deab06b070bd59
+SHA1 (patch-src_main_native_unix__jni__bsd.cc) = 609401cf5a5d7c1aa51857325975d725c86604f2
+SHA1 (patch-src_main_tools_BUILD) = b3367d262baeaf11270adf2d07bca8a454c34d18
+SHA1 (patch-src_main_tools_process-tools-darwin.cc) = 1dbd651db7168d1d271b35360563a093c4b9c93c
+SHA1 (patch-src_test_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunctionTest.java) = 7864beee5b5578306a5658dda2fb208e3bd96b88
+SHA1 (patch-src_test_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProviderTest.java) = 32f502ee4a7e8544d756549eb731e4729295f116
+SHA1 (patch-src_test_java_com_google_devtools_build_lib_packages_util_MockPlatformSupport.java) = 2e5f30990b416e38fdce6880dc4d62a9efe43bd7
+SHA1 (patch-src_test_java_com_google_devtools_build_lib_platform_SleepPreventionModuleTest.java) = c319becdb97dc2f943f4efab4dee5f2111335249
+SHA1 (patch-src_test_java_com_google_devtools_build_lib_runtime_BlazeOptionHandlerTest.java) = 0ba888236aa71b178b5c4ad25d8467699fdaf0e8
+SHA1 (patch-src_test_java_com_google_devtools_build_lib_runtime_commands_CleanCommandRecommendsAsyncTest.java) = 2277335022ef5f48671f41fab58c791bdd752fe3
+SHA1 (patch-src_test_shell_bazel_remote_remote__execution__test.sh) = c397b0bff97b6e13017e0b87c049e741860aab1d
+SHA1 (patch-src_test_shell_bazel_unicode__filenames__test.sh) = 72e74231ccec777abc78afdd7e851be72364753b
+SHA1 (patch-src_test_shell_shell__utils.sh) = c8de670f9f210adbbf7963bea61d98ac7fde8dde
+SHA1 (patch-src_tools_singlejar_BUILD) = ea7fa7f12c4e5b209f556cbbd2bfa35a74bc7c50
+SHA1 (patch-src_tools_singlejar_diag.h) = a008b77283d31a63ee13edc9259cd8eeaed5498c
+SHA1 (patch-src_tools_singlejar_mapped__file__posix.inc) = fc9d9407d173ad95984cf53ac8bb44e23c37a9f0
+SHA1 (patch-src_tools_singlejar_port.h) = ef1e7ad8eb101aa76e794f95f6b4eb20155146d8
+SHA1 (patch-src_tools_singlejar_zip__headers.h) = 0f2f98f4677118214c7b93cbfeb9399c3d0939b1
+SHA1 (patch-third__party_BUILD) = 05d665afc9d1697867102b3737467241f4b2b610
+SHA1 (patch-third__party_abseil-cpp_netbsd-sunos.patch) = c9ff33d2c331312736db8f26c47e8e0b6d7a671f
+SHA1 (patch-third__party_grpc_netbsd-config.patch) = ea14e800a118a3541356c00df5d8edb1aed309fa
+SHA1 (patch-third__party_upb_upb-bazel-clang.patch) = 5a734e360c2a8cd685695adeab06cc26f062ec25
+SHA1 (patch-third__party_zstd-jni_zstd-jni.BUILD) = 338d636638b429da3f8a695cc15010174651dd23
+SHA1 (patch-tools_cpp_BUILD.static.bsd) = af9e8cf9f2f069bc4264f4ab3e57aa1e8686946a
+SHA1 (patch-tools_cpp_bsd__cc__toolchain__config.bzl) = febdaa93ed9de3863403fc3c629c7c71df9228d8
+SHA1 (patch-tools_cpp_cc__configure.bzl) = 24cd5bb7b7a09d12853a7b19a8c41b875a51a30f
+SHA1 (patch-tools_cpp_lib__cc__configure.bzl) = 02a5c867e61f7f59fa2fd61e70548c25448aa366
+SHA1 (patch-tools_cpp_unix__cc__configure.bzl) = a5d181c89fd032e02032d27d0189a8db6a936de4
+SHA1 (patch-tools_jdk_BUILD.java__tools) = 5b7e1e2c0db74afe7fd8dfbd71cd9c218943c9af
+SHA1 (patch-tools_jdk_BUILD.tools) = 6d885bb5735ece725b8aaa89cdea7ccd3e52f4fa
+SHA1 (patch-tools_jdk_jdk__build__file.bzl) = ba8efebeca29d66ab84915b94fd3edfb69319880
+SHA1 (patch-tools_platforms_BUILD) = 11fe48b55a3211b92a80e7e914ee3c4e9880444a
+SHA1 (patch-tools_platforms_BUILD.tools) = 07d198d96000982bce176ab24a45c55270d7d4e6

Index: pkgsrc/devel/bazel/Makefile
diff -u /dev/null pkgsrc/devel/bazel/Makefile:1.5
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/Makefile Mon Jan  1 12:00:58 2024
@@ -0,0 +1,80 @@
+# $NetBSD: Makefile,v 1.5 2024/01/01 12:00:58 ryoon Exp $
+
+# Java project does not work as follows:
+# Error: could not find libjava.so
+# Error: Could not find Java SE Runtime Environment.
+
+# To bootstrap Bezel, apply all patches and run as do-build target
+# defines under Linux.
+
+.if UPSTREAM
+DISTNAME=      bazel-6.4.0-dist
+PKGNAME=       ${DISTNAME:S/-dist//}
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=bazelbuild/}
+GITHUB_PROJECT=        bazel
+GITHUB_RELEASE= ${PKGVERSION_NOREV}
+EXTRACT_SUFX=  .zip
+.else
+DISTNAME=      bazel-6.4.0-dist-netbsd
+PKGNAME=       ${DISTNAME:S/-dist-netbsd//}
+MASTER_SITES=  ${MASTER_SITE_LOCAL}
+.endif
+CATEGORIES=    devel
+
+MAINTAINER=    ryoon%NetBSD.org@localhost
+HOMEPAGE=      https://bazel.build/
+COMMENT=       Fast and correct build automation tool
+LICENSE=       apache-2.0
+
+BROKEN_ON_PLATFORM=    ${LP32PLATFORMS}
+
+WRKSRC=                ${WRKDIR}
+USE_TOOLS+=    bash pkg-config unzip zip
+USE_LANGUAGES= c c++
+
+CHECK_PIE_SUPPORTED=   no
+
+USE_JAVA=              yes
+USE_JAVA2=             11
+PKG_JVMS_ACCEPTED=     openjdk11
+
+REPLACE_BASH+= *.sh
+REPLACE_BASH+= scripts/*.sh
+REPLACE_BASH+= tools/*.sh
+REPLACE_BASH+= tools/*/*.sh
+
+SUBST_CLASSES+=                prefix
+SUBST_STAGE.prefix=    pre-configure
+SUBST_MESSAGE.prefix=  Setting PREFIX
+SUBST_FILES.prefix+=   tools/cpp/bsd_cc_toolchain_config.bzl
+SUBST_VARS.prefix+=    PREFIX
+
+EXTRA_BAZEL_ARGS+=     --tool_java_runtime_version=local_jdk
+EXTRA_BAZEL_ARGS+=     --subcommands
+MAKE_ENV+=             EXTRA_BAZEL_ARGS=${EXTRA_BAZEL_ARGS:Q}
+
+INSTALLATION_DIRS+=    bin
+
+do-patch:
+       # Do not perform patching. The tarball includes all patches.
+
+pre-configure:
+       ${FIND} ${WRKSRC} | ${GREP} '\.orig$$' | xargs ${RM}
+       # Do not use wrapped toolchain after installation
+       ${RM} -r ${WRKDIR}/.cwrapper
+
+do-build:
+       cd ${WRKSRC} \
+       && env ${MAKE_ENV} \
+               ${BASH} ./compile.sh
+
+do-install:
+       # Do not strip bazel binary. It includes .zip archive.
+       ${INSTALL_SCRIPT} ${WRKSRC}/output/bazel \
+               ${DESTDIR}${PREFIX}/bin
+
+# GCC generates unexpected .d files when -MD is specified.
+.include "../../lang/clang/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../mk/java-vm.mk"
+.include "../../mk/bsd.pkg.mk"

Index: pkgsrc/devel/bazel/patches/patch-distdir__deps.bzl
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-distdir__deps.bzl:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-distdir__deps.bzl  Mon Jan  1 12:00:58 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-distdir__deps.bzl,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- distdir_deps.bzl.orig      1979-12-31 15:00:00.000000000 +0000
++++ distdir_deps.bzl
+@@ -123,6 +123,7 @@ DIST_DEPS = {
+         "patches": [
+             "//third_party/grpc:grpc_1.47.0.patch",
+             "//third_party/grpc:grpc_1.47.0.win_arm64.patch",
++            "//third_party/grpc:netbsd-config.patch",
+         ],
+         "used_in": [
+             "additional_distfiles",
+@@ -240,6 +241,9 @@ DIST_DEPS = {
+             "test_WORKSPACE_files",
+         ],
+         "strip_prefix": "abseil-cpp-20211102.0",
++        "patches": [
++            "//third_party:abseil-cpp/netbsd-sunos.patch",
++        ],
+     },
+     "zstd-jni": {
+         "archive": "v1.5.2-3.zip",
Index: pkgsrc/devel/bazel/patches/patch-scripts_bootstrap_buildenv.sh
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-scripts_bootstrap_buildenv.sh:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-scripts_bootstrap_buildenv.sh      Mon Jan  1 12:00:58 2024
@@ -0,0 +1,16 @@
+$NetBSD: patch-scripts_bootstrap_buildenv.sh,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- scripts/bootstrap/buildenv.sh.orig 2023-11-28 16:39:24.563015783 +0000
++++ scripts/bootstrap/buildenv.sh
+@@ -93,6 +93,11 @@ freebsd)
+   JAVA_HOME="${JAVA_HOME:-/usr/local/openjdk11}"
+   ;;
+ 
++netbsd)
++  # JAVA_HOME must point to a Java installation.
++  JAVA_HOME="${JAVA_HOME:-/usr/pkg/java/openjdk11}"
++  ;;
++
+ openbsd)
+   # JAVA_HOME must point to a Java installation.
+   JAVA_HOME="${JAVA_HOME:-/usr/local/jdk-11}"
Index: pkgsrc/devel/bazel/patches/patch-scripts_packages_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-scripts_packages_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-scripts_packages_BUILD     Mon Jan  1 12:00:58 2024
@@ -0,0 +1,12 @@
+$NetBSD: patch-scripts_packages_BUILD,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- scripts/packages/BUILD.orig        2023-11-28 16:36:12.390418705 +0000
++++ scripts/packages/BUILD
+@@ -23,6 +23,7 @@ filegroup(
+             ":zip-bazel-exe_nojdk",
+         ],
+         "//src/conditions:freebsd": [],
++        "//src/conditions:netbsd": [],
+         "//src/conditions:openbsd": [],
+         "//src/conditions:darwin": [
+             ":with-jdk/install.sh",
Index: pkgsrc/devel/bazel/patches/patch-scripts_packages_template__bin.sh
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-scripts_packages_template__bin.sh:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-scripts_packages_template__bin.sh  Mon Jan  1 12:00:58 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-scripts_packages_template__bin.sh,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- scripts/packages/template_bin.sh.orig      2023-11-28 16:39:59.898140894 +0000
++++ scripts/packages/template_bin.sh
+@@ -115,6 +115,10 @@ if [ -z "${JAVA_HOME-}" ]; then
+       JAVA_HOME="/usr/local/openjdk8"
+       BASHRC="~/.bashrc"
+       ;;
++    netbsd)
++      JAVA_HOME="/usr/pkg/java/openjdk8"
++      BASHRC="~/.bashrc"
++      ;;
+     openbsd)
+       JAVA_HOME="/usr/local/jdk-1.8.0"
+       BASHRC="~/.bashrc"
Index: pkgsrc/devel/bazel/patches/patch-src_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_BUILD  Mon Jan  1 12:00:58 2024
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_BUILD,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/BUILD.orig     2023-11-29 11:57:08.056842619 +0000
++++ src/BUILD
+@@ -34,6 +34,7 @@ md5_cmd = "set -e -o pipefail && %s $(SR
+     cmd = select({
+         "//src/conditions:darwin": md5_cmd % ("/sbin/md5", "/sbin/md5", "head -c 32"),
+         "//src/conditions:freebsd": md5_cmd % ("/sbin/md5", "/sbin/md5", "head -c 32"),
++        "//src/conditions:netbsd": md5_cmd % ("/usr/bin/md5", "/usr/bin/md5", "head -c 32"),
+         # We avoid using the `head` tool's `-c` option, since it does not exist
+         # on OpenBSD.
+         "//src/conditions:openbsd": md5_cmd % ("/bin/md5", "/bin/md5", "dd bs=32 count=1"),
+@@ -349,6 +350,7 @@ genrule(
+     srcs = ["package-bazel.sh"],
+     outs = ["package-bazel-on-host-platform.sh"],
+     cmd = select({
++        "//src/conditions:netbsd": "cat $(SRCS) | sed -e 's@#!/bin/bash@#!/usr/pkg/bin/bash@' > $@",
+         "//src/conditions:openbsd": "cat $(SRCS) | sed -e 's@#!/bin/bash@#!/usr/local/bin/bash@' > $@",
+         "//conditions:default": "cp $(SRCS) $@",
+     }),
Index: pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD       Mon Jan  1 12:00:58 2024
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_conditions_BUILD,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/conditions/BUILD.orig  2023-11-29 00:17:37.410068236 +0000
++++ src/conditions/BUILD
+@@ -160,6 +160,12 @@ config_setting(
+ )
+ 
+ config_setting(
++    name = "netbsd",
++    constraint_values = ["@platforms//os:netbsd"],
++    visibility = ["//visibility:public"],
++)
++
++config_setting(
+     name = "openbsd",
+     constraint_values = ["@platforms//os:openbsd"],
+     visibility = ["//visibility:public"],
Index: pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD.tools
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD.tools:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_conditions_BUILD.tools Mon Jan  1 12:00:58 2024
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_conditions_BUILD.tools,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/conditions/BUILD.tools.orig    2023-11-28 16:36:42.721951524 +0000
++++ src/conditions/BUILD.tools
+@@ -7,6 +7,12 @@ config_setting(
+ )
+ 
+ config_setting(
++    name = "netbsd",
++    constraint_values = ["@platforms//os:netbsd"],
++    visibility = ["//visibility:public"],
++)
++
++config_setting(
+     name = "openbsd",
+     constraint_values = ["@platforms//os:openbsd"],
+     visibility = ["//visibility:public"],
Index: pkgsrc/devel/bazel/patches/patch-src_main_cpp_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_cpp_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_cpp_BUILD Mon Jan  1 12:00:58 2024
@@ -0,0 +1,33 @@
+$NetBSD: patch-src_main_cpp_BUILD,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/main/cpp/BUILD.orig    2023-11-28 16:40:47.721393251 +0000
++++ src/main/cpp/BUILD
+@@ -26,6 +26,10 @@ cc_library(
+             "blaze_util_bsd.cc",
+             "blaze_util_posix.cc",
+         ],
++        "//src/conditions:netbsd": [
++            "blaze_util_bsd.cc",
++            "blaze_util_posix.cc",
++        ],
+         "//src/conditions:openbsd": [
+             "blaze_util_bsd.cc",
+             "blaze_util_posix.cc",
+@@ -49,6 +53,8 @@ cc_library(
+         ],
+         "//src/conditions:freebsd": [
+         ],
++        "//src/conditions:netbsd": [
++        ],
+         "//src/conditions:openbsd": [
+         ],
+         "//src/conditions:windows": WIN_LINK_OPTS,
+@@ -110,6 +116,8 @@ cc_binary(
+             "-lprocstat",
+             "-lm",
+         ],
++        "//src/conditions:netbsd": [
++        ],
+         "//src/conditions:openbsd": [
+         ],
+         "//src/conditions:windows": [
Index: pkgsrc/devel/bazel/patches/patch-src_main_cpp_blaze__util__bsd.cc
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_cpp_blaze__util__bsd.cc:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_cpp_blaze__util__bsd.cc   Mon Jan  1 12:00:58 2024
@@ -0,0 +1,41 @@
+$NetBSD: patch-src_main_cpp_blaze__util__bsd.cc,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/main/cpp/blaze_util_bsd.cc.orig        2023-11-29 06:03:37.228876616 +0000
++++ src/main/cpp/blaze_util_bsd.cc
+@@ -15,6 +15,8 @@
+ #if defined(__FreeBSD__)
+ # define HAVE_PROCSTAT
+ # define STANDARD_JAVABASE "/usr/local/openjdk8"
++#elif defined(__NetBSD__)
++# define STANDARD_JAVABASE "/usr/pkg/java/openjdk11"
+ #elif defined(__OpenBSD__)
+ # define STANDARD_JAVABASE "/usr/local/jdk-17"
+ #else
+@@ -36,6 +38,7 @@
+ #include <sys/param.h>
+ #include <sys/queue.h>
+ #include <sys/socket.h>
++#include <sys/statvfs.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+ #include <sys/un.h>
+@@ -74,8 +77,8 @@ string GetOutputRoot() {
+ }
+ 
+ void WarnFilesystemType(const blaze_util::Path &output_base) {
+-  struct statfs buf = {};
+-  if (statfs(output_base.AsNativePath().c_str(), &buf) < 0) {
++  struct statvfs buf = {};
++  if (statvfs(output_base.AsNativePath().c_str(), &buf) < 0) {
+     BAZEL_LOG(WARNING) << "couldn't get file system type information for '"
+                        << output_base.AsPrintablePath()
+                        << "': " << strerror(errno);
+@@ -112,7 +115,7 @@ string GetSelfPath(const char* argv0) {
+   }
+   procstat_close(procstat);
+   return string(buffer);
+-#elif defined(__OpenBSD__)
++#elif defined(__OpenBSD__) || defined(__NetBSD__)
+   // OpenBSD does not provide a way for a running process to find a path to its
+   // own executable, so we try to figure out a path by inspecting argv[0]. In
+   // theory this is inadequate, since the parent process can set argv[0] to
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_ShellConfiguration.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_ShellConfiguration.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_ShellConfiguration.java       Mon Jan  1 12:00:58 2024
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_analysis_ShellConfiguration.java,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/analysis/ShellConfiguration.java.orig  2023-11-28 16:42:24.000271398 +0000
++++ src/main/java/com/google/devtools/build/lib/analysis/ShellConfiguration.java
+@@ -84,6 +84,11 @@ public class ShellConfiguration extends 
+                   OS_CONSTRAINT_SETTING,
+                   Label.parseAbsoluteUnchecked("@platforms//os:freebsd")))
+           .put(
++              OS.NETBSD,
++              ConstraintValueInfo.create(
++                  OS_CONSTRAINT_SETTING,
++                  Label.parseAbsoluteUnchecked("@platforms//os:netbsd")))
++          .put(
+               OS.OPENBSD,
+               ConstraintValueInfo.create(
+                   OS_CONSTRAINT_SETTING,
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_config_AutoCpuConverter.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_config_AutoCpuConverter.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_analysis_config_AutoCpuConverter.java  Mon Jan  1 12:00:58 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_analysis_config_AutoCpuConverter.java,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java.orig     2023-11-28 16:41:36.908346594 +0000
++++ src/main/java/com/google/devtools/build/lib/analysis/config/AutoCpuConverter.java
+@@ -44,6 +44,8 @@ public class AutoCpuConverter extends Co
+           }
+         case FREEBSD:
+           return "freebsd";
++        case NETBSD:
++          return "netbsd";
+         case OPENBSD:
+           return "openbsd";
+         case WINDOWS:
+@@ -98,6 +100,8 @@ public class AutoCpuConverter extends Co
+       return Pair.of(CPU.getCurrent(), OS.DARWIN);
+     } else if (input.startsWith("freebsd")) {
+       return Pair.of(CPU.getCurrent(), OS.FREEBSD);
++    } else if (input.startsWith("netbsd")) {
++      return Pair.of(CPU.getCurrent(), OS.NETBSD);
+     } else if (input.startsWith("openbsd")) {
+       return Pair.of(CPU.getCurrent(), OS.OPENBSD);
+     } else if (input.startsWith("x64_windows")) {
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunction.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunction.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunction.java      Mon Jan  1 12:00:58 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunction.java,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java.orig 2023-11-28 16:37:24.063463278 +0000
++++ src/main/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunction.java
+@@ -135,6 +135,8 @@ public class LocalConfigPlatformFunction
+         return "@platforms//os:osx";
+       case FREEBSD:
+         return "@platforms//os:freebsd";
++      case NETBSD:
++        return "@platforms//os:netbsd";
+       case OPENBSD:
+         return "@platforms//os:openbsd";
+       case LINUX:
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProvider.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProvider.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProvider.java        Mon Jan  1 12:00:58 2024
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProvider.java,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java.orig   2023-11-30 05:47:44.632845320 +0000
++++ src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
+@@ -173,6 +173,7 @@ public class BazelRuleClassProvider {
+       ImmutableMap.<OS, PathFragment>builder()
+           .put(OS.WINDOWS, PathFragment.create("c:/tools/msys64/usr/bin/bash.exe"))
+           .put(OS.FREEBSD, PathFragment.create("/usr/local/bin/bash"))
++          .put(OS.NETBSD, PathFragment.create("/usr/pkg/bin/bash"))
+           .put(OS.OPENBSD, PathFragment.create("/usr/local/bin/bash"))
+           .put(OS.UNKNOWN, FALLBACK_SHELL)
+           .buildOrThrow();
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_jni_JniLoader.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_jni_JniLoader.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_jni_JniLoader.java     Mon Jan  1 12:00:58 2024
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_jni_JniLoader.java,v 1.1 2024/01/01 12:00:58 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/jni/JniLoader.java.orig        2023-11-30 05:46:49.398016529 +0000
++++ src/main/java/com/google/devtools/build/lib/jni/JniLoader.java
+@@ -39,6 +39,7 @@ public final class JniLoader {
+       switch (OS.getCurrent()) {
+         case LINUX:
+         case FREEBSD:
++        case NETBSD:
+         case OPENBSD:
+         case UNKNOWN:
+           loadLibrary("main/native/libunix_jni.so");
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_CommonCommandOptions.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_CommonCommandOptions.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_CommonCommandOptions.java      Mon Jan  1 12:00:59 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_runtime_CommonCommandOptions.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java.orig 2023-11-28 16:44:31.844523584 +0000
++++ src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
+@@ -51,7 +51,7 @@ public class CommonCommandOptions extend
+           "If true, Bazel picks up host-OS-specific config lines from bazelrc files. For example, "
+               + "if the host OS is Linux and you run bazel build, Bazel picks up lines starting "
+               + "with build:linux. Supported OS identifiers are linux, macos, windows, freebsd, "
+-              + "and openbsd. Enabling this flag is equivalent to using --config=linux on Linux, "
++              + "netbsd and openbsd. Enabling this flag is equivalent to using --config=linux on Linux, "
+               + "--config=windows on Windows, etc.")
+   public boolean enablePlatformSpecificConfig;
+ 
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_ConfigExpander.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_ConfigExpander.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_runtime_ConfigExpander.java    Mon Jan  1 12:00:59 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_runtime_ConfigExpander.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java.orig       2023-11-28 16:45:00.372600192 +0000
++++ src/main/java/com/google/devtools/build/lib/runtime/ConfigExpander.java
+@@ -48,6 +48,8 @@ final class ConfigExpander {
+         return "windows";
+       case FREEBSD:
+         return "freebsd";
++      case NETBSD:
++        return "netbsd";
+       case OPENBSD:
+         return "openbsd";
+       default:
Index: pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_util_OS.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_util_OS.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_java_com_google_devtools_build_lib_util_OS.java   Mon Jan  1 12:00:59 2024
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_main_java_com_google_devtools_build_lib_util_OS.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/java/com/google/devtools/build/lib/util/OS.java.orig      1979-12-31 15:00:00.000000000 +0000
++++ src/main/java/com/google/devtools/build/lib/util/OS.java
+@@ -21,12 +21,13 @@ import java.util.EnumSet;
+ public enum OS {
+   DARWIN("osx", "Mac OS X"),
+   FREEBSD("freebsd", "FreeBSD"),
++  NETBSD("netbsd", "NetBSD"),
+   OPENBSD("openbsd", "OpenBSD"),
+   LINUX("linux", "Linux"),
+   WINDOWS("windows", "Windows"),
+   UNKNOWN("unknown", "");
+ 
+-  private static final EnumSet<OS> POSIX_COMPATIBLE = EnumSet.of(DARWIN, FREEBSD, OPENBSD, LINUX);
++  private static final EnumSet<OS> POSIX_COMPATIBLE = EnumSet.of(DARWIN, FREEBSD, NETBSD, OPENBSD, LINUX);
+ 
+   private final String canonicalName;
+   private final String detectionName;
Index: pkgsrc/devel/bazel/patches/patch-src_main_native_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_native_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_native_BUILD      Mon Jan  1 12:00:59 2024
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_main_native_BUILD,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/native/BUILD.orig 2023-11-28 16:45:20.409299941 +0000
++++ src/main/native/BUILD
+@@ -3,6 +3,7 @@ genrule(
+     srcs = select({
+         "//src/conditions:darwin": ["@bazel_tools//tools/jdk:jni_md_header-darwin"],
+         "//src/conditions:freebsd": ["@bazel_tools//tools/jdk:jni_md_header-freebsd"],
++        "//src/conditions:netbsd": ["@bazel_tools//tools/jdk:jni_md_header-netbsd"],
+         "//src/conditions:openbsd": ["@bazel_tools//tools/jdk:jni_md_header-openbsd"],
+         "//src/conditions:windows": ["@bazel_tools//tools/jdk:jni_md_header-windows"],
+         "//conditions:default": ["@bazel_tools//tools/jdk:jni_md_header-linux"],
+@@ -38,6 +39,7 @@ filegroup(
+             "darwin/util.h",
+         ],
+         "//src/conditions:freebsd": ["unix_jni_bsd.cc"],
++        "//src/conditions:netbsd": ["unix_jni_bsd.cc"],
+         "//src/conditions:openbsd": ["unix_jni_bsd.cc"],
+         "//conditions:default": ["unix_jni_linux.cc"],
+     }),
Index: pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni.h
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni.h:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni.h        Mon Jan  1 12:00:59 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_main_native_unix__jni.h,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/native/unix_jni.h.orig    2023-11-29 05:49:36.312797541 +0000
++++ src/main/native/unix_jni.h
+@@ -25,7 +25,7 @@
+ 
+ namespace blaze_jni {
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ // stat64 is deprecated on OS X/BSD.
+ typedef struct stat portable_stat_struct;
+ #define portable_stat ::stat
Index: pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni__bsd.cc
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni__bsd.cc:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_native_unix__jni__bsd.cc  Mon Jan  1 12:00:59 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_main_native_unix__jni__bsd.cc,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/native/unix_jni_bsd.cc.orig       2023-11-28 16:43:12.878427212 +0000
++++ src/main/native/unix_jni_bsd.cc
+@@ -15,6 +15,8 @@
+ #if defined(__FreeBSD__)
+ # define HAVE_EXTATTR
+ # define HAVE_SYSCTLBYNAME
++#elif defined(__NetBSD__)
++// XXX
+ #elif defined(__OpenBSD__)
+ // No sys/extattr.h or sysctlbyname on this platform.
+ #else
Index: pkgsrc/devel/bazel/patches/patch-src_main_tools_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_tools_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_tools_BUILD       Mon Jan  1 12:00:59 2024
@@ -0,0 +1,44 @@
+$NetBSD: patch-src_main_tools_BUILD,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/tools/BUILD.orig  2023-11-28 16:45:59.477101665 +0000
++++ src/main/tools/BUILD
+@@ -15,6 +15,7 @@ cc_library(
+     name = "process-tools",
+     srcs = ["process-tools.cc"] + select({
+         "//src/conditions:darwin": ["process-tools-darwin.cc"],
++        "//src/conditions:netbsd": ["process-tools-darwin.cc"],
+         "//src/conditions:openbsd": ["process-tools-darwin.cc"],
+         "//conditions:default": ["process-tools-linux.cc"],
+     }),
+@@ -40,6 +41,7 @@ cc_binary(
+     }),
+     linkopts = select({
+         "//src/conditions:darwin": ["-lm"],
++        "//src/conditions:netbsd": [],
+         "//src/conditions:openbsd": [],
+         "//src/conditions:windows": [],
+         "//conditions:default": [
+@@ -73,6 +75,7 @@ cc_binary(
+     srcs = select({
+         "//src/conditions:darwin": ["dummy-sandbox.c"],
+         "//src/conditions:freebsd": ["dummy-sandbox.c"],
++        "//src/conditions:netbsd": ["dummy-sandbox.c"],
+         "//src/conditions:openbsd": ["dummy-sandbox.c"],
+         "//src/conditions:windows": ["dummy-sandbox.c"],
+         "//conditions:default": [
+@@ -87,6 +90,7 @@ cc_binary(
+     linkopts = select({
+         "//src/conditions:darwin": [],
+         "//src/conditions:freebsd": [],
++        "//src/conditions:netbsd": [],
+         "//src/conditions:openbsd": [],
+         "//src/conditions:windows": [],
+         "//conditions:default": [
+@@ -97,6 +101,7 @@ cc_binary(
+     deps = select({
+         "//src/conditions:darwin": [],
+         "//src/conditions:freebsd": [],
++        "//src/conditions:netbsd": [],
+         "//src/conditions:openbsd": [],
+         "//src/conditions:windows": [],
+         "//conditions:default": [
Index: pkgsrc/devel/bazel/patches/patch-src_main_tools_process-tools-darwin.cc
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_main_tools_process-tools-darwin.cc:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_main_tools_process-tools-darwin.cc     Mon Jan  1 12:00:59 2024
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_main_tools_process-tools-darwin.cc,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/main/tools/process-tools-darwin.cc.orig        2023-11-30 00:21:24.455150308 +0000
++++ src/main/tools/process-tools-darwin.cc
+@@ -24,6 +24,10 @@
+ #include "src/main/tools/logging.h"
+ #include "src/main/tools/process-tools.h"
+ 
++#if defined(__NetBSD__)
++#define kinfo_proc kinfo_proc2
++#endif
++
+ int WaitForProcessToTerminate(pid_t pid) {
+   int kq;
+   if ((kq = kqueue()) == -1) {
+@@ -93,7 +97,7 @@ int WaitForProcessGroupToTerminate(pid_t
+     if (nprocs == 1) {
+       // Found only one process, which must be the leader because we have
+       // purposely expect it as a zombie with WaitForProcess.
+-#if defined(__OpenBSD__)
++#if defined(__OpenBSD__) || defined(__NetBSD__)
+       if (procs->p_pid != pgid) {
+ #else
+       if (procs->kp_proc.p_pid != pgid) {
Index: pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunctionTest.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunctionTest.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunctionTest.java  Mon Jan  1 12:00:59 2024
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_test_java_com_google_devtools_build_lib_bazel_repository_LocalConfigPlatformFunctionTest.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunctionTest.java.orig     2023-11-28 16:47:43.460647791 +0000
++++ src/test/java/com/google/devtools/build/lib/bazel/repository/LocalConfigPlatformFunctionTest.java
+@@ -87,6 +87,7 @@ public class LocalConfigPlatformFunction
+           new Object[] {OS.LINUX, "@platforms//os:linux"},
+           new Object[] {OS.DARWIN, "@platforms//os:osx"},
+           new Object[] {OS.FREEBSD, "@platforms//os:freebsd"},
++          new Object[] {OS.NETBSD, "@platforms//os:netbsd"},
+           new Object[] {OS.OPENBSD, "@platforms//os:openbsd"},
+           new Object[] {OS.WINDOWS, "@platforms//os:windows"});
+     }
Index: pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProviderTest.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProviderTest.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProviderTest.java    Mon Jan  1 12:00:59 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_test_java_com_google_devtools_build_lib_bazel_rules_BazelRuleClassProviderTest.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProviderTest.java.orig       2023-11-30 05:50:35.115838020 +0000
++++ src/test/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProviderTest.java
+@@ -218,6 +218,8 @@ public class BazelRuleClassProviderTest 
+         .isEqualTo(PathFragment.create("/bin/bash"));
+     assertThat(determineShellExecutable(OS.FREEBSD, null))
+         .isEqualTo(PathFragment.create("/usr/local/bin/bash"));
++    assertThat(determineShellExecutable(OS.NETBSD, null))
++        .isEqualTo(PathFragment.create("/usr/pkg/bin/bash"));
+     assertThat(determineShellExecutable(OS.OPENBSD, null))
+         .isEqualTo(PathFragment.create("/usr/local/bin/bash"));
+     assertThat(determineShellExecutable(OS.WINDOWS, null))
+@@ -231,6 +233,8 @@ public class BazelRuleClassProviderTest 
+         .isEqualTo(PathFragment.create("/bin/bash"));
+     assertThat(determineShellExecutable(OS.FREEBSD, binBash))
+         .isEqualTo(PathFragment.create("/bin/bash"));
++    assertThat(determineShellExecutable(OS.NETBSD, binBash))
++        .isEqualTo(PathFragment.create("/bin/bash"));
+     assertThat(determineShellExecutable(OS.OPENBSD, binBash))
+         .isEqualTo(PathFragment.create("/bin/bash"));
+     assertThat(determineShellExecutable(OS.WINDOWS, binBash))
Index: pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_packages_util_MockPlatformSupport.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_packages_util_MockPlatformSupport.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_packages_util_MockPlatformSupport.java Mon Jan  1 12:00:59 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_test_java_com_google_devtools_build_lib_packages_util_MockPlatformSupport.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java.orig    2023-11-28 16:47:15.246726723 +0000
++++ src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java
+@@ -136,6 +136,10 @@ public class MockPlatformSupport {
+         "    constraint_setting = ':os',",
+         ")",
+         "constraint_value(",
++        "    name = 'netbsd',",
++        "    constraint_setting = ':os',",
++        ")",
++        "constraint_value(",
+         "    name = 'openbsd',",
+         "    constraint_setting = ':os',",
+         ")");
Index: pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_platform_SleepPreventionModuleTest.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_platform_SleepPreventionModuleTest.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_platform_SleepPreventionModuleTest.java        Mon Jan  1 12:00:59 2024
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_test_java_com_google_devtools_build_lib_platform_SleepPreventionModuleTest.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/java/com/google/devtools/build/lib/platform/SleepPreventionModuleTest.java.orig   2023-11-30 05:51:43.180401312 +0000
++++ src/test/java/com/google/devtools/build/lib/platform/SleepPreventionModuleTest.java
+@@ -32,6 +32,7 @@ public final class SleepPreventionModule
+         return true;
+       case LINUX:
+       case FREEBSD:
++      case NETBSD:
+       case OPENBSD:
+       case UNKNOWN:
+         return false;
Index: pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_BlazeOptionHandlerTest.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_BlazeOptionHandlerTest.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_BlazeOptionHandlerTest.java    Mon Jan  1 12:00:59 2024
@@ -0,0 +1,32 @@
+$NetBSD: patch-src_test_java_com_google_devtools_build_lib_runtime_BlazeOptionHandlerTest.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/java/com/google/devtools/build/lib/runtime/BlazeOptionHandlerTest.java.orig       2023-11-28 16:50:58.267394320 +0000
++++ src/test/java/com/google/devtools/build/lib/runtime/BlazeOptionHandlerTest.java
+@@ -117,6 +117,7 @@ public class BlazeOptionHandlerTest {
+     structuredArgs.put("c0:windows", new RcChunkOfArgs("rc1", ImmutableList.of("command_windows")));
+     structuredArgs.put("c0:macos", new RcChunkOfArgs("rc1", ImmutableList.of("command_macos")));
+     structuredArgs.put("c0:freebsd", new RcChunkOfArgs("rc1", ImmutableList.of("command_freebsd")));
++    structuredArgs.put("c0:netbsd", new RcChunkOfArgs("rc1", ImmutableList.of("command_netbsd")));
+     structuredArgs.put("c0:openbsd", new RcChunkOfArgs("rc1", ImmutableList.of("command_openbsd")));
+     structuredArgs.put(
+         "c0:platform_config",
+@@ -283,6 +284,9 @@ public class BlazeOptionHandlerTest {
+       case FREEBSD:
+         assertThat(parser.getResidue()).containsExactly("command_freebsd");
+         break;
++      case NETBSD:
++        assertThat(parser.getResidue()).containsExactly("command_netbsd");
++        break;
+       case OPENBSD:
+         assertThat(parser.getResidue()).containsExactly("command_openbsd");
+         break;
+@@ -311,6 +315,9 @@ public class BlazeOptionHandlerTest {
+       case FREEBSD:
+         assertThat(parser.getResidue()).containsExactly("command_freebsd");
+         break;
++      case NETBSD:
++        assertThat(parser.getResidue()).containsExactly("command_netbsd");
++        break;
+       case OPENBSD:
+         assertThat(parser.getResidue()).containsExactly("command_openbsd");
+         break;
Index: pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_commands_CleanCommandRecommendsAsyncTest.java
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_commands_CleanCommandRecommendsAsyncTest.java:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_java_com_google_devtools_build_lib_runtime_commands_CleanCommandRecommendsAsyncTest.java  Mon Jan  1 12:00:59 2024
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_test_java_com_google_devtools_build_lib_runtime_commands_CleanCommandRecommendsAsyncTest.java,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/java/com/google/devtools/build/lib/runtime/commands/CleanCommandRecommendsAsyncTest.java.orig     2023-11-30 05:52:55.919903525 +0000
++++ src/test/java/com/google/devtools/build/lib/runtime/commands/CleanCommandRecommendsAsyncTest.java
+@@ -51,6 +51,7 @@ public class CleanCommandRecommendsAsync
+           {/* asyncOnCommandLine= */ true, OS.WINDOWS, false},
+           {/* asyncOnCommandLine= */ true, OS.DARWIN, false},
+           {/* asyncOnCommandLine= */ true, OS.FREEBSD, false},
++          {/* asyncOnCommandLine= */ true, OS.NETBSD, false},
+           {/* asyncOnCommandLine= */ true, OS.OPENBSD, false},
+           {/* asyncOnCommandLine= */ true, OS.UNKNOWN, false},
+ 
+@@ -59,6 +60,7 @@ public class CleanCommandRecommendsAsync
+           {/* asyncOnCommandLine= */ false, OS.WINDOWS, false},
+           {/* asyncOnCommandLine= */ false, OS.DARWIN, true},
+           {/* asyncOnCommandLine= */ false, OS.FREEBSD, true},
++          {/* asyncOnCommandLine= */ false, OS.NETBSD, true},
+           {/* asyncOnCommandLine= */ false, OS.OPENBSD, true},
+           {/* asyncOnCommandLine= */ false, OS.UNKNOWN, false},
+         });
Index: pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_remote_remote__execution__test.sh
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_remote_remote__execution__test.sh:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_remote_remote__execution__test.sh     Mon Jan  1 12:00:59 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-src_test_shell_bazel_remote_remote__execution__test.sh,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/shell/bazel/remote/remote_execution_test.sh.orig  2023-11-28 16:48:56.932298505 +0000
++++ src/test/shell/bazel/remote/remote_execution_test.sh
+@@ -197,7 +197,7 @@ EOF
+ # TODO(b/211478955): Deflake and re-enable.
+ function DISABLED_test_remote_grpc_via_unix_socket_proxy() {
+   case "$PLATFORM" in
+-  darwin|freebsd|linux|openbsd)
++  darwin|freebsd|linux|openbsd|netbsd)
+     ;;
+   *)
+     return 0
+@@ -236,7 +236,7 @@ EOF
+ # TODO(b/211478955): Deflake and re-enable.
+ function DISABLED_test_remote_grpc_via_unix_socket_direct() {
+   case "$PLATFORM" in
+-  darwin|freebsd|linux|openbsd)
++  darwin|freebsd|linux|openbsd|netbsd)
+     ;;
+   *)
+     return 0
Index: pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_unicode__filenames__test.sh
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_unicode__filenames__test.sh:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_shell_bazel_unicode__filenames__test.sh   Mon Jan  1 12:00:59 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_test_shell_bazel_unicode__filenames__test.sh,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/shell/bazel/unicode_filenames_test.sh.orig        2023-11-28 16:49:24.316954368 +0000
++++ src/test/shell/bazel/unicode_filenames_test.sh
+@@ -142,7 +142,7 @@ function test_traditional_encoding_sourc
+   # the traditional BSDs typically don't, so their paths can contain arbitrary
+   # non-NUL bytes.
+   case "$(uname -s | tr [:upper:] [:lower:])" in
+-  linux|freebsd)
++  linux|freebsd|netbsd)
+     ;;
+   *)
+     echo "Skipping test." && return
Index: pkgsrc/devel/bazel/patches/patch-src_test_shell_shell__utils.sh
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_test_shell_shell__utils.sh:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_test_shell_shell__utils.sh     Mon Jan  1 12:00:59 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_test_shell_shell__utils.sh,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/test/shell/shell_utils.sh.orig 2023-11-28 16:48:06.068223021 +0000
++++ src/test/shell/shell_utils.sh
+@@ -110,7 +110,7 @@ function get_real_path() {
+ function md5_file() {
+   if [ $# -gt 0 ]; then
+     local result=""
+-    if [[ ${PLATFORM} == "darwin" ]] || [[ ${PLATFORM} == "freebsd" ]] || [[ ${PLATFORM} == "openbsd" ]]; then
++    if [[ ${PLATFORM} == "darwin" ]] || [[ ${PLATFORM} == "freebsd" ]] || [[ ${PLATFORM} == "netbsd" ]] || [[ ${PLATFORM} == "openbsd" ]]; then
+       result=$(md5 -q $@ || echo)
+     else
+       result=$(md5sum $@ | awk '{print $1}' || echo)
Index: pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_BUILD  Mon Jan  1 12:00:59 2024
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_tools_singlejar_BUILD,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/tools/singlejar/BUILD.orig     2023-11-28 16:49:45.631463476 +0000
++++ src/tools/singlejar/BUILD
+@@ -76,6 +76,7 @@ cc_binary(
+     ],
+     linkopts = select({
+         "//src/conditions:freebsd": ["-lm"],
++        "//src/conditions:netbsd": ["-lm"],
+         "//src/conditions:openbsd": ["-lm"],
+         "//conditions:default": [],
+     }),
+@@ -95,6 +96,7 @@ cc_binary(
+     ],
+     linkopts = select({
+         "//src/conditions:freebsd": ["-lm"],
++        "//src/conditions:netbsd": ["-lm"],
+         "//src/conditions:openbsd": ["-lm"],
+         "//conditions:default": [],
+     }),
Index: pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_diag.h
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_diag.h:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_diag.h Mon Jan  1 12:00:59 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_tools_singlejar_diag.h,v 1.1 2024/01/01 12:00:59 ryoon Exp $
+
+--- src/tools/singlejar/diag.h.orig    2023-11-29 01:42:21.128823620 +0000
++++ src/tools/singlejar/diag.h
+@@ -20,7 +20,7 @@
+  * for portability.
+  */
+ #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || \
+-    defined(__OpenBSD__)
++    defined(__OpenBSD__) || defined(__NetBSD__)
+ 
+ #include <err.h>
+ #define diag_err(...) err(__VA_ARGS__)
Index: pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_mapped__file__posix.inc
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_mapped__file__posix.inc:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_mapped__file__posix.inc        Mon Jan  1 12:01:00 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_tools_singlejar_mapped__file__posix.inc,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- src/tools/singlejar/mapped_file_posix.inc.orig     2023-11-29 01:55:21.101251891 +0000
++++ src/tools/singlejar/mapped_file_posix.inc
+@@ -26,7 +26,7 @@
+ 
+ // The implementation is specific to 64-bit Linux / OS X / BSD.
+ #if !((defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+-       defined(__OpenBSD__)) &&                                            \
++       defined(__OpenBSD__) || defined(__NetBSD__)) &&                                            \
+       __SIZEOF_POINTER__ == 8)
+ #error This code for 64 bit Unix.
+ #endif
Index: pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_port.h
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_port.h:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_port.h Mon Jan  1 12:01:00 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_tools_singlejar_port.h,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- src/tools/singlejar/port.h.orig    2023-11-29 01:53:34.029841579 +0000
++++ src/tools/singlejar/port.h
+@@ -32,7 +32,7 @@
+ typedef off_t off64_t;
+ #elif defined(_WIN32)
+ typedef __int64 off64_t;
+-#elif defined(__OpenBSD__)
++#elif defined(__OpenBSD__) || defined(__NetBSD__)
+ typedef int64_t off64_t;
+ #endif
+ static_assert(sizeof(off64_t) == 8, "File offset type must be 64-bit");
Index: pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_zip__headers.h
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_zip__headers.h:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-src_tools_singlejar_zip__headers.h Mon Jan  1 12:01:00 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-src_tools_singlejar_zip__headers.h,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- src/tools/singlejar/zip_headers.h.orig     2023-11-29 01:51:37.732181412 +0000
++++ src/tools/singlejar/zip_headers.h
+@@ -27,7 +27,7 @@
+ 
+ #if defined(__linux__)
+ #include <endian.h>
+-#elif defined(__FreeBSD__) || defined(__OpenBSD__)
++#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ #include <sys/endian.h>
+ #elif defined(__APPLE__) || defined(_WIN32)
+ // Hopefully OSX and Windows will keep running solely on little endian CPUs, so:
Index: pkgsrc/devel/bazel/patches/patch-third__party_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-third__party_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-third__party_BUILD Mon Jan  1 12:01:00 2024
@@ -0,0 +1,24 @@
+$NetBSD: patch-third__party_BUILD,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- third_party/BUILD.orig     2023-11-28 16:50:15.975516749 +0000
++++ third_party/BUILD
+@@ -625,6 +625,7 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({
+     "//src/conditions:linux_ppc": "*.so *.jnilib *.dll",
+     "//src/conditions:linux_s390x": "*.so *.jnilib *.dll",
+     "//src/conditions:freebsd": "*.so *.jnilib *.dll",
++    "//src/conditions:netbsd": "*.so *.jnilib *.dll",
+     "//src/conditions:openbsd": "*.so *.jnilib *.dll",
+     # Default is to play it safe -- better have a big binary than a slow binary
+     #   The empty string means nothing is to be removed from the library;
+@@ -899,6 +900,11 @@ config_setting(
+ )
+ 
+ config_setting(
++    name = "netbsd",
++    values = {"host_cpu": "netbsd"},
++)
++
++config_setting(
+     name = "openbsd",
+     values = {"host_cpu": "openbsd"},
+ )
Index: pkgsrc/devel/bazel/patches/patch-third__party_abseil-cpp_netbsd-sunos.patch
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-third__party_abseil-cpp_netbsd-sunos.patch:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-third__party_abseil-cpp_netbsd-sunos.patch Mon Jan  1 12:01:00 2024
@@ -0,0 +1,90 @@
+$NetBSD: patch-third__party_abseil-cpp_netbsd-sunos.patch,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- third_party/abseil-cpp/netbsd-sunos.patch.orig     2023-11-29 10:06:39.399538673 +0000
++++ third_party/abseil-cpp/netbsd-sunos.patch
+@@ -0,0 +1,85 @@
++--- absl/debugging/internal/vdso_support.cc   2021-11-04 00:26:14.000000000 +0900
+++++ absl/debugging/internal/vdso_support.cc   2023-11-29 18:58:33.941707708 +0900
++@@ -50,8 +50,14 @@
++ #define AT_SYSINFO_EHDR 33  // for crosstoolv10
++ #endif
++ 
+++#if defined(__NetBSD__)
+++using Elf32_auxv_t = Aux32Info;
+++using Elf64_auxv_t = Aux64Info;
+++#endif
++ #if defined(__FreeBSD__)
+++#if defined(__ELF_WORD_SIZE) && __ELF_WORD_SIZE == 64
++ using Elf64_auxv_t = Elf64_Auxinfo;
+++#endif
++ using Elf32_auxv_t = Elf32_Auxinfo;
++ #endif
++ 
++@@ -93,6 +101,9 @@
++     }
++   }
++ #endif  // ABSL_HAVE_GETAUXVAL
+++#if defined(__sun)
+++      return nullptr;
+++#else // !__sun
++   if (vdso_base_.load(std::memory_order_relaxed) == kInvalidBase) {
++     int fd = open("/proc/self/auxv", O_RDONLY);
++     if (fd == -1) {
++@@ -104,8 +115,13 @@
++     ElfW(auxv_t) aux;
++     while (read(fd, &aux, sizeof(aux)) == sizeof(aux)) {
++       if (aux.a_type == AT_SYSINFO_EHDR) {
+++#if defined(__NetBSD__)
+++        vdso_base_.store(reinterpret_cast<void *>(aux.a_v),
+++                         std::memory_order_relaxed);
+++#else
++         vdso_base_.store(reinterpret_cast<void *>(aux.a_un.a_val),
++                          std::memory_order_relaxed);
+++#endif
++         break;
++       }
++     }
++@@ -127,6 +143,7 @@
++   // from assigning to getcpu_fn_ more than once.
++   getcpu_fn_.store(fn, std::memory_order_relaxed);
++   return vdso_base_.load(std::memory_order_relaxed);
+++#endif // __sun
++ }
++ 
++ const void *VDSOSupport::SetBase(const void *base) {
++
++--- absl/debugging/internal/elf_mem_image.cc  2021-11-04 00:26:14.000000000 +0900
+++++ absl/debugging/internal/elf_mem_image.cc  2023-09-18 23:40:01.000000000 +0900
++@@ -351,7 +350,11 @@
++   const ElfW(Versym) *version_symbol = image->GetVersym(index_);
++   ABSL_RAW_CHECK(symbol && version_symbol, "");
++   const char *const symbol_name = image->GetDynstr(symbol->st_name);
+++#if defined(__NetBSD__)
+++  const int version_index = version_symbol->vs_vers & VERSYM_VERSION;
+++#else
++   const ElfW(Versym) version_index = version_symbol[0] & VERSYM_VERSION;
+++#endif
++   const ElfW(Verdef) *version_definition = nullptr;
++   const char *version_name = "";
++   if (symbol->st_shndx == SHN_UNDEF) {
++
++--- absl/base/config.h.orig   2023-11-29 11:18:01.165394118 +0000
+++++ absl/base/config.h
++@@ -414,7 +414,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMES
++     defined(_AIX) || defined(__ros__) || defined(__native_client__) ||    \
++     defined(__asmjs__) || defined(__wasm__) || defined(__Fuchsia__) ||    \
++     defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) ||       \
++-    defined(__HAIKU__)
+++    defined(__HAIKU__) || defined(__NetBSD__)
++ #define ABSL_HAVE_MMAP 1
++ #endif
++ 
++@@ -425,7 +425,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMES
++ #ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM
++ #error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set
++ #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
++-    defined(_AIX) || defined(__ros__)
+++    defined(_AIX) || defined(__ros__) || defined(__NetBSD__)
++ #define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1
++ #endif
++ 
Index: pkgsrc/devel/bazel/patches/patch-third__party_grpc_netbsd-config.patch
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-third__party_grpc_netbsd-config.patch:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-third__party_grpc_netbsd-config.patch      Mon Jan  1 12:01:00 2024
@@ -0,0 +1,546 @@
+$NetBSD: patch-third__party_grpc_netbsd-config.patch,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- third_party/grpc/netbsd-config.patch.orig  2023-11-30 14:45:15.969407560 +0000
++++ third_party/grpc/netbsd-config.patch
+@@ -0,0 +1,541 @@
++diff -urN grpc-1.47.0.orig/third_party/cares/BUILD grpc-1.47.0/third_party/cares/BUILD
++--- grpc-1.47.0.orig/third_party/cares/BUILD  2022-06-22 05:39:47.000000000 +0900
+++++ grpc-1.47.0/third_party/cares/BUILD       2023-11-30 22:06:53.041336686 +0900
++@@ -7,4 +7,5 @@
++     "config_linux/ares_config.h",
++     "config_openbsd/ares_config.h",
++     "config_windows/ares_config.h",
+++    "config_netbsd/ares_config.h",
++ ])
++diff -urN grpc-1.47.0.orig/third_party/cares/cares.BUILD grpc-1.47.0/third_party/cares/cares.BUILD
++--- grpc-1.47.0.orig/third_party/cares/cares.BUILD    2022-06-22 05:39:47.000000000 +0900
+++++ grpc-1.47.0/third_party/cares/cares.BUILD 2023-11-30 23:45:01.919685194 +0900
++@@ -88,6 +88,11 @@
++     values = {"cpu": "watchos_arm64_32"}
++ )
++ 
+++config_setting(
+++    name = "netbsd",
+++    values = {"cpu": "netbsd"},
+++)
+++
++ copy_file(
++     name = "ares_build_h",
++     src = "@com_github_grpc_grpc//third_party/cares:ares_build.h",
++@@ -113,6 +118,7 @@
++         ":darwin_arm64e": "@com_github_grpc_grpc//third_party/cares:config_darwin/ares_config.h",
++         ":windows": "@com_github_grpc_grpc//third_party/cares:config_windows/ares_config.h",
++         ":android": "@com_github_grpc_grpc//third_party/cares:config_android/ares_config.h",
+++        ":netbsd": "@com_github_grpc_grpc//third_party/cares:config_netbsd/ares_config.h",
++         "//conditions:default": "@com_github_grpc_grpc//third_party/cares:config_linux/ares_config.h",
++     }),
++     out = "ares_config.h",
++diff -urN grpc-1.47.0.orig/third_party/cares/config_netbsd/ares_config.h grpc-1.47.0/third_party/cares/config_netbsd/ares_config.h
++--- grpc-1.47.0.orig/third_party/cares/config_netbsd/ares_config.h    1970-01-01 09:00:00.000000000 +0900
+++++ grpc-1.47.0/third_party/cares/config_netbsd/ares_config.h 2023-11-30 23:08:42.228971343 +0900
++@@ -0,0 +1,505 @@
+++/* ares_config.h.  Generated from ares_config.h.in by configure.  */
+++/* ares_config.h.in.  Generated from configure.ac by autoheader.  */
+++
+++/* Define if building universal (internal helper macro) */
+++/* #undef AC_APPLE_UNIVERSAL_BUILD */
+++
+++/* define this if ares is built for a big endian system */
+++/* #undef ARES_BIG_ENDIAN */
+++
+++/* when building as static part of libcurl */
+++/* #undef BUILDING_LIBCURL */
+++
+++/* Defined for build that exposes internal static functions for testing. */
+++/* #undef CARES_EXPOSE_STATICS */
+++
+++/* Defined for build with symbol hiding. */
+++#define CARES_SYMBOL_HIDING 1
+++
+++/* Definition to make a library symbol externally visible. */
+++#define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((__visibility__ ("default")))
+++
+++/* the signed version of size_t */
+++#define CARES_TYPEOF_ARES_SSIZE_T ssize_t
+++
+++/* Use resolver library to configure cares */
+++/* #undef CARES_USE_LIBRESOLV */
+++
+++/* if a /etc/inet dir is being used */
+++/* #undef ETC_INET */
+++
+++/* Define to the type of arg 2 for gethostname. */
+++#define GETHOSTNAME_TYPE_ARG2 size_t
+++
+++/* Define to the type qualifier of arg 1 for getnameinfo. */
+++#define GETNAMEINFO_QUAL_ARG1 const
+++
+++/* Define to the type of arg 1 for getnameinfo. */
+++#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *
+++
+++/* Define to the type of arg 2 for getnameinfo. */
+++#define GETNAMEINFO_TYPE_ARG2 socklen_t
+++
+++/* Define to the type of args 4 and 6 for getnameinfo. */
+++#define GETNAMEINFO_TYPE_ARG46 size_t
+++
+++/* Define to the type of arg 7 for getnameinfo. */
+++#define GETNAMEINFO_TYPE_ARG7 int
+++
+++/* Specifies the number of arguments to getservbyport_r */
+++#define GETSERVBYPORT_R_ARGS 4
+++
+++/* Specifies the size of the buffer to pass to getservbyport_r */
+++#define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data)
+++
+++/* Define to 1 if you have AF_INET6. */
+++#define HAVE_AF_INET6 1
+++
+++/* Define to 1 if you have the <arpa/inet.h> header file. */
+++#define HAVE_ARPA_INET_H 1
+++
+++/* Define to 1 if you have the <arpa/nameser_compat.h> header file. */
+++/* #undef HAVE_ARPA_NAMESER_COMPAT_H */
+++
+++/* Define to 1 if you have the <arpa/nameser.h> header file. */
+++#define HAVE_ARPA_NAMESER_H 1
+++
+++/* Define to 1 if you have the <assert.h> header file. */
+++#define HAVE_ASSERT_H 1
+++
+++/* Define to 1 if you have the `bitncmp' function. */
+++/* #undef HAVE_BITNCMP */
+++
+++/* Define to 1 if bool is an available type. */
+++#define HAVE_BOOL_T 1
+++
+++/* Define to 1 if you have the clock_gettime function and monotonic timer. */
+++#define HAVE_CLOCK_GETTIME_MONOTONIC 1
+++
+++/* Define to 1 if you have the closesocket function. */
+++/* #undef HAVE_CLOSESOCKET */
+++
+++/* Define to 1 if you have the CloseSocket camel case function. */
+++/* #undef HAVE_CLOSESOCKET_CAMEL */
+++
+++/* Define to 1 if you have the connect function. */
+++#define HAVE_CONNECT 1
+++
+++/* define if the compiler supports basic C++11 syntax */
+++/* #undef HAVE_CXX11 */
+++
+++/* Define to 1 if you have the <dlfcn.h> header file. */
+++#define HAVE_DLFCN_H 1
+++
+++/* Define to 1 if you have the <errno.h> header file. */
+++#define HAVE_ERRNO_H 1
+++
+++/* Define to 1 if you have the fcntl function. */
+++#define HAVE_FCNTL 1
+++
+++/* Define to 1 if you have the <fcntl.h> header file. */
+++#define HAVE_FCNTL_H 1
+++
+++/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
+++#define HAVE_FCNTL_O_NONBLOCK 1
+++
+++/* Define to 1 if you have the freeaddrinfo function. */
+++#define HAVE_FREEADDRINFO 1
+++
+++/* Define to 1 if you have a working getaddrinfo function. */
+++#define HAVE_GETADDRINFO 1
+++
+++/* Define to 1 if the getaddrinfo function is threadsafe. */
+++/* #undef HAVE_GETADDRINFO_THREADSAFE */
+++
+++/* Define to 1 if you have the getenv function. */
+++#define HAVE_GETENV 1
+++
+++/* Define to 1 if you have the gethostbyaddr function. */
+++#define HAVE_GETHOSTBYADDR 1
+++
+++/* Define to 1 if you have the gethostbyname function. */
+++#define HAVE_GETHOSTBYNAME 1
+++
+++/* Define to 1 if you have the gethostname function. */
+++#define HAVE_GETHOSTNAME 1
+++
+++/* Define to 1 if you have the getnameinfo function. */
+++#define HAVE_GETNAMEINFO 1
+++
+++/* Define to 1 if you have the getservbyport_r function. */
+++/* #undef HAVE_GETSERVBYPORT_R */
+++
+++/* Define to 1 if you have the `gettimeofday' function. */
+++#define HAVE_GETTIMEOFDAY 1
+++
+++/* Define to 1 if you have the `if_indextoname' function. */
+++#define HAVE_IF_INDEXTONAME 1
+++
+++/* Define to 1 if you have a IPv6 capable working inet_net_pton function. */
+++/* #undef HAVE_INET_NET_PTON */
+++
+++/* Define to 1 if you have a IPv6 capable working inet_ntop function. */
+++#define HAVE_INET_NTOP 1
+++
+++/* Define to 1 if you have a IPv6 capable working inet_pton function. */
+++#define HAVE_INET_PTON 1
+++
+++/* Define to 1 if you have the <inttypes.h> header file. */
+++#define HAVE_INTTYPES_H 1
+++
+++/* Define to 1 if you have the ioctl function. */
+++#define HAVE_IOCTL 1
+++
+++/* Define to 1 if you have the ioctlsocket function. */
+++/* #undef HAVE_IOCTLSOCKET */
+++
+++/* Define to 1 if you have the IoctlSocket camel case function. */
+++/* #undef HAVE_IOCTLSOCKET_CAMEL */
+++
+++/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function.
+++   */
+++/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */
+++
+++/* Define to 1 if you have a working ioctlsocket FIONBIO function. */
+++/* #undef HAVE_IOCTLSOCKET_FIONBIO */
+++
+++/* Define to 1 if you have a working ioctl FIONBIO function. */
+++#define HAVE_IOCTL_FIONBIO 1
+++
+++/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
+++#define HAVE_IOCTL_SIOCGIFADDR 1
+++
+++/* Define to 1 if you have the `resolve' library (-lresolve). */
+++/* #undef HAVE_LIBRESOLVE */
+++
+++/* Define to 1 if you have the <limits.h> header file. */
+++#define HAVE_LIMITS_H 1
+++
+++/* if your compiler supports LL */
+++#define HAVE_LL 1
+++
+++/* Define to 1 if the compiler supports the 'long long' data type. */
+++#define HAVE_LONGLONG 1
+++
+++/* Define to 1 if you have the malloc.h header file. */
+++/* #undef HAVE_MALLOC_H */
+++
+++/* Define to 1 if you have the memory.h header file. */
+++#define HAVE_MEMORY_H 1
+++
+++/* Define to 1 if you have the MSG_NOSIGNAL flag. */
+++#define HAVE_MSG_NOSIGNAL 1
+++
+++/* Define to 1 if you have the <netdb.h> header file. */
+++#define HAVE_NETDB_H 1
+++
+++/* Define to 1 if you have the <netinet/in.h> header file. */
+++#define HAVE_NETINET_IN_H 1
+++
+++/* Define to 1 if you have the <netinet/tcp.h> header file. */
+++#define HAVE_NETINET_TCP_H 1
+++
+++/* Define to 1 if you have the <net/if.h> header file. */
+++#define HAVE_NET_IF_H 1
+++
+++/* Define to 1 if you have PF_INET6. */
+++#define HAVE_PF_INET6 1
+++
+++/* Define to 1 if you have the recv function. */
+++#define HAVE_RECV 1
+++
+++/* Define to 1 if you have the recvfrom function. */
+++#define HAVE_RECVFROM 1
+++
+++/* Define to 1 if you have the send function. */
+++#define HAVE_SEND 1
+++
+++/* Define to 1 if you have the setsockopt function. */
+++#define HAVE_SETSOCKOPT 1
+++
+++/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */
+++/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */
+++
+++/* Define to 1 if you have the <signal.h> header file. */
+++#define HAVE_SIGNAL_H 1
+++
+++/* Define to 1 if sig_atomic_t is an available typedef. */
+++#define HAVE_SIG_ATOMIC_T 1
+++
+++/* Define to 1 if sig_atomic_t is already defined as volatile. */
+++/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */
+++
+++/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */
+++#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+++
+++/* Define to 1 if you have the socket function. */
+++#define HAVE_SOCKET 1
+++
+++/* Define to 1 if you have the <socket.h> header file. */
+++/* #undef HAVE_SOCKET_H */
+++
+++/* Define to 1 if you have the <stdbool.h> header file. */
+++#define HAVE_STDBOOL_H 1
+++
+++/* Define to 1 if you have the <stdint.h> header file. */
+++#define HAVE_STDINT_H 1
+++
+++/* Define to 1 if you have the <stdlib.h> header file. */
+++#define HAVE_STDLIB_H 1
+++
+++/* Define to 1 if you have the strcasecmp function. */
+++#define HAVE_STRCASECMP 1
+++
+++/* Define to 1 if you have the strcmpi function. */
+++/* #undef HAVE_STRCMPI */
+++
+++/* Define to 1 if you have the strdup function. */
+++#define HAVE_STRDUP 1
+++
+++/* Define to 1 if you have the stricmp function. */
+++/* #undef HAVE_STRICMP */
+++
+++/* Define to 1 if you have the <strings.h> header file. */
+++#define HAVE_STRINGS_H 1
+++
+++/* Define to 1 if you have the <string.h> header file. */
+++#define HAVE_STRING_H 1
+++
+++/* Define to 1 if you have the strncasecmp function. */
+++#define HAVE_STRNCASECMP 1
+++
+++/* Define to 1 if you have the strncmpi function. */
+++/* #undef HAVE_STRNCMPI */
+++
+++/* Define to 1 if you have the strnicmp function. */
+++/* #undef HAVE_STRNICMP */
+++
+++/* Define to 1 if you have the <stropts.h> header file. */
+++/* #undef HAVE_STROPTS_H */
+++
+++/* Define to 1 if you have struct addrinfo. */
+++#define HAVE_STRUCT_ADDRINFO 1
+++
+++/* Define to 1 if you have struct in6_addr. */
+++#define HAVE_STRUCT_IN6_ADDR 1
+++
+++/* Define to 1 if you have struct sockaddr_in6. */
+++#define HAVE_STRUCT_SOCKADDR_IN6 1
+++
+++/* if struct sockaddr_storage is defined */
+++#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+++
+++/* Define to 1 if you have the timeval struct. */
+++#define HAVE_STRUCT_TIMEVAL 1
+++
+++/* Define to 1 if you have the <sys/ioctl.h> header file. */
+++#define HAVE_SYS_IOCTL_H 1
+++
+++/* Define to 1 if you have the <sys/param.h> header file. */
+++#define HAVE_SYS_PARAM_H 1
+++
+++/* Define to 1 if you have the <sys/select.h> header file. */
+++#define HAVE_SYS_SELECT_H 1
+++
+++/* Define to 1 if you have the <sys/socket.h> header file. */
+++#define HAVE_SYS_SOCKET_H 1
+++
+++/* Define to 1 if you have the <sys/stat.h> header file. */
+++#define HAVE_SYS_STAT_H 1
+++
+++/* Define to 1 if you have the <sys/time.h> header file. */
+++#define HAVE_SYS_TIME_H 1
+++
+++/* Define to 1 if you have the <sys/types.h> header file. */
+++#define HAVE_SYS_TYPES_H 1
+++
+++/* Define to 1 if you have the <sys/uio.h> header file. */
+++#define HAVE_SYS_UIO_H 1
+++
+++/* Define to 1 if you have the <time.h> header file. */
+++#define HAVE_TIME_H 1
+++
+++/* Define to 1 if you have the <unistd.h> header file. */
+++#define HAVE_UNISTD_H 1
+++
+++/* Define to 1 if you have the windows.h header file. */
+++/* #undef HAVE_WINDOWS_H */
+++
+++/* Define to 1 if you have the winsock2.h header file. */
+++/* #undef HAVE_WINSOCK2_H */
+++
+++/* Define to 1 if you have the winsock.h header file. */
+++/* #undef HAVE_WINSOCK_H */
+++
+++/* Define to 1 if you have the writev function. */
+++#define HAVE_WRITEV 1
+++
+++/* Define to 1 if you have the ws2tcpip.h header file. */
+++/* #undef HAVE_WS2TCPIP_H */
+++
+++/* Define if __system_property_get exists. */
+++/* #undef HAVE___SYSTEM_PROPERTY_GET */
+++
+++/* Define to the sub-directory where libtool stores uninstalled libraries. */
+++#define LT_OBJDIR ".libs/"
+++
+++/* Define to 1 if you need the malloc.h header file even with stdlib.h */
+++/* #undef NEED_MALLOC_H */
+++
+++/* Define to 1 if you need the memory.h header file even with stdlib.h */
+++/* #undef NEED_MEMORY_H */
+++
+++/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */
+++/* #undef NEED_REENTRANT */
+++
+++/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */
+++/* #undef NEED_THREAD_SAFE */
+++
+++/* cpu-machine-OS */
+++#define OS "x86_64--netbsd"
+++
+++/* Name of package */
+++#define PACKAGE "c-ares"
+++
+++/* Define to the address where bug reports for this package should be sent. */
+++#define PACKAGE_BUGREPORT "c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares";
+++
+++/* Define to the full name of this package. */
+++#define PACKAGE_NAME "c-ares"
+++
+++/* Define to the full name and version of this package. */
+++#define PACKAGE_STRING "c-ares 1.13.0"
+++
+++/* Define to the one symbol short name of this package. */
+++#define PACKAGE_TARNAME "c-ares"
+++
+++/* Define to the home page for this package. */
+++#define PACKAGE_URL ""
+++
+++/* Define to the version of this package. */
+++#define PACKAGE_VERSION "1.13.0"
+++
+++/* a suitable file/device to read random data from */
+++#define RANDOM_FILE "/dev/urandom"
+++
+++/* Define to the type qualifier pointed by arg 5 for recvfrom. */
+++#define RECVFROM_QUAL_ARG5 
+++
+++/* Define to the type of arg 1 for recvfrom. */
+++#define RECVFROM_TYPE_ARG1 int
+++
+++/* Define to the type pointed by arg 2 for recvfrom. */
+++#define RECVFROM_TYPE_ARG2 void
+++
+++/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */
+++#define RECVFROM_TYPE_ARG2_IS_VOID 1
+++
+++/* Define to the type of arg 3 for recvfrom. */
+++#define RECVFROM_TYPE_ARG3 size_t
+++
+++/* Define to the type of arg 4 for recvfrom. */
+++#define RECVFROM_TYPE_ARG4 int
+++
+++/* Define to the type pointed by arg 5 for recvfrom. */
+++#define RECVFROM_TYPE_ARG5 struct sockaddr
+++
+++/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */
+++/* #undef RECVFROM_TYPE_ARG5_IS_VOID */
+++
+++/* Define to the type pointed by arg 6 for recvfrom. */
+++#define RECVFROM_TYPE_ARG6 socklen_t
+++
+++/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */
+++/* #undef RECVFROM_TYPE_ARG6_IS_VOID */
+++
+++/* Define to the function return type for recvfrom. */
+++#define RECVFROM_TYPE_RETV ssize_t
+++
+++/* Define to the type of arg 1 for recv. */
+++#define RECV_TYPE_ARG1 int
+++
+++/* Define to the type of arg 2 for recv. */
+++#define RECV_TYPE_ARG2 void *
+++
+++/* Define to the type of arg 3 for recv. */
+++#define RECV_TYPE_ARG3 size_t
+++
+++/* Define to the type of arg 4 for recv. */
+++#define RECV_TYPE_ARG4 int
+++
+++/* Define to the function return type for recv. */
+++#define RECV_TYPE_RETV ssize_t
+++
+++/* Define as the return type of signal handlers (`int' or `void'). */
+++#define RETSIGTYPE void
+++
+++/* Define to the type qualifier of arg 2 for send. */
+++#define SEND_QUAL_ARG2 const
+++
+++/* Define to the type of arg 1 for send. */
+++#define SEND_TYPE_ARG1 int
+++
+++/* Define to the type of arg 2 for send. */
+++#define SEND_TYPE_ARG2 void *
+++
+++/* Define to the type of arg 3 for send. */
+++#define SEND_TYPE_ARG3 size_t
+++
+++/* Define to the type of arg 4 for send. */
+++#define SEND_TYPE_ARG4 int
+++
+++/* Define to the function return type for send. */
+++#define SEND_TYPE_RETV ssize_t
+++
+++/* Define to 1 if you have the ANSI C header files. */
+++#define STDC_HEADERS 1
+++
+++/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+++#define TIME_WITH_SYS_TIME 1
+++
+++/* Define to disable non-blocking sockets. */
+++/* #undef USE_BLOCKING_SOCKETS */
+++
+++/* Version number of package */
+++#define VERSION "1.13.0"
+++
+++/* Define to avoid automatic inclusion of winsock.h */
+++/* #undef WIN32_LEAN_AND_MEAN */
+++
+++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+++   significant byte first (like Motorola and SPARC, unlike Intel). */
+++#if defined AC_APPLE_UNIVERSAL_BUILD
+++# if defined __BIG_ENDIAN__
+++#  define WORDS_BIGENDIAN 1
+++# endif
+++#else
+++# ifndef WORDS_BIGENDIAN
+++/* #  undef WORDS_BIGENDIAN */
+++# endif
+++#endif
+++
+++/* Define to 1 if OS is AIX. */
+++#ifndef _ALL_SOURCE
+++/* #  undef _ALL_SOURCE */
+++#endif
+++
+++/* Enable large inode numbers on Mac OS X 10.5.  */
+++#ifndef _DARWIN_USE_64_BIT_INODE
+++# define _DARWIN_USE_64_BIT_INODE 1
+++#endif
+++
+++/* Number of bits in a file offset, on hosts where this is settable. */
+++/* #undef _FILE_OFFSET_BITS */
+++
+++/* Define for large files, on AIX-style hosts. */
+++/* #undef _LARGE_FILES */
+++
+++/* Define to empty if `const' does not conform to ANSI C. */
+++/* #undef const */
+++
+++/* Type to use in place of in_addr_t when system does not provide it. */
+++/* #undef in_addr_t */
+++
+++/* Define to `unsigned int' if <sys/types.h> does not define. */
+++/* #undef size_t */
Index: pkgsrc/devel/bazel/patches/patch-third__party_upb_upb-bazel-clang.patch
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-third__party_upb_upb-bazel-clang.patch:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-third__party_upb_upb-bazel-clang.patch     Mon Jan  1 12:01:00 2024
@@ -0,0 +1,24 @@
+$NetBSD: patch-third__party_upb_upb-bazel-clang.patch,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- third_party/upb/upb-bazel-clang.patch.orig 2023-12-14 08:14:28.011171125 +0000
++++ third_party/upb/upb-bazel-clang.patch
+@@ -0,0 +1,19 @@
++--- bazel/build_defs.bzl.orig 2023-12-14 07:54:10.464989126 +0000
+++++ bazel/build_defs.bzl
++@@ -36,6 +36,8 @@ _DEFAULT_CPPOPTS.extend([
++     # "-Wshorten-64-to-32",  # not in GCC (and my Kokoro images doesn't have Clang)
++     "-Werror",
++     "-Wno-long-long",
+++    "-Wno-deprecated-copy",
+++    "-Wno-deprecated-builtins",
++ ])
++ _DEFAULT_COPTS.extend([
++     "-std=c99",
++@@ -43,6 +45,7 @@ _DEFAULT_COPTS.extend([
++     "-Werror=pedantic",
++     "-Wall",
++     "-Wstrict-prototypes",
+++    "-Wno-gnu-offsetof-extensions",
++     # GCC (at least) emits spurious warnings for this that cannot be fixed
++     # without introducing redundant initialization (with runtime cost):
++     #   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
Index: pkgsrc/devel/bazel/patches/patch-third__party_zstd-jni_zstd-jni.BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-third__party_zstd-jni_zstd-jni.BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-third__party_zstd-jni_zstd-jni.BUILD       Mon Jan  1 12:01:00 2024
@@ -0,0 +1,12 @@
+$NetBSD: patch-third__party_zstd-jni_zstd-jni.BUILD,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- third_party/zstd-jni/zstd-jni.BUILD.orig   2023-11-28 16:52:47.128150508 +0000
++++ third_party/zstd-jni/zstd-jni.BUILD
+@@ -3,6 +3,7 @@ genrule(
+     srcs = select({
+         "@bazel_tools//src/conditions:darwin": ["@bazel_tools//tools/jdk:jni_md_header-darwin"],
+         "@bazel_tools//src/conditions:freebsd": ["@bazel_tools//tools/jdk:jni_md_header-freebsd"],
++        "@bazel_tools//src/conditions:netbsd": ["@bazel_tools//tools/jdk:jni_md_header-netbsd"],
+         "@bazel_tools//src/conditions:openbsd": ["@bazel_tools//tools/jdk:jni_md_header-openbsd"],
+         "@bazel_tools//src/conditions:windows": ["@bazel_tools//tools/jdk:jni_md_header-windows"],
+         "//conditions:default": ["@bazel_tools//tools/jdk:jni_md_header-linux"],
Index: pkgsrc/devel/bazel/patches/patch-tools_cpp_BUILD.static.bsd
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_cpp_BUILD.static.bsd:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_cpp_BUILD.static.bsd Mon Jan  1 12:01:00 2024
@@ -0,0 +1,57 @@
+$NetBSD: patch-tools_cpp_BUILD.static.bsd,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/cpp/BUILD.static.bsd.orig    2023-11-28 16:29:55.502670885 +0000
++++ tools/cpp/BUILD.static.bsd
+@@ -34,9 +34,11 @@ cc_toolchain_suite(
+     toolchains = {
+         "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
+         "freebsd|compiler": ":cc-compiler-freebsd",
++        "netbsd|compiler": ":cc-compiler-netbsd",
+         "openbsd|compiler": ":cc-compiler-openbsd",
+         "armeabi-v7a": ":cc-compiler-armeabi-v7a",
+         "freebsd": ":cc-compiler-freebsd",
++        "netbsd": ":cc-compiler-netbsd",
+         "openbsd": ":cc-compiler-openbsd",
+     },
+ )
+@@ -76,6 +78,40 @@ toolchain(
+ )
+ 
+ cc_toolchain(
++    name = "cc-compiler-netbsd",
++    all_files = ":empty",
++    ar_files = ":empty",
++    as_files = ":empty",
++    compiler_files = ":empty",
++    dwp_files = ":empty",
++    linker_files = ":empty",
++    objcopy_files = ":empty",
++    strip_files = ":empty",
++    supports_param_files = 0,
++    toolchain_config = ":local_netbsd",
++    toolchain_identifier = "local_netbsd",
++)
++
++cc_toolchain_config(
++    name = "local_netbsd",
++    cpu = "netbsd",
++)
++
++toolchain(
++    name = "cc-toolchain-netbsd",
++    exec_compatible_with = [
++        "@platforms//cpu:x86_64",
++        "@platforms//os:netbsd",
++    ],
++    target_compatible_with = [
++        "@platforms//cpu:x86_64",
++        "@platforms//os:netbsd",
++    ],
++    toolchain = ":cc-compiler-netbsd",
++    toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
++)
++
++cc_toolchain(
+     name = "cc-compiler-openbsd",
+     all_files = ":empty",
+     ar_files = ":empty",
Index: pkgsrc/devel/bazel/patches/patch-tools_cpp_bsd__cc__toolchain__config.bzl
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_cpp_bsd__cc__toolchain__config.bzl:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_cpp_bsd__cc__toolchain__config.bzl   Mon Jan  1 12:01:00 2024
@@ -0,0 +1,59 @@
+$NetBSD: patch-tools_cpp_bsd__cc__toolchain__config.bzl,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+* GCC 10.5.0 with -isystem, absolute path and symlink generates unexpected
+  .d file when -MD is specified. Bazel would not accept such .d files.
+
+--- tools/cpp/bsd_cc_toolchain_config.bzl.orig 2023-12-05 16:43:07.613565028 +0000
++++ tools/cpp/bsd_cc_toolchain_config.bzl
+@@ -56,7 +56,7 @@ all_link_actions = [
+ 
+ def _impl(ctx):
+     cpu = ctx.attr.cpu
+-    is_bsd = cpu == "freebsd" or cpu == "openbsd"
++    is_bsd = cpu == "freebsd" or cpu == "netbsd" or cpu == "openbsd"
+     compiler = "compiler"
+     toolchain_identifier = "local_{}".format(cpu) if is_bsd else "stub_armeabi-v7a"
+     host_system_name = "local" if is_bsd else "armeabi-v7a"
+@@ -241,17 +241,19 @@ def _impl(ctx):
+     else:
+         features = [supports_dynamic_linker_feature, supports_pic_feature]
+ 
+-    if (is_bsd):
++    if is_bsd and not (cpu == "netbsd"):
+         cxx_builtin_include_directories = ["/usr/lib/clang", "/usr/local/include", "/usr/include"]
++    elif (cpu == "netbsd"):
++        cxx_builtin_include_directories = ["@PREFIX@/lib/clang", "@PREFIX@/include", "/usr/include"]
+     else:
+         cxx_builtin_include_directories = []
+ 
+-    if is_bsd:
++    if is_bsd and not (cpu == "netbsd"):
+         tool_paths = [
+             tool_path(name = "ar", path = "/usr/bin/ar"),
+             tool_path(name = "cpp", path = "/usr/bin/cpp"),
+             tool_path(name = "dwp", path = "/usr/bin/dwp"),
+-            tool_path(name = "gcc", path = "/usr/bin/clang"),
++            tool_path(name = "gcc", path = "/usr/bin/clang"),
+             tool_path(name = "gcov", path = "/usr/bin/gcov"),
+             tool_path(name = "ld", path = "/usr/bin/ld"),
+             tool_path(name = "nm", path = "/usr/bin/nm"),
+@@ -259,6 +261,19 @@ def _impl(ctx):
+             tool_path(name = "objdump", path = "/usr/bin/objdump"),
+             tool_path(name = "strip", path = "/usr/bin/strip"),
+         ]
++    elif (cpu == "netbsd"):
++        tool_paths = [
++            tool_path(name = "ar", path = "/usr/bin/ar"),
++            tool_path(name = "cpp", path = "/usr/bin/cpp"),
++            tool_path(name = "dwp", path = "/usr/bin/dwp"),
++            tool_path(name = "gcc", path = "@PREFIX@/bin/clang"),
++            tool_path(name = "gcov", path = "/usr/bin/gcov"),
++            tool_path(name = "ld", path = "/usr/bin/ld"),
++            tool_path(name = "nm", path = "/usr/bin/nm"),
++            tool_path(name = "objcopy", path = "/usr/bin/objcopy"),
++            tool_path(name = "objdump", path = "/usr/bin/objdump"),
++            tool_path(name = "strip", path = "/usr/bin/strip"),
++        ]
+     else:
+         tool_paths = [
+             tool_path(name = "ar", path = "/bin/false"),
Index: pkgsrc/devel/bazel/patches/patch-tools_cpp_cc__configure.bzl
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_cpp_cc__configure.bzl:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_cpp_cc__configure.bzl        Mon Jan  1 12:01:00 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-tools_cpp_cc__configure.bzl,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/cpp/cc_configure.bzl.orig    2023-11-28 16:35:29.548083456 +0000
++++ tools/cpp/cc_configure.bzl
+@@ -102,7 +102,7 @@ def cc_autoconf_impl(repository_ctx, ove
+         repository_ctx.template("BUILD", paths["@bazel_tools//tools/cpp:BUILD.empty.tpl"], {
+             "%{cpu}": get_cpu_value(repository_ctx),
+         })
+-    elif cpu_value == "freebsd" or cpu_value == "openbsd":
++    elif cpu_value == "freebsd" or cpu_value == "netbsd" or cpu_value == "openbsd":
+         paths = resolve_labels(repository_ctx, [
+             "@bazel_tools//tools/cpp:BUILD.static.bsd",
+             "@bazel_tools//tools/cpp:bsd_cc_toolchain_config.bzl",
Index: pkgsrc/devel/bazel/patches/patch-tools_cpp_lib__cc__configure.bzl
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_cpp_lib__cc__configure.bzl:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_cpp_lib__cc__configure.bzl   Mon Jan  1 12:01:00 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-tools_cpp_lib__cc__configure.bzl,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/cpp/lib_cc_configure.bzl.orig        2023-11-28 16:25:10.088639234 +0000
++++ tools/cpp/lib_cc_configure.bzl
+@@ -192,6 +192,8 @@ def get_cpu_value(repository_ctx):
+         return "darwin" + ("_arm64" if arch == "aarch64" else "")
+     if os_name.find("freebsd") != -1:
+         return "freebsd"
++    if os_name.find("netbsd") != -1:
++        return "netbsd"
+     if os_name.find("openbsd") != -1:
+         return "openbsd"
+     if os_name.find("windows") != -1:
Index: pkgsrc/devel/bazel/patches/patch-tools_cpp_unix__cc__configure.bzl
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_cpp_unix__cc__configure.bzl:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_cpp_unix__cc__configure.bzl  Mon Jan  1 12:01:00 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-tools_cpp_unix__cc__configure.bzl,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/cpp/unix_cc_configure.bzl.orig       2023-11-28 16:29:01.387093015 +0000
++++ tools/cpp/unix_cc_configure.bzl
+@@ -344,7 +344,7 @@ def configure_unix_toolchain(repository_
+ 
+     repository_ctx.file("tools/cpp/empty.cc", "int main() {}")
+     darwin = cpu_value.startswith("darwin")
+-    bsd = cpu_value == "freebsd" or cpu_value == "openbsd"
++    bsd = cpu_value == "freebsd" or cpu_value == "netbsd" or cpu_value == "openbsd"
+ 
+     cc = find_cc(repository_ctx, overriden_tools)
+     is_clang = _is_clang(repository_ctx, cc)
Index: pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.java__tools
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.java__tools:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.java__tools        Mon Jan  1 12:01:00 2024
@@ -0,0 +1,33 @@
+$NetBSD: patch-tools_jdk_BUILD.java__tools,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/jdk/BUILD.java_tools.orig    1979-12-31 15:00:00.000000000 +0000
++++ tools/jdk/BUILD.java_tools
+@@ -130,6 +130,12 @@ config_setting(
+ )
+ 
+ config_setting(
++    name = "netbsd",
++    constraint_values = ["@platforms//os:netbsd"],
++    visibility = ["//visibility:public"],
++)
++
++config_setting(
+     name = "openbsd",
+     constraint_values = ["@platforms//os:openbsd"],
+     visibility = ["//visibility:public"],
+@@ -372,6 +378,7 @@ cc_binary(
+     copts = SUPRESSED_WARNINGS,
+     linkopts = select({
+         ":freebsd": ["-lm"],
++        ":netbsd": ["-lm"],
+         ":openbsd": ["-lm"],
+         "//conditions:default": [],
+     }),
+@@ -397,6 +404,7 @@ cc_binary(
+     copts = SUPRESSED_WARNINGS,
+     linkopts = select({
+         ":freebsd": ["-lm"],
++        ":netbsd": ["-lm"],
+         ":openbsd": ["-lm"],
+         "//conditions:default": [],
+     }),
Index: pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.tools
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.tools:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_jdk_BUILD.tools      Mon Jan  1 12:01:00 2024
@@ -0,0 +1,32 @@
+$NetBSD: patch-tools_jdk_BUILD.tools,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/jdk/BUILD.tools.orig 2023-11-28 16:54:25.564264937 +0000
++++ tools/jdk/BUILD.tools
+@@ -106,6 +106,11 @@ java_runtime_files(
+ )
+ 
+ java_runtime_files(
++    name = "jni_md_header-netbsd",
++    srcs = ["include/netbsd/jni_md.h"],
++)
++
++java_runtime_files(
+     name = "jni_md_header-openbsd",
+     srcs = ["include/openbsd/jni_md.h"],
+ )
+@@ -127,6 +132,7 @@ cc_library(
+         "//src/conditions:linux_x86_64": [":jni_md_header-linux"],
+         "//src/conditions:darwin": [":jni_md_header-darwin"],
+         "//src/conditions:freebsd": [":jni_md_header-freebsd"],
++        "//src/conditions:netbsd": [":jni_md_header-netbsd"],
+         "//src/conditions:openbsd": [":jni_md_header-openbsd"],
+         "//src/conditions:windows": [":jni_md_header-windows"],
+         "//conditions:default": [],
+@@ -140,6 +146,7 @@ cc_library(
+         "//src/conditions:linux_x86_64": ["include/linux"],
+         "//src/conditions:darwin": ["include/darwin"],
+         "//src/conditions:freebsd": ["include/freebsd"],
++        "//src/conditions:netbsd": ["include/netbsd"],
+         "//src/conditions:openbsd": ["include/openbsd"],
+         "//src/conditions:windows": ["include/win32"],
+         "//conditions:default": [],
Index: pkgsrc/devel/bazel/patches/patch-tools_jdk_jdk__build__file.bzl
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_jdk_jdk__build__file.bzl:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_jdk_jdk__build__file.bzl     Mon Jan  1 12:01:00 2024
@@ -0,0 +1,17 @@
+$NetBSD: patch-tools_jdk_jdk__build__file.bzl,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/jdk/jdk_build_file.bzl.orig  2023-11-28 16:34:15.542839919 +0000
++++ tools/jdk/jdk_build_file.bzl
+@@ -49,6 +49,12 @@ filegroup(
+ )
+ 
+ filegroup(
++    name = "jni_md_header-netbsd",
++    srcs = ["include/netbsd/jni_md.h"],
++    deprecation = DEPRECATION_MESSAGE,
++)
++
++filegroup(
+     name = "jni_md_header-openbsd",
+     srcs = ["include/openbsd/jni_md.h"],
+     deprecation = DEPRECATION_MESSAGE,
Index: pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD      Mon Jan  1 12:01:00 2024
@@ -0,0 +1,32 @@
+$NetBSD: patch-tools_platforms_BUILD,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/platforms/BUILD.orig 1979-12-31 15:00:00.000000000 +0000
++++ tools/platforms/BUILD
+@@ -84,6 +84,11 @@ alias(
+ )
+ 
+ alias(
++    name = "netbsd",
++    actual = "@platforms//os:netbsd",
++)
++
++alias(
+     name = "openbsd",
+     actual = "@platforms//os:openbsd",
+ )
+@@ -126,6 +131,7 @@ platform(
+     os_constraints = [
+         "@platforms//os:osx",
+         "@platforms//os:freebsd",
++        "@platforms//os:netbsd",
+         "@platforms//os:openbsd",
+         "@platforms//os:linux",
+         "@platforms//os:windows",
+@@ -149,6 +155,7 @@ platform(
+     os_constraints = [
+         "@platforms//os:osx",
+         "@platforms//os:freebsd",
++        "@platforms//os:netbsd",
+         "@platforms//os:openbsd",
+         "@platforms//os:linux",
+         "@platforms//os:windows",
Index: pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD.tools
diff -u /dev/null pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD.tools:1.1
--- /dev/null   Mon Jan  1 12:01:01 2024
+++ pkgsrc/devel/bazel/patches/patch-tools_platforms_BUILD.tools        Mon Jan  1 12:01:00 2024
@@ -0,0 +1,32 @@
+$NetBSD: patch-tools_platforms_BUILD.tools,v 1.1 2024/01/01 12:01:00 ryoon Exp $
+
+--- tools/platforms/BUILD.tools.orig   1979-12-31 15:00:00.000000000 +0000
++++ tools/platforms/BUILD.tools
+@@ -72,6 +72,11 @@ alias(
+ )
+ 
+ alias(
++    name = "netbsd",
++    actual = "@platforms//os:netbsd",
++)
++
++alias(
+     name = "openbsd",
+     actual = "@platforms//os:openbsd",
+ )
+@@ -114,6 +119,7 @@ platform(
+     os_constraints = [
+         "@platforms//os:osx",
+         "@platforms//os:freebsd",
++        "@platforms//os:netbsd",
+         "@platforms//os:openbsd",
+         "@platforms//os:linux",
+         "@platforms//os:windows",
+@@ -137,6 +143,7 @@ platform(
+     os_constraints = [
+         "@platforms//os:osx",
+         "@platforms//os:freebsd",
++        "@platforms//os:netbsd",
+         "@platforms//os:openbsd",
+         "@platforms//os:linux",
+         "@platforms//os:windows",



Home | Main Index | Thread Index | Old Index