From b137d4ae00fc31831ecb4614f676d96924867132 Mon Sep 17 00:00:00 2001 From: danielnachun Date: Sun, 10 Jul 2022 17:23:09 -0700 Subject: [PATCH] bottle.rb: make GCC relocatable again --- Library/Homebrew/dev-cmd/bottle.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 1699291175..38d62a7c80 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -261,6 +261,7 @@ module Homebrew def formula_ignores(f) ignores = [] cellar_regex = Regexp.escape(HOMEBREW_CELLAR) + prefix_regex = Regexp.escape(HOMEBREW_PREFIX) # Ignore matches to go keg, because all go binaries are statically linked. any_go_deps = f.deps.any? do |dep| @@ -275,7 +276,7 @@ module Homebrew # On Linux, GCC installation can be moved so long as the whole directory tree is moved together: # https://gcc-help.gcc.gnu.narkive.com/GnwuCA7l/moving-gcc-from-the-installation-path-is-it-allowed. when Version.formula_optionally_versioned_regex(:gcc) - %r{#{cellar_regex}/gcc} if OS.linux? + Regexp.union(%r{#{cellar_regex}/gcc}, %r{#{prefix_regex}/opt/gcc}) if OS.linux? # binutils is relocatable for the same reason: https://github.com/Homebrew/brew/pull/11899#issuecomment-906804451. when Version.formula_optionally_versioned_regex(:binutils) %r{#{cellar_regex}/binutils} if OS.linux?