Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node@20 20.8.1 (new formula) #152083

Merged
merged 6 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions Formula/n/node-sass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@ class NodeSass < Formula
url "https://registry.npmjs.org/sass/-/sass-1.69.4.tgz"
sha256 "ce91baadd5f9b0dda64ab97f76d34755ef20d37fbf5567ba0996b63bc4851579"
license "MIT"
revision 1

bottle do
sha256 cellar: :any_skip_relocation, arm64_sonoma: "9985861e06afa8993b7f9474c206b5c709f9ceae0589a7bae06c8ff89ad5a39c"
sha256 cellar: :any_skip_relocation, arm64_ventura: "9985861e06afa8993b7f9474c206b5c709f9ceae0589a7bae06c8ff89ad5a39c"
sha256 cellar: :any_skip_relocation, arm64_monterey: "9985861e06afa8993b7f9474c206b5c709f9ceae0589a7bae06c8ff89ad5a39c"
sha256 cellar: :any_skip_relocation, sonoma: "9985861e06afa8993b7f9474c206b5c709f9ceae0589a7bae06c8ff89ad5a39c"
sha256 cellar: :any_skip_relocation, ventura: "9985861e06afa8993b7f9474c206b5c709f9ceae0589a7bae06c8ff89ad5a39c"
sha256 cellar: :any_skip_relocation, monterey: "9985861e06afa8993b7f9474c206b5c709f9ceae0589a7bae06c8ff89ad5a39c"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6db7aa70660bcaeed2167b2c631f9f4ece1767256789ba54c5733a5c8cebf807"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "1a2399a1e01ec77fa937c782e3551c92db2fd3b2dff5698d3b915162af243ede"
sha256 cellar: :any_skip_relocation, arm64_ventura: "1a2399a1e01ec77fa937c782e3551c92db2fd3b2dff5698d3b915162af243ede"
sha256 cellar: :any_skip_relocation, arm64_monterey: "1a2399a1e01ec77fa937c782e3551c92db2fd3b2dff5698d3b915162af243ede"
sha256 cellar: :any_skip_relocation, sonoma: "1a2399a1e01ec77fa937c782e3551c92db2fd3b2dff5698d3b915162af243ede"
sha256 cellar: :any_skip_relocation, ventura: "1a2399a1e01ec77fa937c782e3551c92db2fd3b2dff5698d3b915162af243ede"
sha256 cellar: :any_skip_relocation, monterey: "1a2399a1e01ec77fa937c782e3551c92db2fd3b2dff5698d3b915162af243ede"
sha256 cellar: :any_skip_relocation, x86_64_linux: "1756c911227e6263e6e593fa25f63117d0181f4e40c147e236a5e32d519294ac"
end

depends_on "node"
depends_on "node@20"

def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end

test do
ENV.prepend_path "PATH", Formula["node@20"].bin

(testpath/"test.scss").write <<~EOS
div {
img {
Expand Down
154 changes: 154 additions & 0 deletions Formula/n/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
class NodeAT20 < Formula
desc "Platform built on V8 to build network applications"
homepage "https://nodejs.org/"
url "https://nodejs.org/dist/v20.8.1/node-v20.8.1.tar.xz"
sha256 "f799c66f6a6386bb8ac2c75a378f740c455e97f1fe964393dd39c9f9f6efbc70"
license "MIT"

livecheck do
url "https://nodejs.org/dist/"
regex(%r{href=["']?v?(20(?:\.\d+)+)/?["' >]}i)
end

bottle do
sha256 arm64_sonoma: "90457fea276a285c7c50facc1a4c3bcf1185c450c3d101bc07bd318a53a98e1c"
sha256 arm64_ventura: "fc31441cb84987270d3ea897ecbc3edab6f3826e44d7b10d7b2d9f80713134e0"
sha256 arm64_monterey: "c840e438adf6475d01721b3805aa065ce88c20845cc7315efc6473f6f91d7869"
sha256 sonoma: "5fb752db4c331ba4278f64c6ebbe695d34f62a11930cd62b506fd74ff7e55d85"
sha256 ventura: "1c2c5b0c5b99275308781998875828f6aedb4539f031a490e9d7e9254f962568"
sha256 monterey: "0285b304cbe9feeb6e2bfc2a6a359b1bd3cde7ec83a7893583382e7a86c835fd"
sha256 x86_64_linux: "6025742b665ccc1ccf8cc14fa7f4ef00f86e05e88aba498805ff968aeba687fc"
end

keg_only :versioned_formula

# https://nodejs.org/en/about/releases/
# disable! date: "2026-04-30", because: :unsupported
deprecate! date: "2024-10-22", because: :unsupported

depends_on "pkg-config" => :build
depends_on "python-setuptools" => :build
depends_on "[email protected]" => :build
depends_on "brotli"
depends_on "c-ares"
depends_on "icu4c"
depends_on "libnghttp2"
depends_on "libuv"
depends_on "openssl@3"

uses_from_macos "python", since: :catalina
uses_from_macos "zlib"

on_macos do
depends_on "llvm" => [:build, :test] if DevelopmentTools.clang_build_version <= 1100
end

fails_with :clang do
build 1100
cause <<~EOS
error: calling a private constructor of class 'v8::internal::(anonymous namespace)::RegExpParserImpl<uint8_t>'
EOS
end

fails_with gcc: "5"

# Support Python 3.12
patch :DATA

def install
ENV.llvm_clang if OS.mac? && (DevelopmentTools.clang_build_version <= 1100)

# The new linker crashed during LTO due to high memory usage.
ENV.append "LDFLAGS", "-Wl,-ld_classic" if DevelopmentTools.clang_build_version >= 1500

# make sure subprocesses spawned by make are using our Python 3
ENV["PYTHON"] = which("python3.12")

args = %W[
--prefix=#{prefix}
--with-intl=system-icu
--shared-libuv
--shared-nghttp2
--shared-openssl
--shared-zlib
--shared-brotli
--shared-cares
--shared-libuv-includes=#{Formula["libuv"].include}
--shared-libuv-libpath=#{Formula["libuv"].lib}
--shared-nghttp2-includes=#{Formula["libnghttp2"].include}
--shared-nghttp2-libpath=#{Formula["libnghttp2"].lib}
--shared-openssl-includes=#{Formula["openssl@3"].include}
--shared-openssl-libpath=#{Formula["openssl@3"].lib}
--shared-brotli-includes=#{Formula["brotli"].include}
--shared-brotli-libpath=#{Formula["brotli"].lib}
--shared-cares-includes=#{Formula["c-ares"].include}
--shared-cares-libpath=#{Formula["c-ares"].lib}
--openssl-use-def-ca-store
]

# Enabling LTO errors on Linux with:
# terminate called after throwing an instance of 'std::out_of_range'
# Pre-Catalina macOS also can't build with LTO
# LTO is unpleasant if you have to build from source.
args << "--enable-lto" if MacOS.version >= :catalina && build.bottle?

system "./configure", *args
system "make", "install"
end

def post_install
(lib/"node_modules/npm/npmrc").atomic_write("prefix = #{HOMEBREW_PREFIX}\n")
end

test do
# Make sure Mojave does not have `CC=llvm_clang`.
ENV.clang if OS.mac?

path = testpath/"test.js"
path.write "console.log('hello');"

output = shell_output("#{bin}/node #{path}").strip
assert_equal "hello", output
output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"en-EN\").format(1234.56))'").strip
assert_equal "1,234.56", output

output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"de-DE\").format(1234.56))'").strip
assert_equal "1.234,56", output

# make sure npm can find node
ENV.prepend_path "PATH", opt_bin
ENV.delete "NVM_NODEJS_ORG_MIRROR"
assert_equal which("node"), opt_bin/"node"
assert_predicate bin/"npm", :exist?, "npm must exist"
assert_predicate bin/"npm", :executable?, "npm must be executable"
npm_args = ["-ddd", "--cache=#{HOMEBREW_CACHE}/npm_cache", "--build-from-source"]
system bin/"npm", *npm_args, "install", "npm@latest"
system bin/"npm", *npm_args, "install", "ref-napi" unless head?
assert_predicate bin/"npx", :exist?, "npx must exist"
assert_predicate bin/"npx", :executable?, "npx must be executable"
assert_match "< hello >", shell_output("#{bin}/npx --yes cowsay hello")
end
end

__END__
diff --git a/configure b/configure
index fefb313c..711a3014 100755
--- a/configure
+++ b/configure
@@ -4,6 +4,7 @@
# Note that the mix of single and double quotes is intentional,
# as is the fact that the ] goes on a new line.
_=[ 'exec' '/bin/sh' '-c' '''
+command -v python3.12 >/dev/null && exec python3.12 "$0" "$@"
command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
@@ -23,7 +24,7 @@ except ImportError:
from distutils.spawn import find_executable as which

print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
-acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+acceptable_pythons = ((3, 12), (3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
if sys.version_info[:2] in acceptable_pythons:
import configure
else:
19 changes: 11 additions & 8 deletions Formula/q/quicktype.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@ class Quicktype < Formula
url "https://registry.npmjs.org/quicktype/-/quicktype-23.0.76.tgz"
sha256 "00cbdb63d80196669ae7fddfa17a1ad39a69db32566a92d558ea92ff6d16b821"
license "Apache-2.0"
revision 1
head "https://github.com/quicktype/quicktype.git", branch: "master"

bottle do
sha256 cellar: :any_skip_relocation, arm64_sonoma: "2e16bf0a4bef00d435af28ee4172b3e4b84289684e69e39946c2186aab6eb959"
sha256 cellar: :any_skip_relocation, arm64_ventura: "2e16bf0a4bef00d435af28ee4172b3e4b84289684e69e39946c2186aab6eb959"
sha256 cellar: :any_skip_relocation, arm64_monterey: "2e16bf0a4bef00d435af28ee4172b3e4b84289684e69e39946c2186aab6eb959"
sha256 cellar: :any_skip_relocation, sonoma: "96e7edb41408254c774ffb3ae3725b8cbdc6c256d1752febebc53afbb1548ac2"
sha256 cellar: :any_skip_relocation, ventura: "96e7edb41408254c774ffb3ae3725b8cbdc6c256d1752febebc53afbb1548ac2"
sha256 cellar: :any_skip_relocation, monterey: "96e7edb41408254c774ffb3ae3725b8cbdc6c256d1752febebc53afbb1548ac2"
sha256 cellar: :any_skip_relocation, x86_64_linux: "2e16bf0a4bef00d435af28ee4172b3e4b84289684e69e39946c2186aab6eb959"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "e00c9f9da34e799fc9a850a3871a9b746f7ef546bade2131d1a7b2c1d601560b"
sha256 cellar: :any_skip_relocation, arm64_ventura: "e00c9f9da34e799fc9a850a3871a9b746f7ef546bade2131d1a7b2c1d601560b"
sha256 cellar: :any_skip_relocation, arm64_monterey: "e00c9f9da34e799fc9a850a3871a9b746f7ef546bade2131d1a7b2c1d601560b"
sha256 cellar: :any_skip_relocation, sonoma: "ff77eabb6fdb07d6caf308e851fbb48ddddd88615efa4d48ce02c818bc8c88c8"
sha256 cellar: :any_skip_relocation, ventura: "ff77eabb6fdb07d6caf308e851fbb48ddddd88615efa4d48ce02c818bc8c88c8"
sha256 cellar: :any_skip_relocation, monterey: "ff77eabb6fdb07d6caf308e851fbb48ddddd88615efa4d48ce02c818bc8c88c8"
sha256 cellar: :any_skip_relocation, x86_64_linux: "e00c9f9da34e799fc9a850a3871a9b746f7ef546bade2131d1a7b2c1d601560b"
end

depends_on "node"
depends_on "node@20"

def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end

test do
ENV.prepend_path "PATH", Formula["node@20"].bin

(testpath/"sample.json").write <<~EOS
{
"i": [0, 1],
Expand Down
Loading