Module: OS::Mac::Formula Private

Extended by:
T::Helpers
Included in:
Formula
Defined in:
extend/os/mac/formula.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Instance Method Summary collapse

Instance Method Details

#common_sandbox_env(home) ⇒ Hash{Symbol => String}

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The sandbox denies mach-lookup, so AWT cannot reach the WindowServer and aborts the JVM. Headless AWT never connects to it and still renders images off-screen.

Parameters:

Returns:



59
60
61
62
# File 'extend/os/mac/formula.rb', line 59

def common_sandbox_env(home)
  env = super
  env.merge(_JAVA_OPTIONS: [env[:_JAVA_OPTIONS], JAVA_HEADLESS_OPTION].compact.join(" "))
end

#std_cmake_args(install_prefix: prefix, install_libdir: "lib", find_framework: "LAST") ⇒ Array<String>

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:



26
27
28
29
30
31
32
33
34
35
36
# File 'extend/os/mac/formula.rb', line 26

def std_cmake_args(install_prefix: prefix, install_libdir: "lib", find_framework: "LAST")
  args = super

  # Ensure CMake is using the same SDK we are using.
  sdk = MacOS.sdk_for_formula(self)
  raise "No macOS SDK found. Install Xcode or the Command Line Tools." if sdk.nil?

  args << "-DCMAKE_OSX_SYSROOT=#{sdk.path}"

  args
end

#std_swift_args ⇒ Array<String>

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



39
40
41
# File 'extend/os/mac/formula.rb', line 39

def std_swift_args
  ["--disable-sandbox"].concat(super)
end

#std_zig_args(prefix: self.prefix, release_mode: :fast, cpu: nil) ⇒ Array<String>

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:



50
51
52
53
54
# File 'extend/os/mac/formula.rb', line 50

def std_zig_args(prefix: self.prefix, release_mode: :fast, cpu: nil)
  args = super
  args << "-fno-rosetta" if ::Hardware::CPU.arm?
  args
end

#test_sandbox_env(testpath) ⇒ Hash{Symbol => String}

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

The java launcher decides from the options it parses itself, its arguments and JDK_JAVA_OPTIONS, whether to show a jar's SplashScreen-Image, which aborts under the sandbox like the rest of AWT. OpenJDK's configure rejects a boot JDK that reports picked-up options, so the build phase must not see this variable.

Parameters:

Returns:



69
70
71
# File 'extend/os/mac/formula.rb', line 69

def test_sandbox_env(testpath)
  super.merge(JDK_JAVA_OPTIONS: JAVA_HEADLESS_OPTION)
end

#valid_platform? ⇒ Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


15
16
17
# File 'extend/os/mac/formula.rb', line 15

def valid_platform?
  supports_macos?
end