homebrew-core/Formula/wimlib.rb

53 lines
1.4 KiB
Ruby

class Wimlib < Formula
desc "Library to create, extract, and modify Windows Imaging files"
homepage "https://wimlib.net/"
url "https://wimlib.net/downloads/wimlib-1.13.2.tar.gz"
sha256 "7295be7ef00d265aef4090c9d26af82097db651c5f8399db9d44c60f47f5a945"
livecheck do
url "https://wimlib.net/downloads/"
regex(/href=.*?wimlib[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
cellar :any
sha256 "9b1f59782b773025346f9e466926467035c3e007f54acc77caa332b73a9308bf" => :catalina
sha256 "9c516e253677057ba243d2d0c30894df407c5d24a23d055d8b7152f6f3267991" => :mojave
sha256 "543e598241edae31ae469dd6da5ceaf10f1ef658ea051e1be0d5241393d167b6" => :high_sierra
end
depends_on "pkg-config" => :build
depends_on "openssl@1.1"
uses_from_macos "libxml2"
def install
# fuse requires librt, unavailable on OSX
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--without-fuse
--without-ntfs-3g
]
system "./configure", *args
system "make", "install"
end
test do
# make a directory containing a dummy 1M file
mkdir("foo")
system "dd", "if=/dev/random", "of=foo/bar", "bs=1m", "count=1"
# capture an image
ENV.append "WIMLIB_IMAGEX_USE_UTF8", "1"
system "#{bin}/wimcapture", "foo", "bar.wim"
assert_predicate testpath/"bar.wim", :exist?
# get info on the image
system "#{bin}/wiminfo", "bar.wim"
end
end