binutils: make keg_only

`gnm` is broken with macOS 10.14 Mojave/XCode 10. This breaks gcc when
binutils is linked.

Fixes: https://github.com/Homebrew/homebrew-core/issues/32516

See also: https://sourceware.org/bugzilla/show_bug.cgi?id=23728
This commit is contained in:
Izaak Beekman 2018-10-26 12:10:24 -04:00
parent 372fddc2a4
commit db433a5e3d
No known key found for this signature in database
GPG key ID: A93CE70D8021BD0F

View file

@ -4,6 +4,7 @@ class Binutils < Formula
url "https://ftp.gnu.org/gnu/binutils/binutils-2.31.1.tar.gz"
mirror "https://ftpmirror.gnu.org/binutils/binutils-2.31.1.tar.gz"
sha256 "e88f8d36bd0a75d3765a4ad088d819e35f8d7ac6288049780e2fefcad18dde88"
revision 1
bottle do
sha256 "92fdc2c6b6b95c3944156ad3da3b5c8a3118c245e088712df451237de67d6732" => :mojave
@ -12,13 +13,13 @@ class Binutils < Formula
sha256 "7c693e68ebfcd654fd781480e68469e8f5af93c7397754a8caae1937322feb8f" => :el_capitan
end
# No --default-names option as it interferes with Homebrew builds.
keg_only :provided_by_macos,
"because Apple provides the same tools and binutils is poorly supported on macOS"
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--enable-deterministic-archives",
"--program-prefix=g",
"--prefix=#{prefix}",
"--infodir=#{info}",
"--mandir=#{man}",
@ -29,9 +30,12 @@ class Binutils < Formula
"--enable-targets=all"
system "make"
system "make", "install"
Dir["#{bin}/*"].each do |f|
bin.install_symlink f => "g" + File.basename(f)
end
end
test do
assert_match "main", shell_output("#{bin}/gnm #{bin}/gnm")
assert_match "Usage:", shell_output("#{bin}/strings #{bin}/strings")
end
end