2 desc "Graphical front-end for command-line debuggers"
3 homepage "https://www.gnu.org/software/ddd/"
4 url "https://ftp.gnu.org/gnu/ddd/ddd-3.4.1.tar.gz"
5 mirror "https://ftpmirror.gnu.org/ddd/ddd-3.4.1.tar.gz"
6 sha256 "b87517a6c3f9611566347e283a2cf931fa369919b553536a2235e63402f4ee89"
9 "GFDL-1.1-no-invariants-or-later", # ddd/ddd-themes.info
10 "GFDL-1.3-no-invariants-or-later", # ddd/ddd.info
11 "HPND-sell-variant", # ddd/motif/LabelH.C
12 "MIT-open-group", # ddd/athena_ddd/PannerM.C
16 sha256 arm64_sequoia: "3c31137211b8185a0b8e3ceffce6474c803cf8790348211ad0690162697a1613"
17 sha256 arm64_sonoma: "73e84236c870313e5a43e936998545961609c5f43104e6b57cd693a03dc52a5d"
18 sha256 arm64_ventura: "d287abe1d656058174b03b2e1215e7eee7d996fad1e041fd8d14e573b3e0716f"
19 sha256 arm64_monterey: "e2f58c650c498dd2ab90369baee0dad09b169e503e8616894f6814ba543310a8"
20 sha256 sonoma: "19e15c98f1732a8c5032734ecdab5f4aec373ef3991bc65c7ce4e5f81b526861"
21 sha256 ventura: "47ff49d7888461a987aee0ae62749dc96d6c44c6825f09a61d637f13cd736198"
22 sha256 monterey: "33047c998d6856a9425df4fa92fd9f3fdfe7717921def4bb814ae82ceb928927"
23 sha256 x86_64_linux: "52266be4e6e825db9c2941e2ab44002d1d3707b379e0339d3ddf12af18f81ad6"
26 depends_on "fontconfig"
33 depends_on "openmotif"
35 uses_from_macos "ncurses"
38 depends_on "gnu-sed" => :build
45 depends_on "gdb" => :test
50 depends_on "gdb" => :test
54 # Use GNU sed due to ./unumlaut.sed: RE error: illegal byte sequence
55 ENV.prepend_path "PATH", Formula["gnu-sed"].libexec/"gnubin" if OS.mac?
57 # Help configure find freetype headers
58 ENV.append_to_cflags "-I#{Formula["freetype"].opt_include}/freetype2"
60 system "./configure", "--disable-silent-rules",
61 "--enable-builtin-app-defaults",
62 "--enable-builtin-manual",
65 # From MacPorts: make will build the executable "ddd" and the X resource
66 # file "Ddd" in the same directory, as HFS+ is case-insensitive by default
67 # this will loosely FAIL
68 system "make", "EXEEXT=exe"
71 system "make", "install", "EXEEXT=exe"
72 mv bin/"dddexe", bin/"ddd"
76 output = shell_output("#{bin}/ddd --version")
77 output.force_encoding("ASCII-8BIT") if output.respond_to?(:force_encoding)
78 assert_match version.to_s, output
80 if OS.mac? && Hardware::CPU.arm?
81 # gdb is not supported on macOS ARM. Other debuggers like --perl need window
82 # and using --nw causes them to just pass through to normal execution.
83 # Since it is tricky to test window/XQuartz on CI, just check no crash.
84 assert_equal "Test", shell_output("#{bin}/ddd --perl --nw -e \"print 'Test'\"")
86 assert_match testpath.to_s, pipe_output("#{bin}/ddd --gdb --nw true 2>&1", "pwd\nquit")