homebrew-core/Formula/mupdf.rb

40 lines
1.3 KiB
Ruby

class Mupdf < Formula
desc "Lightweight PDF and XPS viewer"
homepage "https://mupdf.com/"
url "https://mupdf.com/downloads/archive/mupdf-1.17.0-source.tar.xz"
sha256 "c935fb2593d9a28d9b56b59dad6e3b0716a6790f8a257a68fa7dcb4430bc6086"
license "AGPL-3.0"
head "https://git.ghostscript.com/mupdf.git"
bottle do
cellar :any_skip_relocation
sha256 "473cb909d61450baa808fab50f18342811665f4e9e31f26a21e03f6bc5e70363" => :catalina
sha256 "abe79a517f7debadd94a67d3c7130c017ec8b985f381f0af7c9d08c75df13501" => :mojave
sha256 "e12021a10707afc92cea6d8a7633ee2a8d0f89359bb2f166c6e53d89e411f0f3" => :high_sierra
end
depends_on :x11
conflicts_with "mupdf-tools",
because: "mupdf and mupdf-tools install the same binaries"
def install
# Work around Xcode 11 clang bug
ENV.append_to_cflags "-fno-stack-check" if DevelopmentTools.clang_build_version >= 1010
system "make", "install",
"build=release",
"verbose=yes",
"CC=#{ENV.cc}",
"prefix=#{prefix}"
# Symlink `mutool` as `mudraw` (a popular shortcut for `mutool draw`).
bin.install_symlink bin/"mutool" => "mudraw"
man1.install_symlink man1/"mutool.1" => "mudraw.1"
end
test do
assert_match "Homebrew test", shell_output("#{bin}/mudraw -F txt #{test_fixtures("test.pdf")}")
end
end