Add HOMEBREW_SIMULATE_MACOS_ON_LINUX
This commit is contained in:
parent
7448a6be58
commit
abb2b26a93
@ -260,6 +260,11 @@ module Homebrew
|
||||
description: "If set, use Pry for the `brew irb` command.",
|
||||
boolean: true,
|
||||
},
|
||||
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.",
|
||||
boolean: true,
|
||||
},
|
||||
HOMEBREW_SKIP_OR_LATER_BOTTLES: {
|
||||
description: "If set along with `HOMEBREW_DEVELOPER`, do not use bottles from older versions " \
|
||||
"of macOS. This is useful in development on new macOS versions.",
|
||||
|
||||
@ -15,7 +15,8 @@ class SoftwareSpec
|
||||
end
|
||||
|
||||
bounds = bounds.transform_values { |v| MacOS::Version.from_symbol(v) }
|
||||
if MacOS.version >= bounds[:since]
|
||||
if MacOS.version >= bounds[:since] ||
|
||||
(Homebrew::EnvConfig.simulate_macos_on_linux? && !bounds.key?(:since))
|
||||
@uses_from_macos_elements << deps
|
||||
else
|
||||
depends_on deps
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# typed: strict
|
||||
# frozen_string_literal: true
|
||||
|
||||
if OS.mac?
|
||||
if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux?
|
||||
require "extend/os/mac/on_os"
|
||||
elsif OS.linux?
|
||||
require "extend/os/linux/on_os"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This logic will need to be more nuanced if this file includes more than `uses_from_macos`.
|
||||
if OS.mac? || Homebrew::EnvConfig.force_homebrew_on_linux?
|
||||
if OS.mac? || Homebrew::EnvConfig.simulate_macos_on_linux?
|
||||
require "extend/os/mac/software_spec"
|
||||
elsif OS.linux?
|
||||
require "extend/os/linux/software_spec"
|
||||
|
||||
@ -282,7 +282,7 @@ module Homebrew
|
||||
|
||||
# The number of conflicts on Linux is absurd.
|
||||
# TODO: remove this and check these there too.
|
||||
return if OS.linux? && !Homebrew::EnvConfig.force_homebrew_on_linux?
|
||||
return if OS.linux? && !Homebrew::EnvConfig.simulate_macos_on_linux?
|
||||
|
||||
recursive_runtime_formulae = formula.runtime_formula_dependencies(undeclared: false)
|
||||
version_hash = {}
|
||||
|
||||
@ -8234,6 +8234,8 @@ module Homebrew::EnvConfig
|
||||
|
||||
def self.pry?(); end
|
||||
|
||||
def self.simulate_macos_on_linux?(); end
|
||||
|
||||
def self.skip_or_later_bottles?(); end
|
||||
|
||||
def self.sorbet_runtime?(); end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user