Merge pull request #206954 from Homebrew/bump-gollama-1.28.13
[homebrew-core.git] / Formula / d / dtools.rb
blobddba19b32c9d6837e6944b6c2a154aa363413435
1 class Dtools < Formula
2   desc "D programming language tools"
3   homepage "https://dlang.org/"
4   url "https://github.com/dlang/tools/archive/refs/tags/v2.109.1.tar.gz"
5   sha256 "6f9db3ec124356f1ba6b10681e6bb07e364a434faf8d1644ef2e254b90a16459"
6   license "BSL-1.0"
7   head "https://github.com/dlang/tools.git", branch: "master"
9   bottle do
10     sha256 cellar: :any_skip_relocation, arm64_sequoia:  "014f22a3cb9d11924138766bcb02867a949faf4d555287c8aa37a29358047de0"
11     sha256 cellar: :any_skip_relocation, arm64_sonoma:   "e4da9f80c0dd636bdbdc3dc13440887df95716c9f718a64ea7ba9eacf69f41c8"
12     sha256 cellar: :any_skip_relocation, arm64_ventura:  "d07da51134f24a745adfde5e2876e6cf81b650e3286648e5cce94b7e289eb450"
13     sha256 cellar: :any_skip_relocation, arm64_monterey: "422bb5c6da88abfe0055afa0e8d0a57f1d039b18cd1ecf70903dad2b946a3f5a"
14     sha256 cellar: :any_skip_relocation, sonoma:         "58cc9814b16fe73c3223b9190aad9e4208671f1272f2458fb02d1e77c03708bd"
15     sha256 cellar: :any_skip_relocation, ventura:        "dbfd5583ea5a1a2f26aad14c97152bef1599157fc6679f6d9949815eecc6ce73"
16     sha256 cellar: :any_skip_relocation, monterey:       "6344b77d8ab17334e4ccac3c3ab53d6c617871cf2a7c1ddda56ec502abdff3d0"
17     sha256 cellar: :any_skip_relocation, x86_64_linux:   "4bcfd9495f99afff506110cd6bdf016c70b993f4437fab7567fa3e56bf0d46eb"
18   end
20   depends_on "dub" => :build
21   depends_on "ldc" => [:build, :test]
23   link_overwrite "bin/ddemangle"
24   link_overwrite "bin/dustmite"
25   link_overwrite "bin/rdmd"
27   def install
28     # We only need the "public" tools, as listed at
29     # https://github.com/dlang/tools/blob/master/README.md
30     #
31     # Skip building dman as it requires getting and building the DMD
32     # and dlang.org source trees.
33     tools = %w[ddemangle rdmd dustmite]
34     system "dub", "add-local", buildpath
36     tools.each do |tool|
37       system "dub", "build", "--build=release", ":#{tool}"
38       bin.install "dtools_#{tool}" => tool
39     end
41     man1.install "man/man1/rdmd.1"
42   end
44   test do
45     (testpath/"hello.d").write <<~D
46       import std.stdio;
47       void main()
48       {
49         writeln("Hello world!");
50       }
51     D
52     assert_equal "Hello world!", shell_output("#{bin}/rdmd #{testpath}/hello.d").chomp
53   end
54 end