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