Skip to content

Commit 5bcaf91

Browse files
committed
bun 1.3.0 (new formula)
Signed-off-by: botantony <[email protected]>
1 parent df06572 commit 5bcaf91

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

Formula/b/bun.rb

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
class Bun < Formula
2+
desc "Incredibly fast JavaScript runtime, bundler, test runner, and package manager"
3+
homepage "https://bun.com"
4+
url "https://github.com/oven-sh/bun.git",
5+
tag: "bun-v1.3.0",
6+
revision: "b0a6feca57bf5c2a9ec2ef9773499cab7d904b30"
7+
license all_of: [
8+
"MIT", # Bun itself and most of the dependencies
9+
"Apache-2.0", # boringssl, simdutf, uSockets, and others
10+
"BSD-3-Clause", # boringssl, lol-html
11+
"BSD-2-Clause", # libbase64
12+
"Zlib", # zlib
13+
]
14+
head "https://github.com/oven-sh/bun.git", branch: "main"
15+
16+
depends_on "automake" => :build
17+
depends_on "ccache" => :build
18+
depends_on "cmake" => :build
19+
depends_on "coreutils" => :build
20+
depends_on "gnu-sed" => :build
21+
depends_on "go" => :build
22+
depends_on "icu4c@77" => :build
23+
depends_on "libtool" => :build
24+
depends_on "llvm@19" => :build
25+
depends_on "ninja" => :build
26+
depends_on "pkgconf" => :build
27+
depends_on "ruby" => :build
28+
depends_on "rust" => :build
29+
30+
on_macos do
31+
depends_on "libiconv" => :build
32+
end
33+
34+
# Update the resource only if build fails
35+
resource "bun-bootstrap" do
36+
on_macos do
37+
on_arm do
38+
url "https://github.com/oven-sh/bun/releases/download/bun-v1.3.0/bun-darwin-aarch64.zip"
39+
sha256 "85848e3f96481efcabe75a500fd3b94b9bb95686ab7ad0a3892976c7be15036a"
40+
end
41+
on_intel do
42+
url "https://github.com/oven-sh/bun/releases/download/bun-v1.3.0/bun-darwin-x64.zip"
43+
sha256 "09d54af86ec45354bb63ff7ccc3ce9520d74f4e45f9f7cac8ceb7fac422fcc19"
44+
end
45+
end
46+
on_linux do
47+
on_arm do
48+
url "https://github.com/oven-sh/bun/releases/download/bun-v1.3.0/bun-linux-aarch64.zip"
49+
sha256 "68b7dcd86a35e7d5e156b37e4cef4b4ab6d6b37fd2179570c0e815f13890febd"
50+
end
51+
on_intel do
52+
url "https://github.com/oven-sh/bun/releases/download/bun-v1.3.0/bun-linux-x64.zip"
53+
sha256 "60c39d92b8bd090627524c98b3012f0c08dc89024cfdaa7c9c98cb5fd4359376"
54+
end
55+
end
56+
end
57+
58+
def install
59+
ENV.llvm_clang
60+
61+
resource("bun-bootstrap").stage buildpath/"bootstrap"
62+
ENV.prepend_path "PATH", buildpath/"bootstrap"
63+
64+
system "bun", "run", "build:release"
65+
bin.install "build/release/bun"
66+
bin.install_symlink bin/"bun" => "bunx"
67+
68+
bash_completion.install "completions/bun.bash" => "bun"
69+
zsh_completion.install "completions/bun.zsh" => "_bun"
70+
fish_completion.install "completions/bun.fish"
71+
end
72+
73+
test do
74+
assert_match version.to_s, shell_output("#{bin}/bun --version")
75+
76+
system bin/"bun", "init", "--yes"
77+
assert_path_exists "bun.lock"
78+
79+
(testpath/"test.ts").write <<~TYPESCRIPT
80+
console.log("Hello world!");
81+
TYPESCRIPT
82+
83+
assert_equal "Hello world!", shell_output("#{bin}/bun run test.ts").chomp
84+
assert_match "Hello world!", shell_output("#{bin}/bunx cowsay 'Hello world!'")
85+
end
86+
end

style_exceptions/binary_bootstrap_formula_urls_allowlist.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[
2+
"bun",
23
"cabal-install",
34
"clozure-cl",
45
"crystal",

0 commit comments

Comments
 (0)