Commit ff92a576 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

mac: Make it possible to download mac sdk on a linux host.

This is apparently used by ffmpeg's robosushi tool, when doing ffmpeg
rolls -- except they currently pull the SDK off a GCS bucket instead
of using cipd like Chromium normally does nowadays. This makes it
possible to make robosushi use the more common method.

Bug: 1098899
Change-Id: I0a2aea6cd0316e536bb3501801831817a5290def
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2277455
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784530}
parent 663b352f
......@@ -28,7 +28,15 @@ import mac_toolchain
def _IsCorpMachine():
return os.path.isdir('/Library/GoogleCorpSupport/')
if sys.platform == 'darwin':
return os.path.isdir('/Library/GoogleCorpSupport/')
if sys.platform.startswith('linux'):
import subprocess
try:
return subprocess.check_output('lsb_release -sc').rstrip() == 'rodete'
except:
return False
return False
def main():
......
......@@ -60,6 +60,8 @@ PARANOID_MODE = '$ParanoidMode CheckIntegrity\n'
def PlatformMeetsHermeticXcodeRequirements(version):
if sys.platform != 'darwin':
return True
needed = MAC_MINIMUM_OS_VERSION[version]
major_version = map(int, platform.release().split('.')[:len(needed)])
return major_version >= needed
......@@ -130,6 +132,9 @@ def InstallXcodeBinaries(version, binaries_root=None):
RequestCipdAuthentication()
return 1
if sys.platform != 'darwin':
return 0
# Accept the license for this version of Xcode if it's newer than the
# currently accepted version.
cipd_xcode_version_plist_path = os.path.join(
......@@ -178,9 +183,6 @@ def InstallXcodeBinaries(version, binaries_root=None):
def main():
if sys.platform != 'darwin':
return 0
if not _UseHermeticToolchain():
print('Skipping Mac toolchain installation for mac')
return 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment