From 764e8bc7fed9aec83b7b1e928ebe2aa607d978b2 Mon Sep 17 00:00:00 2001 From: Adrian Ho Date: Wed, 4 Sep 2024 23:45:09 +0800 Subject: [PATCH] brotli: update 1.1.0 bottle. --- Formula/b/brotli.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Formula/b/brotli.rb diff --git a/Formula/b/brotli.rb b/Formula/b/brotli.rb new file mode 100644 index 00000000000..f851f39040b --- /dev/null +++ b/Formula/b/brotli.rb @@ -0,0 +1,31 @@ +class Brotli < Formula + desc "Generic-purpose lossless compression algorithm by Google" + homepage "https://github.com/google/brotli" + url "https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz" + mirror "http://fresh-center.net/linux/misc/brotli-1.1.0.tar.gz" + mirror "http://fresh-center.net/linux/misc/legacy/brotli-1.1.0.tar.gz" + sha256 "e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff" + license "MIT" + head "https://github.com/google/brotli.git", branch: "master" + + bottle do + root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/brotli-1.1.0" + sha256 cellar: :any_skip_relocation, aarch64_linux: "7e709c134266c4a8d298f4e6922d6cad0eb3ff212867fc5cdf1a134a39053593" + end + + depends_on "cmake" => :build + + def install + system "cmake", ".", *std_cmake_args + system "make", "VERBOSE=1" + system "ctest", "-V" + system "make", "install" + end + + test do + (testpath/"file.txt").write("Hello, World!") + system bin/"brotli", "file.txt", "file.txt.br" + system bin/"brotli", "file.txt.br", "--output=out.txt", "--decompress" + assert_equal (testpath/"file.txt").read, (testpath/"out.txt").read + end +end