From 73ba9b3d880ae72e2dd8649d60b3a338ba744ac0 Mon Sep 17 00:00:00 2001 From: Shaun Jackman Date: Tue, 20 Feb 2018 11:13:13 -0800 Subject: [PATCH] Define OS::Mac on Linux Define MacOS.version, MacOS.full_version, and MacOS::Xcode.version to Version::NULL on Linux so that brew readall succeeds and Homebrew/brew can tap Homebrew/core on Linux. --- Library/Homebrew/os.rb | 1 + Library/Homebrew/os/linux.rb | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Library/Homebrew/os/linux.rb diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index d35a49dd7b..d56b032286 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -21,6 +21,7 @@ module OS end PATH_OPEN = "/usr/bin/open".freeze elsif OS.linux? + require "os/linux" ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze PATH_OPEN = "xdg-open".freeze end diff --git a/Library/Homebrew/os/linux.rb b/Library/Homebrew/os/linux.rb new file mode 100644 index 0000000000..e5af301b2f --- /dev/null +++ b/Library/Homebrew/os/linux.rb @@ -0,0 +1,28 @@ +module OS + # Define OS::Mac on Linux for formula API compatibility. + module Mac + module_function + + ::MacOS = self # rubocop:disable Naming/ConstantName + + def prefer_64_bit? + Hardware::CPU.is_64_bit? + end + + def version + Version::NULL + end + + def full_version + Version::NULL + end + + module Xcode + module_function + + def version + Version::NULL + end + end + end +end