40 lines
1.4 KiB
Ruby
40 lines
1.4 KiB
Ruby
class Lz4 < Formula
|
|
bottle do
|
|
root_url "https://homebrew.hyprnet/bottles"
|
|
rebuild 1
|
|
sha256 cellar: :any, arm64_sequoia: "5bd143b7b784989e549637ea4e484af85ba481e640dde69bc35f3843ae25abc6"
|
|
sha256 cellar: :any, arm64_tahoe: "caf14ac1b6c922611db94615341ed6dc97f5601664280bc1d397e10f62e37222"
|
|
sha256 cellar: :any, sequoia: "f75cb29a4d25d37e1db38d95c5970cc45de7ec63ce43cfa881a877b424154a42"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "a8082c2e40dc6d63850f43ea8fa095e55adf18fb0f25ec66bcaee2c4b4438205"
|
|
end
|
|
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
|
|
|
|
|
|
|
|
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"
|
|
compressed = pipe_output(bin/"lz4", input)
|
|
refute_empty compressed
|
|
decompressed = pipe_output("#{bin}/lz4 -d", compressed)
|
|
assert_equal decompressed, input
|
|
end
|
|
end
|