77 lines
2.1 KiB
Ruby
77 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"
|
|
revision 1
|
|
head "https://sourceware.org/git/binutils-gdb.git", branch: "master"
|
|
|
|
bottle do
|
|
rebuild 1
|
|
sha256 monterey: "abd5971ed1807705c206f4a0302785af984aa781b185672de0fbcace98eadb47"
|
|
sha256 big_sur: "e1c84f92d867ebe2f41ea4f3bd16a7a8fe96d14461c8e3bd6ee2bcf53e51e4b9"
|
|
sha256 catalina: "d787042cc42e53808fcee2528e0369ab5fa55fb4e8cb8cbfbc6f4574052e8f0b"
|
|
sha256 x86_64_linux: "e00341b4932632977ceace30cd3c9ee2cdb707c6fb60d241ac680eb6773958e9"
|
|
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 "libxcrypt"
|
|
uses_from_macos "ncurses"
|
|
|
|
on_linux do
|
|
depends_on "pkg-config" => :build
|
|
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.10
|
|
--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
|