diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index 3fc3b6f456..b653558c5b 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -323,6 +323,11 @@ case "$*" in
--version|-v) source "$HOMEBREW_LIBRARY/Homebrew/cmd/--version.sh"; homebrew-version; exit 0 ;;
esac
+if [[ -n "$HOMEBREW_SIMULATE_MACOS_ON_LINUX" ]]
+then
+ export HOMEBREW_FORCE_HOMEBREW_ON_LINUX="1"
+fi
+
if [[ -n "$HOMEBREW_MACOS" ]]
then
HOMEBREW_PRODUCT="Homebrew"
diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb
index 851b2d08df..391d7e38c9 100644
--- a/Library/Homebrew/env_config.rb
+++ b/Library/Homebrew/env_config.rb
@@ -262,7 +262,7 @@ module Homebrew
},
HOMEBREW_SIMULATE_MACOS_ON_LINUX: {
description: "If set, running Homebrew on Linux will simulate certain macOS code paths. This is useful " \
- "when auditing macOS formulae while on Linux.",
+ "when auditing macOS formulae while on Linux. Implies `HOMEBREW_FORCE_HOMEBREW_ON_LINUX`.",
boolean: true,
},
HOMEBREW_SKIP_OR_LATER_BOTTLES: {
diff --git a/docs/Manpage.md b/docs/Manpage.md
index 4f0bea4342..c1e7136368 100644
--- a/docs/Manpage.md
+++ b/docs/Manpage.md
@@ -1897,6 +1897,9 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
- `HOMEBREW_PRY`
If set, use Pry for the `brew irb` command.
+- `HOMEBREW_SIMULATE_MACOS_ON_LINUX`
+
If set, running Homebrew on Linux will simulate certain macOS code paths. This is useful when auditing macOS formulae while on Linux. Implies `HOMEBREW_FORCE_HOMEBREW_ON_LINUX`.
+
- `HOMEBREW_SKIP_OR_LATER_BOTTLES`
If set along with `HOMEBREW_DEVELOPER`, do not use bottles from older versions of macOS. This is useful in development on new macOS versions.
diff --git a/manpages/brew.1 b/manpages/brew.1
index d573d24fde..e108b4ac27 100644
--- a/manpages/brew.1
+++ b/manpages/brew.1
@@ -2731,6 +2731,12 @@ If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will nev
If set, use Pry for the \fBbrew irb\fR command\.
.
.TP
+\fBHOMEBREW_SIMULATE_MACOS_ON_LINUX\fR
+.
+.br
+If set, running Homebrew on Linux will simulate certain macOS code paths\. This is useful when auditing macOS formulae while on Linux\. Implies \fBHOMEBREW_FORCE_HOMEBREW_ON_LINUX\fR\.
+.
+.TP
\fBHOMEBREW_SKIP_OR_LATER_BOTTLES\fR
.
.br