80 lines
2.2 KiB
Ruby
80 lines
2.2 KiB
Ruby
class Gdb < Formula
|
|
desc "GNU debugger"
|
|
homepage "https://www.gnu.org/software/gdb/"
|
|
url "https://ftp.gnu.org/gnu/gdb/gdb-10.1.tar.xz"
|
|
mirror "https://ftpmirror.gnu.org/gdb/gdb-10.1.tar.xz"
|
|
sha256 "f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0"
|
|
license "GPL-3.0-or-later"
|
|
head "https://sourceware.org/git/binutils-gdb.git"
|
|
|
|
livecheck do
|
|
url :stable
|
|
end
|
|
|
|
bottle do
|
|
sha256 "3a9d6b7bfe4530321ab858ca8817431a28010ffbdbe5b0db1d700c81a392c91f" => :big_sur
|
|
sha256 "fbd7836617ad0bb335ad9175280f14162dfdf0dd2f5e6b634d37b2d93765b51e" => :catalina
|
|
sha256 "f3656f04b8725825296ce977461af0d0e6133ec9a1f9086ca3b889661f40802e" => :mojave
|
|
sha256 "a57db00038cdcdc85f80c064332f3b4ef45571a2c0cd0defa55f2e6bde6a751d" => :high_sierra
|
|
end
|
|
|
|
depends_on "python@3.9"
|
|
depends_on "xz" # required for lzma support
|
|
|
|
uses_from_macos "expat"
|
|
uses_from_macos "ncurses"
|
|
|
|
on_linux do
|
|
depends_on "pkg-config" => :build
|
|
depends_on "guile"
|
|
end
|
|
|
|
conflicts_with "i386-elf-gdb", because: "both install include/gdb, share/gdb and share/info"
|
|
conflicts_with "x86_64-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.9"].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
|