homebrew-core/Formula/gdb.rb

75 lines
2.0 KiB
Ruby

class Gdb < Formula
desc "GNU debugger"
homepage "https://www.gnu.org/software/gdb/"
url "https://ftp.gnu.org/gnu/gdb/gdb-11.1.tar.xz"
mirror "https://ftpmirror.gnu.org/gdb/gdb-11.1.tar.xz"
sha256 "cccfcc407b20d343fb320d4a9a2110776dd3165118ffd41f4b1b162340333f94"
license "GPL-3.0-or-later"
revision 1
head "https://sourceware.org/git/binutils-gdb.git", branch: "master"
bottle do
sha256 monterey: "eeca01c6f1aa84f53433bb3708b6b3b6dd87dee6aae34fde17ef032df30b9ea5"
sha256 big_sur: "e4a089c37a6666d0c7888965b1fa3c3fc00a4bab7b2562ededeb2e75a16b0a1a"
sha256 catalina: "bf220e52b7bb0054cdfff14d8454b2b3d319cd0da241f00cd619b1308094676a"
sha256 x86_64_linux: "1cca500a1415dbf29917773f35aaee5a97c43fb24947e431c1145db28c33a6ff"
end
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