Merge pull request #3820 from sjackman/macos-version
Define OS::Mac on Linux
This commit is contained in:
commit
09c5be86b6
13
.travis.yml
13
.travis.yml
@ -36,22 +36,13 @@ before_install:
|
|||||||
mv "$HOMEBREW_REPOSITORY/Library/Taps" "$PWD/Library";
|
mv "$HOMEBREW_REPOSITORY/Library/Taps" "$PWD/Library";
|
||||||
sudo rm -rf "$HOMEBREW_REPOSITORY";
|
sudo rm -rf "$HOMEBREW_REPOSITORY";
|
||||||
sudo ln -s "$PWD" "$HOMEBREW_REPOSITORY";
|
sudo ln -s "$PWD" "$HOMEBREW_REPOSITORY";
|
||||||
else
|
|
||||||
HOMEBREW_CORE_TAP_DIR="$(brew --repo "homebrew/core")";
|
|
||||||
mkdir -p "$HOMEBREW_CORE_TAP_DIR";
|
|
||||||
fi
|
fi
|
||||||
- if [ "$MACOS" ]; then
|
- if [ "$MACOS" ]; then
|
||||||
travis_retry git -C Library/Taps/homebrew/homebrew-core fetch --depth=1 origin;
|
travis_retry git -C Library/Taps/homebrew/homebrew-core fetch --depth=1 origin;
|
||||||
|
else
|
||||||
|
travis_retry git clone --depth=1 https://github.com/Homebrew/homebrew-core Library/Taps/homebrew/homebrew-core;
|
||||||
fi
|
fi
|
||||||
- travis_retry git clone --depth=1 https://github.com/Homebrew/homebrew-test-bot Library/Taps/homebrew/homebrew-test-bot
|
- travis_retry git clone --depth=1 https://github.com/Homebrew/homebrew-test-bot Library/Taps/homebrew/homebrew-test-bot
|
||||||
- if [ "$LINUX" ]; then
|
|
||||||
HOMEBREW_TEST_BOT_TAP_DIR="$(brew --repo "homebrew/test-bot")";
|
|
||||||
ln -s "$HOMEBREW_TEST_BOT_TAP_DIR/.git" "$HOMEBREW_TEST_BOT_TAP_DIR/Formula" "$HOMEBREW_CORE_TAP_DIR";
|
|
||||||
fi
|
|
||||||
# can be removed after 1.5.3 is tagged
|
|
||||||
- if [ "$LINUX" ]; then
|
|
||||||
export HOMEBREW_FORCE_VENDOR_RUBY=1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- brew test-bot
|
- brew test-bot
|
||||||
|
|||||||
@ -21,6 +21,7 @@ module OS
|
|||||||
end
|
end
|
||||||
PATH_OPEN = "/usr/bin/open".freeze
|
PATH_OPEN = "/usr/bin/open".freeze
|
||||||
elsif OS.linux?
|
elsif OS.linux?
|
||||||
|
require "os/linux"
|
||||||
ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze
|
ISSUES_URL = "https://github.com/Linuxbrew/brew/wiki/troubleshooting".freeze
|
||||||
PATH_OPEN = "xdg-open".freeze
|
PATH_OPEN = "xdg-open".freeze
|
||||||
end
|
end
|
||||||
|
|||||||
28
Library/Homebrew/os/linux.rb
Normal file
28
Library/Homebrew/os/linux.rb
Normal file
@ -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
|
||||||
Loading…
x
Reference in New Issue
Block a user