Skip to content

Commit 348df0b

Browse files
authored
Merge pull request #216940 from Homebrew/bump-deno-2.2.6
deno 2.2.6
2 parents a6311fb + 71dd6c4 commit 348df0b

File tree

1 file changed

+31
-94
lines changed

1 file changed

+31
-94
lines changed

Formula/d/deno.rb

Lines changed: 31 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,58 @@
11
class Deno < Formula
22
desc "Secure runtime for JavaScript and TypeScript"
33
homepage "https://deno.com/"
4-
url "https://github.com/denoland/deno/releases/download/v2.2.4/deno_src.tar.gz"
5-
sha256 "67808c70241abe878f177767585863d8442214b7a18c0ba7527c4a8f464f8cb3"
4+
url "https://github.com/denoland/deno/releases/download/v2.2.6/deno_src.tar.gz"
5+
sha256 "e3a0763f10d8f0ec511f2617456c7e0eee130c2b7a6787abbbab3baf29bc98e8"
66
license "MIT"
77
head "https://github.com/denoland/deno.git", branch: "main"
88

99
bottle do
10-
sha256 cellar: :any, arm64_sequoia: "623e5310ca092a32f81d9bb61701eae4992907b71cca3f213419b9192bca5fc5"
11-
sha256 cellar: :any, arm64_sonoma: "f6d977975fecdd50560f8f134771965e87ed31a28eb50773d5284f48c0117e15"
12-
sha256 cellar: :any, arm64_ventura: "c62781dfcbc742587a77e7da61505bccab2fd6ed41086001f61c4e75fb067efd"
13-
sha256 cellar: :any, sonoma: "32cf427dc73263a766c2d0809093c43372e65e079ca8010d04c2cf0589a0b1ea"
14-
sha256 cellar: :any, ventura: "cf642874818250e4d9466c18c1d5b95e2963c60a17e624146baec63b3e1014e6"
15-
sha256 cellar: :any_skip_relocation, x86_64_linux: "79105574f279010d9d6c3c643a8792a592b79a4382af5f0e8fd362a8901ac316"
10+
sha256 cellar: :any, arm64_sequoia: "def124e59d7c4bf45905c2cd270c3bef08b6d4e287fabaa8f2875ee6a56ee04d"
11+
sha256 cellar: :any, arm64_sonoma: "08e4a8997eae12fdd6131f45f10418f8140d252ba8cf4d64d2df966cddbf73f0"
12+
sha256 cellar: :any, arm64_ventura: "03bd787e5e0be063b77dc5c1827e4d3ca3a58326b1b510acc8c451260c6c13bb"
13+
sha256 cellar: :any, sonoma: "5e22f7b675ca648624f8f8cc622121872955144d598a181a785ec4d1eb9bb81f"
14+
sha256 cellar: :any, ventura: "037df5eb51edcd0e1995d442e6215d2a3d298cc42172b6ce9f975116067b9905"
15+
sha256 cellar: :any_skip_relocation, x86_64_linux: "bdb651c881d8bd159202d060de1f21b7c90a719db4571b534dbb477b232fdd04"
1616
end
1717

1818
depends_on "cmake" => :build
1919
depends_on "lld" => :build
2020
depends_on "llvm" => :build
2121
depends_on "ninja" => :build
22-
depends_on "protobuf" => :build
22+
depends_on "pkgconf" => :build
2323
depends_on "rust" => :build
2424
depends_on xcode: ["15.0", :build] # v8 12.9+ uses linker flags introduced in xcode 15
25+
depends_on "little-cms2"
2526
depends_on "sqlite" # needs `sqlite3_unlock_notify`
2627

2728
uses_from_macos "python" => :build, since: :catalina
2829
uses_from_macos "libffi"
29-
uses_from_macos "xz"
30+
uses_from_macos "zlib"
3031

3132
on_linux do
32-
depends_on "pkgconf" => :build
33-
depends_on "glib"
34-
end
35-
36-
# Temporary resources to work around build failure due to files missing from crate
37-
# We use the crate as GitHub tarball lacks submodules and this allows us to avoid git overhead.
38-
# TODO: Remove this and `v8` resource when https://github.com/denoland/rusty_v8/issues/1065 is resolved
39-
# VERSION=#{version} && curl -s https://raw.githubusercontent.com/denoland/deno/v$VERSION/Cargo.lock | grep -C 1 'name = "v8"'
40-
resource "rusty_v8" do
41-
url "https://static.crates.io/crates/v8/v8-134.5.0.crate"
42-
sha256 "21c7a224a7eaf3f98c1bad772fbaee56394dce185ef7b19a2e0ca5e3d274165d"
43-
end
44-
45-
# Find the v8 version from the last commit message at:
46-
# https://github.com/denoland/rusty_v8/commits/v#{rusty_v8_version}/v8
47-
# Then, use the corresponding tag found in https://github.com/denoland/v8/tags
48-
resource "v8" do
49-
url "https://github.com/denoland/v8/archive/refs/tags/13.4.114.11-denoland-060f4e2b72e373d63fc6.tar.gz"
50-
sha256 "13244bee611589ea607d92a7a59bcce0add58fbf7cec7379945c3af6855da07f"
51-
end
52-
53-
# VERSION=#{version} && curl -s https://raw.githubusercontent.com/denoland/deno/v$VERSION/Cargo.lock | grep -C 1 'name = "deno_core"'
54-
resource "deno_core" do
55-
url "https://github.com/denoland/deno_core/archive/refs/tags/0.340.0.tar.gz"
56-
sha256 "2137eecf512dfc74e252e693f958e282aae4fd4c564a3b754692f05c00662442"
57-
end
58-
59-
# The latest commit from `denoland/icu`, go to https://github.com/denoland/rusty_v8/tree/v#{rusty_v8_version}/third_party
60-
# and check the commit of the `icu` directory
61-
resource "icu" do
62-
url "https://chromium.googlesource.com/chromium/deps/icu.git",
63-
revision: "bbccc2f6efc1b825de5f2c903c48be685cd0cf22"
64-
end
65-
66-
# V8_TAG=#{v8_resource_tag} && curl -s https://raw.githubusercontent.com/denoland/v8/$V8_TAG/DEPS | grep gn_version
67-
resource "gn" do
68-
url "https://gn.googlesource.com/gn.git",
69-
revision: "ed1abc107815210dc66ec439542bee2f6cbabc00"
33+
depends_on "glib" => :build
34+
depends_on "pcre2" => :build
7035
end
7136

7237
def llvm
7338
Formula["llvm"]
7439
end
7540

7641
def install
77-
# Work around files missing from crate
78-
# TODO: Remove this at the same time as `rusty_v8` + `v8` resources
79-
resource("rusty_v8").stage buildpath/"../rusty_v8"
80-
resource("v8").stage do
81-
cp_r "tools/builtins-pgo", buildpath/"../rusty_v8/v8/tools/builtins-pgo"
82-
end
83-
resource("icu").stage do
84-
cp_r "common", buildpath/"../rusty_v8/third_party/icu/common"
85-
end
86-
87-
resource("deno_core").stage buildpath/"../deno_core"
88-
8942
# Avoid vendored dependencies.
90-
inreplace "Cargo.toml",
91-
/^libffi-sys = "(.+)"$/,
92-
'libffi-sys = { version = "\\1", features = ["system"] }'
93-
inreplace "Cargo.toml",
94-
/^rusqlite = { version = "(.+)", features = \["unlock_notify", "bundled", "session"\] }$/,
95-
'rusqlite = { version = "\\1", features = ["unlock_notify", "session"] }'
96-
97-
if OS.mac? && (MacOS.version < :mojave)
98-
# Overwrite Chromium minimum SDK version of 10.15
99-
ENV["FORCE_MAC_SDK_MIN"] = MacOS.version
43+
inreplace "Cargo.toml" do |s|
44+
s.gsub!(/^libffi-sys = "(.+)"$/,
45+
'libffi-sys = { version = "\\1", features = ["system"] }')
46+
s.gsub!(/^rusqlite = { version = "(.+)", features = \["unlock_notify", "bundled", "session"/,
47+
'rusqlite = { version = "\\1", features = ["unlock_notify", "session"')
10048
end
49+
inreplace "resolvers/npm_cache/Cargo.toml",
50+
'flate2 = { workspace = true, features = ["zlib-ng-compat"] }',
51+
"flate2 = { workspace = true }"
10152

102-
python3 = which("python3")
103-
# env args for building a release build with our python3, ninja and gn
104-
ENV["PYTHON"] = python3
105-
ENV["GN"] = buildpath/"gn/out/gn"
53+
ENV["LCMS2_LIB_DIR"] = Formula["little-cms2"].opt_lib
54+
# env args for building a release build with our python3 and ninja
55+
ENV["PYTHON"] = which("python3")
10656
ENV["NINJA"] = which("ninja")
10757
# build rusty_v8 from source
10858
ENV["V8_FROM_SOURCE"] = "1"
@@ -111,28 +61,15 @@ def install
11161

11262
# use our clang version, and disable lld because the build assumes the lld
11363
# supports features from newer clang versions (>=20)
114-
clang_version = llvm.version.major
115-
ENV["GN_ARGS"] = "clang_version=#{clang_version} use_lld=false"
116-
117-
# Work around an Xcode 15 linker issue which causes linkage against LLVM's
118-
# libunwind due to it being present in a library search path.
119-
ENV.remove "HOMEBREW_LIBRARY_PATHS", llvm.opt_lib
120-
121-
resource("gn").stage buildpath/"gn"
122-
cd "gn" do
123-
system python3, "build/gen.py"
124-
system "ninja", "-C", "out"
125-
end
126-
127-
# cargo seems to build rusty_v8 twice in parallel, which causes problems,
128-
# hence the need for ENV.deparallelize
129-
# Issue ref: https://github.com/denoland/deno/issues/9244
130-
ENV.deparallelize do
131-
system "cargo", "--config", ".cargo/local-build.toml",
132-
"install", "--no-default-features", "-vv",
133-
*std_cargo_args(path: "cli")
64+
ENV["GN_ARGS"] = "clang_version=#{llvm.version.major}"
65+
if OS.mac?
66+
ENV.append "GN_ARGS", "use_lld=false"
67+
else
68+
ENV.append "GN_ARGS", "use_lld=true"
69+
ENV.delete "RUSTFLAGS"
13470
end
13571

72+
system "cargo", "install", "--no-default-features", "-vv", *std_cargo_args(path: "cli")
13673
generate_completions_from_executable(bin/"deno", "completions")
13774
end
13875

0 commit comments

Comments
 (0)