Skip to content
GitLab
菜单
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
KMSCAKKSCFKA AKFACAMADCAS
brew
提交
3b41be99
未验证
提交
3b41be99
编辑于
11月 11, 2021
作者:
Carlo Cabrera
提交者:
GitHub
11月 11, 2021
浏览文件
Merge pull request #12417 from carlocab/rosetta-arm
vendor-install: handle native ARM running under Rosetta
上级
449d0430
f114b897
变更
2
Hide whitespace changes
Inline
Side-by-side
Library/Homebrew/brew.sh
浏览文件 @
3b41be99
...
...
@@ -6,23 +6,31 @@
# Doesn't need a default case because we don't support other OSs
# shellcheck disable=SC2249
HOMEBREW_PROCESSOR
=
"
$(
uname
-m
)
"
HOMEBREW_PHYSICAL_PROCESSOR
=
"
${
HOMEBREW_PROCESSOR
}
"
HOMEBREW_SYSTEM
=
"
$(
uname
-s
)
"
case
"
${
HOMEBREW_SYSTEM
}
"
in
Darwin
)
HOMEBREW_MACOS
=
"1"
;;
Linux
)
HOMEBREW_LINUX
=
"1"
;;
esac
# If we're running under macOS Rosetta 2, and it was requested by setting
# HOMEBREW_CHANGE_ARCH_TO_ARM (for example in CI), then we re-exec this
# same file under the native architecture
# These variables are set from the user environment.
# shellcheck disable=SC2154
if
[[
"
${
HOMEBREW_CHANGE_ARCH_TO_ARM
}
"
==
"1"
]]
&&
[[
"
${
HOMEBREW_MACOS
}
"
==
"1"
]]
&&
[[
"
$(
sysctl
-n
hw.optional.arm64 2>/dev/null
)
"
==
"1"
]]
&&
[[
"
$(
sysctl
-n
sysctl.proc_translated 2>/dev/null
)
"
==
"1"
]]
if
[[
"
${
HOMEBREW_MACOS
}
"
==
"1"
]]
&&
[[
"
$(
sysctl
-n
hw.optional.arm64 2>/dev/null
)
"
==
"1"
]]
then
exec arch
-arm64e
"
${
HOMEBREW_BREW_FILE
}
"
"
$@
"
# used in vendor-install.sh
# shellcheck disable=SC2034
HOMEBREW_PHYSICAL_PROCESSOR
=
"arm64"
HOMEBREW_ROSETTA
=
"
$(
sysctl
-n
sysctl.proc_translated
)
"
# If we're running under macOS Rosetta 2, and it was requested by setting
# HOMEBREW_CHANGE_ARCH_TO_ARM (for example in CI), then we re-exec this
# same file under the native architecture
# These variables are set from the user environment.
# shellcheck disable=SC2154
if
[[
"
${
HOMEBREW_CHANGE_ARCH_TO_ARM
}
"
==
"1"
]]
&&
[[
"
${
HOMEBREW_ROSETTA
}
"
==
"1"
]]
then
exec arch
-arm64e
"
${
HOMEBREW_BREW_FILE
}
"
"
$@
"
fi
fi
# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
...
...
Library/Homebrew/cmd/vendor-install.sh
浏览文件 @
3b41be99
...
...
@@ -14,15 +14,15 @@ VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable-ruby.
if
[[
-n
"
${
HOMEBREW_MACOS
}
"
]]
then
if
[[
"
${
HOMEBREW_PROCESSOR
}
"
==
"
Intel
"
]]
||
if
[[
"
${
HOMEBREW_
PHYSICAL_
PROCESSOR
}
"
==
"
x86_64
"
]]
||
# Handle the case where /usr/local/bin/brew is run under arm64.
# It's a x86_64 installation there (we refuse to install arm64 binaries) so
# use a x86_64 Portable Ruby.
[[
"
${
HOMEBREW_PROCESSOR
}
"
==
"arm64"
&&
"
${
HOMEBREW_PREFIX
}
"
==
"/usr/local"
]]
[[
"
${
HOMEBREW_
PHYSICAL_
PROCESSOR
}
"
==
"arm64"
&&
"
${
HOMEBREW_PREFIX
}
"
==
"/usr/local"
]]
then
ruby_FILENAME
=
"portable-ruby-2.6.8.yosemite.bottle.tar.gz"
ruby_SHA
=
"0cb1cc7af109437fe0e020c9f3b7b95c3c709b140bde9f991ad2c1433496dd42"
elif
[[
"
${
HOMEBREW_PROCESSOR
}
"
==
"arm64"
]]
elif
[[
"
${
HOMEBREW_
PHYSICAL_
PROCESSOR
}
"
==
"arm64"
]]
then
ruby_FILENAME
=
"portable-ruby-2.6.8.arm64_big_sur.bottle.tar.gz"
ruby_SHA
=
"f2d5cab5a4dd49e5b3de780a3cd0a1f61642fea247d1c25aa40cd43f1be290b5"
...
...
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录