Skip to content

Commit 2f3112b

Browse files
authored
Merge pull request #275970 from Homebrew/dartaotruntime
dartaotruntime 3.11.4 (new formula)
2 parents 848a3a9 + 2bcccce commit 2f3112b

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

Formula/d/dartaotruntime.rb

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
class Dartaotruntime < Formula
2+
desc "Command-line tool for running AOT-compiled snapshots of Dart code"
3+
homepage "https://dart.dev/tools/dartaotruntime"
4+
# NOTE: Using a placeholder file because the build source is fetched by gclient
5+
url "https://raw.githubusercontent.com/dart-lang/sdk/refs/tags/3.11.4/README.md"
6+
sha256 "ff4301ec8e5c1259c5778c4abc947e303308cd31af30acd55575f5ca7ed6f405"
7+
license "BSD-3-Clause"
8+
9+
livecheck do
10+
formula "dart-sdk"
11+
end
12+
13+
bottle do
14+
sha256 cellar: :any_skip_relocation, arm64_tahoe: "43c342c42220efb0e8f2f77ea1aebbfaa9db2a8aef692eb98bd6280b7885420d"
15+
sha256 cellar: :any_skip_relocation, arm64_sequoia: "1de265c3c99ac612f79f26a5556527f0ffb7ec32df63a99440fc0e74f27f5b62"
16+
sha256 cellar: :any_skip_relocation, arm64_sonoma: "650f0ae31f16d10e9b691d5c9a44d05837c79d7b724737d811d789c8a5035a94"
17+
sha256 cellar: :any_skip_relocation, sonoma: "48d7fe226d8879076400eb199f9c6db7c071f4ed7168893b0e66c5bdb0b65e0e"
18+
sha256 cellar: :any_skip_relocation, arm64_linux: "1a7908bae85fea2c0b12ff4629c24114638363a1bf2f9adfb89adfb0a7c913a5"
19+
sha256 cellar: :any_skip_relocation, x86_64_linux: "26fb9b632354bf75343bf07bddba74caf23dc2ea27411fd6eeb4d63fd55d0e3e"
20+
end
21+
22+
depends_on "ninja" => :build
23+
depends_on xcode: :build # for xcodebuild
24+
depends_on "dart-sdk" => :test
25+
26+
uses_from_macos "curl" => :build
27+
uses_from_macos "python" => :build
28+
uses_from_macos "xz" => :build
29+
30+
# always pull the latest commit from https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main
31+
resource "depot-tools" do
32+
url "https://chromium.googlesource.com/chromium/tools/depot_tools.git",
33+
revision: "4ce8ba39a3488397a2d1494f167020f21de502f3"
34+
version "4ce8ba39a3488397a2d1494f167020f21de502f3"
35+
36+
livecheck do
37+
url "https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/refs/heads/main?format=JSON"
38+
regex(/"commit":\s*"(\h+)"/i)
39+
end
40+
end
41+
42+
def install
43+
resource("depot-tools").stage(buildpath/"depot-tools")
44+
ENV["DEPOT_TOOLS_UPDATE"] = "0"
45+
ENV.append_path "PATH", buildpath/"depot-tools"
46+
47+
system "gclient", "config", "--name", "sdk", "https://dart.googlesource.com/sdk.git@#{version}"
48+
system "gclient", "sync", "--no-history"
49+
50+
# FIXME: Workaround for https://github.com/dart-lang/sdk/issues/63089
51+
if OS.mac? && MacOS::Xcode.version >= "26.4"
52+
inreplace "sdk/build/config/compiler/BUILD.gn",
53+
"\"-Wno-tautological-constant-compare\",",
54+
"\"-Wno-tautological-constant-compare\", \"-Wno-deprecated-declarations\","
55+
end
56+
57+
cd "sdk" do
58+
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s
59+
out = OS.mac? ? "xcodebuild" : "out"
60+
system "./tools/build.py", "--mode=release", "--arch=#{arch}", "copy_dart_aotruntime"
61+
bin.install "#{out}/Release#{arch.upcase}/dart-sdk/bin/dartaotruntime"
62+
prefix.install_metafiles Pathname.pwd
63+
end
64+
end
65+
66+
test do
67+
dart = Formula["dart-sdk"].bin/"dart"
68+
system dart, "create", "dart-test"
69+
cd "dart-test" do
70+
system dart, "compile", "aot-snapshot", "bin/dart_test.dart"
71+
assert_match "Hello world: 42!", shell_output("#{bin}/dartaotruntime bin/dart_test.aot")
72+
end
73+
end
74+
end

synced_versions_formulae.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
["boost", "boost-bcp", "boost-build", "boost-mpi", "boost-python3"],
2020
["bundler-completion", "gem-completion", "rails-completion", "rake-completion", "ruby-completion"],
2121
["cmake", "cmake-docs"],
22+
["dart-sdk", "dartaotruntime"],
2223
["dbhash", "lemon", "sqldiff", "sqlite", "sqlite-analyzer", "sqlite-rsync"],
2324
["dmd", "dtools"],
2425
["docker", "docker-completion"],

0 commit comments

Comments
 (0)