build+ci: support macOS on arm64

Refs: #5135
Change-Id: I86f1955366df12cfb8b3e6f9d5e9f202778cc211
diff --git a/.jenkins b/.jenkins
index 4456e3a..ee16e29 100755
--- a/.jenkins
+++ b/.jenkins
@@ -16,6 +16,11 @@
         # Emulate a subset of os-release(5)
         export ID=macos
         export VERSION_ID=$(sw_vers -productVersion)
+        if [[ -x /opt/homebrew/bin/brew ]]; then
+            eval "$(/opt/homebrew/bin/brew shellenv)"
+        elif [[ -x /usr/local/bin/brew ]]; then
+            eval "$(/usr/local/bin/brew shellenv)"
+        fi
         ;;
 esac