homebrew-core/Formula/gdb.rb

75 lines
2.1 KiB
Ruby

class Gdb < Formula
desc "GNU debugger"
homepage "https://www.gnu.org/software/gdb/"
url "https://ftp.gnu.org/gnu/gdb/gdb-12.1.tar.xz"
mirror "https://ftpmirror.gnu.org/gdb/gdb-12.1.tar.xz"
sha256 "0e1793bf8f2b54d53f46dea84ccfd446f48f81b297b28c4f7fc017b818d69fed"
license "GPL-3.0-or-later"
head "https://sourceware.org/git/binutils-gdb.git", branch: "master"
bottle do
sha256 monterey: "2a067be29153e334e732082adfaf3f7579d6bc355c75250d2a04e19b6ef6c0e8"
sha256 big_sur: "333e8565b1af77ab81aa531a4f088bbe29fff27b259c909eadc90cc62d75cb36"
sha256 catalina: "4e90533da0983000eca1e41e1d77675df3f4af6d68cd573d1e8f7f53e38763c7"
sha256 x86_64_linux: "1219b819cc5d73edb71169c8e5052a69bc79e7a2b54c65d1fccae9d44feb4099"
end
depends_on arch: :x86_64 # gdb is not supported on macOS ARM
depends_on "gmp"
depends_on "python@3.10"
depends_on "xz" # required for lzma support
uses_from_macos "texinfo" => :build
uses_from_macos "expat"
uses_from_macos "ncurses"
on_linux do
depends_on "pkg-config" => :build
depends_on "gcc"
depends_on "guile"
end
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
fails_with gcc: "5"
def install
args = %W[
--enable-targets=all
--prefix=#{prefix}
--disable-debug
--disable-dependency-tracking
--with-lzma
--with-python=#{Formula["python@3.10"].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", "maybe-install-gdbserver"
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/PermissionsDarwin
EOS
end
test do
system bin/"gdb", bin/"gdb", "-configuration"
end
end