From be651d2acaedc346c4da9e734832bf9c635a09db Mon Sep 17 00:00:00 2001 From: Adrian Ho Date: Thu, 5 Sep 2024 00:24:40 +0800 Subject: [PATCH] lz4: update 1.10.0 bottle. --- Formula/l/lz4.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Formula/l/lz4.rb diff --git a/Formula/l/lz4.rb b/Formula/l/lz4.rb new file mode 100644 index 00000000000..e704b626f6c --- /dev/null +++ b/Formula/l/lz4.rb @@ -0,0 +1,35 @@ +class Lz4 < Formula + desc "Extremely Fast Compression algorithm" + homepage "https://lz4.github.io/lz4/" + url "https://github.com/lz4/lz4/archive/refs/tags/v1.10.0.tar.gz" + mirror "http://fresh-center.net/linux/misc/lz4-1.10.0.tar.gz" + mirror "http://fresh-center.net/linux/misc/legacy/lz4-1.10.0.tar.gz" + sha256 "537512904744b35e232912055ccf8ec66d768639ff3abe5788d90d792ec5f48b" + license "BSD-2-Clause" + head "https://github.com/lz4/lz4.git", branch: "dev" + + livecheck do + url :stable + strategy :github_latest + end + + bottle do + root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/lz4-1.10.0" + sha256 cellar: :any_skip_relocation, aarch64_linux: "fa354479718dd907fb13a2f8a47d7ad6d3ba669891f953948e50585adebca6c8" + end + + def install + system "make", "install", "PREFIX=#{prefix}" + # Prevent dependents from hardcoding Cellar paths. + inreplace lib/"pkgconfig/liblz4.pc", prefix, opt_prefix + end + + test do + input = "testing compression and decompression" + input_file = testpath/"in" + input_file.write input + output_file = testpath/"out" + system "sh", "-c", "cat #{input_file} | #{bin}/lz4 | #{bin}/lz4 -d > #{output_file}" + assert_equal output_file.read, input + end +end