From b90432a0c93802532074a89612429322bfa07ca9 Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Sat, 13 Jul 2024 09:17:08 -0700 Subject: [PATCH] esbuild: build from source --- Formula/e/esbuild.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Formula/e/esbuild.rb b/Formula/e/esbuild.rb index 7b7e9336e347..6c114a222fae 100644 --- a/Formula/e/esbuild.rb +++ b/Formula/e/esbuild.rb @@ -1,10 +1,8 @@ -require "language/node" - class Esbuild < Formula desc "Extremely fast JavaScript bundler and minifier" homepage "https://esbuild.github.io/" - url "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz" - sha256 "1ba7823555e8960f2f2fac0b6656840f8de88c2237c00cb666229a887dc81fa7" + url "https://github.com/evanw/esbuild/archive/refs/tags/v0.23.0.tar.gz" + sha256 "473d4d322ddc35f3620d37ecd5d6f40890f33923eeaafa96f5d87db9587e77af" license "MIT" bottle do @@ -17,11 +15,12 @@ class Esbuild < Formula sha256 cellar: :any_skip_relocation, x86_64_linux: "cf5ea30dc768145e289400d5e95ef9cfd467641b9ce06781334cda6360d59969" end - depends_on "node" + depends_on "go" => :build + depends_on "node" => :test def install - system "npm", "install", *Language::Node.std_npm_install_args(libexec) - bin.install_symlink Dir["#{libexec}/bin/*"] + ENV["CGO_ENABLED"] = OS.mac? ? "1" : "0" + system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/esbuild" end test do