homebrew-core/Formula/gdb.rb

69 lines
1.9 KiB
Ruby

class Gdb < Formula
desc "GNU debugger"
homepage "https://www.gnu.org/software/gdb/"
url "https://ftp.gnu.org/gnu/gdb/gdb-9.1.tar.xz"
mirror "https://ftpmirror.gnu.org/gdb/gdb-9.1.tar.xz"
sha256 "699e0ec832fdd2f21c8266171ea5bf44024bd05164fdf064e4d10cc4cf0d1737"
revision 1
head "https://sourceware.org/git/binutils-gdb.git"
bottle do
sha256 "848a06573870a26ca89fe859fe8d2e159b1781db544841a55c0713f00b7c18bc" => :catalina
sha256 "24640c71e5cdbb1ccd69e5da454267e3929e0b1d73abf91c162c4658f756d755" => :mojave
sha256 "d279ccc0f8eefc8a7b3ac5f182290af201345adf4523b3a2671ab752e821d186" => :high_sierra
end
depends_on "python@3.8"
depends_on "xz" # required for lzma support
uses_from_macos "expat"
uses_from_macos "ncurses"
conflicts_with "i386-elf-gdb", :because => "both install include/gdb, share/gdb and share/info"
fails_with :clang do
build 800
cause <<~EOS
probe.c:63:28: error: default initialization of an object of const type
'const any_static_probe_ops' without a user-provided default constructor
EOS
end
def install
args = %W[
--enable-targets=all
--prefix=#{prefix}
--disable-debug
--disable-dependency-tracking
--with-lzma
--with-python=#{Formula["python@3.8"].opt_bin}/python3
--disable-binutils
]
mkdir "build" do
system "../configure", *args
system "make"
# Don't install bfd or opcodes, as they are provided by binutils
system "make", "install-gdb"
end
end
def caveats
<<~EOS
gdb requires special privileges to access Mach ports.
You will need to codesign the binary. For instructions, see:
https://sourceware.org/gdb/wiki/BuildingOnDarwin
On 10.12 (Sierra) or later with SIP, you need to run this:
echo "set startup-with-shell off" >> ~/.gdbinit
EOS
end
test do
system bin/"gdb", bin/"gdb", "-configuration"
end
end