Files

46 lines
1.6 KiB
Ruby

class Xz < Formula
bottle do
root_url "https://homebrew.hyprnet/bottles"
sha256 cellar: :any, arm64_sequoia: "c4be907ac8459f8b3e764c06287cc88b79c1d5c16a2db1c0335e1facf4fd4dbe"
sha256 cellar: :any, arm64_tahoe: "55c891f5d47142fe923c87df0e3343d7ef2bc7d368c67892b4ad2c80e53069d5"
sha256 cellar: :any, sequoia: "be9bd234f1e9ec28b25cd8ce0850ea841751cd337dffd6f104432c57cdc32c78"
sha256 cellar: :any_skip_relocation, x86_64_linux: "61032fd340234974371a87c9908c998d9a52bebdf056b83e629ebf7aa038840f"
end
desc "General-purpose data compression with high compression ratio"
homepage "https://tukaani.org/xz/"
url "https://github.com/tukaani-project/xz/releases/download/v5.8.3/xz-5.8.3.tar.gz"
mirror "https://downloads.sourceforge.net/project/lzmautils/xz-5.8.3.tar.gz"
mirror "http://downloads.sourceforge.net/project/lzmautils/xz-5.8.3.tar.gz"
sha256 "3d3a1b973af218114f4f889bbaa2f4c037deaae0c8e815eec381c3d546b974a0"
license all_of: [
"0BSD",
"GPL-2.0-or-later",
]
version_scheme 1
compatibility_version 1
deny_network_access!
def install
system "./configure", "--disable-silent-rules", "--disable-nls", *std_configure_args
system "make", "check"
system "make", "install"
end
test do
path = testpath/"data.txt"
original_contents = "." * 1000
path.write original_contents
# compress: data.txt -> data.txt.xz
system bin/"xz", path
refute_path_exists path
# decompress: data.txt.xz -> data.txt
system bin/"xz", "-d", "#{path}.xz"
assert_equal original_contents, path.read
end
end