Skip to content

Commit a1fb394

Browse files
authored
Merge pull request #220109 from Homebrew/emscripten-update-resources
emscripten: update resources
2 parents 781efe2 + 9026cfa commit a1fb394

File tree

1 file changed

+50
-13
lines changed

1 file changed

+50
-13
lines changed

Formula/e/emscripten.rb

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ class Emscripten < Formula
1818
end
1919

2020
bottle do
21-
sha256 cellar: :any, arm64_sequoia: "bb8585ef66dd08b3a071923e3baee6f4f5e055b336b6e64fd72b191060bd2678"
22-
sha256 cellar: :any, arm64_sonoma: "0d750dca4d78e27de5aab41a5ac5f4c7ceed220dd0dd7e3d28d1e221dc875981"
23-
sha256 cellar: :any, arm64_ventura: "0d16e993cfe4b1d6df2aabde2b3b3d6b26957cdb6421ff9cf97a1d1fe623b3d2"
24-
sha256 cellar: :any, sonoma: "5be5e04d0b9a8208ea4ab205fdce6f4a19fcbba040fa0eeb00895e7e0539f5ee"
25-
sha256 cellar: :any, ventura: "09a0f050cd231ba691fe01ce6083c09f399ee1d9789e21f73329f9693b976ab9"
26-
sha256 cellar: :any_skip_relocation, x86_64_linux: "c8bcbffe4761406c1514027396ba1a82219ae23d060919136597551380c1ab28"
21+
rebuild 1
22+
sha256 cellar: :any, arm64_sequoia: "8d98eabe965c37eb816fe7aa3dab1969f9e1738c995d6cc33ee1579887039fca"
23+
sha256 cellar: :any, arm64_sonoma: "6134fdeccf8f4d5f971234f1c796271753f4701558996ef432204f63e8b3dcb3"
24+
sha256 cellar: :any, arm64_ventura: "14a7f66841bd9c5e922a9125341845e2eafda5f1346fd3be75ad887f6e1bb044"
25+
sha256 cellar: :any, sonoma: "c25b2e5cdabbe2612272579980fecbada8a7c50345bc1f5424a340737f5c2432"
26+
sha256 cellar: :any, ventura: "6557dd81bb0d80023cf130bde873ac8b03ed822bd3d366387d40039d04df6252"
27+
sha256 cellar: :any_skip_relocation, x86_64_linux: "404f277c087778a105d2f8037a37c276d3065a189e6057d5f7388a63fd0a755f"
2728
end
2829

2930
depends_on "cmake" => :build
@@ -63,17 +64,51 @@ class Emscripten < Formula
6364
# https://chromium.googlesource.com/emscripten-releases/+/<commit>/DEPS
6465
# Then use the listed binaryen_revision for the revision below.
6566
resource "binaryen" do
66-
url "https://github.com/WebAssembly/binaryen.git",
67-
revision: "8b47ebf8ad8609f7b2f511f268e6b9302979816f"
67+
url "https://github.com/WebAssembly/binaryen/archive/0997f9b3f1648329607d9bb54e29605c9081fbba.tar.gz"
68+
version "0997f9b3f1648329607d9bb54e29605c9081fbba"
69+
sha256 "f45fc5f090046af463ed028b83ce24144fd32a2fae9a6686c233ddc7a3c2df9f"
70+
71+
livecheck do
72+
url "https://raw.githubusercontent.com/emscripten-core/emsdk/refs/tags/#{LATEST_VERSION}/emscripten-releases-tags.json"
73+
regex(/["']binaryen_revision["']:\s*["']([0-9a-f]+)["']/i)
74+
strategy :json do |json, regex|
75+
# TODO: Find a way to replace `json.dig("aliases", "latest")` with substituted LATEST_VERSION
76+
release_hash = json.dig("releases", json.dig("aliases", "latest"))
77+
next if release_hash.blank?
78+
79+
release_url = "https://chromium.googlesource.com/emscripten-releases/+/#{release_hash}/DEPS?format=TEXT"
80+
match = Base64.decode64(Homebrew::Livecheck::Strategy.page_content(release_url)[:content]).match(regex)
81+
next if match.blank?
82+
83+
match[1]
84+
end
85+
end
6886
end
6987

7088
# emscripten does not support using the stable version of LLVM.
7189
# https://github.com/emscripten-core/emscripten/issues/11362
7290
# See binaryen resource above for instructions on how to update this.
7391
# Then use the listed llvm_project_revision for the tarball below.
7492
resource "llvm" do
75-
url "https://github.com/llvm/llvm-project/archive/553da9634dc4bae215e6c850d2de3186d09f9da5.tar.gz"
76-
sha256 "ce07ac6c5ef4d1d3a1577b83d5ea144d1b02f46a90a3600e79c3954b9d12b4de"
93+
url "https://github.com/llvm/llvm-project/archive/4775e6d9099467df9363e1a3cd5950cc3d2fde05.tar.gz"
94+
version "4775e6d9099467df9363e1a3cd5950cc3d2fde05"
95+
sha256 "837629adc13003cb2556880e98e9b8fc9b77fb805424278a6026ed64227a9238"
96+
97+
livecheck do
98+
url "https://raw.githubusercontent.com/emscripten-core/emsdk/refs/tags/#{LATEST_VERSION}/emscripten-releases-tags.json"
99+
regex(/["']llvm_project_revision["']:\s*["']([0-9a-f]+)["']/i)
100+
strategy :json do |json, regex|
101+
# TODO: Find a way to replace `json.dig("aliases", "latest")` with substituted LATEST_VERSION
102+
release_hash = json.dig("releases", json.dig("aliases", "latest"))
103+
next if release_hash.blank?
104+
105+
release_url = "https://chromium.googlesource.com/emscripten-releases/+/#{release_hash}/DEPS?format=TEXT"
106+
match = Base64.decode64(Homebrew::Livecheck::Strategy.page_content(release_url)[:content]).match(regex)
107+
next if match.blank?
108+
109+
match[1]
110+
end
111+
end
77112
end
78113

79114
def install
@@ -161,17 +196,19 @@ def install
161196
end
162197

163198
resource("binaryen").stage do
164-
system "cmake", "-S", ".", "-B", "build", *std_cmake_args(install_prefix: libexec/"binaryen")
199+
system "cmake", "-S", ".", "-B", "build",
200+
"-DBUILD_TESTS=OFF",
201+
*std_cmake_args(install_prefix: libexec/"binaryen")
165202
system "cmake", "--build", "build"
166203
system "cmake", "--install", "build"
167204
end
168205

169206
cd libexec do
170207
system "npm", "install", *std_npm_args(prefix: false)
171208
# Delete native GraalVM image in incompatible platforms.
172-
if OS.linux?
209+
if OS.linux? && Hardware::CPU.intel?
173210
rm_r("node_modules/google-closure-compiler-linux")
174-
elsif Hardware::CPU.arm?
211+
elsif OS.mac? && Hardware::CPU.arm?
175212
rm_r("node_modules/google-closure-compiler-osx")
176213
end
177214

0 commit comments

Comments
 (0)