diff --git a/Formula/trino.rb b/Formula/trino.rb index 3a6fb1baeed8..55adf43f37bf 100644 --- a/Formula/trino.rb +++ b/Formula/trino.rb @@ -3,8 +3,8 @@ class Trino < Formula desc "Distributed SQL query engine for big data" homepage "https://trino.io" - url "https://search.maven.org/remotecontent?filepath=io/trino/trino-server/375/trino-server-375.tar.gz" - sha256 "293c1456f1cb4292890226cc092884ab85cd206e52704509e2e27a58d3b318b6" + url "https://search.maven.org/remotecontent?filepath=io/trino/trino-server/396/trino-server-396.tar.gz", using: :nounzip + sha256 "99bb7dce00178fa40cdf9f8f731c18b749637bf9fe32118870cad1de0febd2a1" license "Apache-2.0" livecheck do @@ -26,17 +26,21 @@ class Trino < Formula depends_on "python@3.10" resource "trino-src" do - url "https://github.com/trinodb/trino/archive/375.tar.gz", using: :nounzip - sha256 "bab8287f387931faa228b698a30886c084f2981c4313b8ebef4340c685c490c8" + url "https://github.com/trinodb/trino/archive/refs/tags/396.tar.gz", using: :nounzip + sha256 "9557a088f3878097feb8cf9ee3fc26c0565bdcfe898880107170b884054a4dba" end resource "trino-cli" do - url "https://search.maven.org/remotecontent?filepath=io/trino/trino-cli/375/trino-cli-375-executable.jar" - sha256 "0b96af66dca43353389be3c348f0472a9e709ace22c9a2a9689acb64b70beac1" + url "https://search.maven.org/remotecontent?filepath=io/trino/trino-cli/396/trino-cli-396-executable.jar" + sha256 "438347986c281a2cf419131ce999d6db1bb37488b141f68de62325e1cbbc927a" end def install - libexec.install Dir["*"] + # Manually extract tarball to avoid losing hardlinks which increases bottle + # size from MBs to GBs. Remove once Homebrew is able to preserve hardlinks. + # Ref: https://github.com/Homebrew/brew/pull/13154 + libexec.mkpath + system "tar", "-C", libexec.to_s, "--strip-components", "1", "-xzf", "trino-server-#{version}.tar.gz" # Manually untar, since macOS-bundled tar produces the error: # trino-363/plugin/trino-hive/src/test/resources/.snappy.orc.crc: Failed to restore metadata @@ -47,6 +51,7 @@ def install (libexec/"etc").install Dir["trino-#{r.version}/core/docker/default/etc/*"] inreplace libexec/"etc/node.properties", "docker", tap.user.downcase inreplace libexec/"etc/node.properties", "/data/trino", var/"trino/data" + inreplace libexec/"etc/jvm.config", %r{^-agentpath:/usr/lib/trino/bin/libjvmkill.so$\n}, "" end rewrite_shebang detected_python_shebang, libexec/"bin/launcher.py" @@ -59,6 +64,8 @@ def install # Remove incompatible pre-built binaries libprocname_dirs = libexec.glob("bin/procname/*") + # Keep the Linux-x86_64 directory to make bottles identical + libprocname_dirs.reject! { |dir| dir.basename.to_s == "Linux-x86_64" } if build.bottle? libprocname_dirs.reject! { |dir| dir.basename.to_s == "#{OS.kernel_name}-#{Hardware::CPU.arch}" } libprocname_dirs.map(&:rmtree) end