78 lines
2.5 KiB
Ruby
78 lines
2.5 KiB
Ruby
class Poppler < Formula
|
|
desc "PDF rendering library (based on the xpdf-3.0 code base)"
|
|
homepage "https://poppler.freedesktop.org/"
|
|
url "https://poppler.freedesktop.org/poppler-0.47.0.tar.xz"
|
|
sha256 "b872e7228fc34a71ce4b47a5aea2a57ae67528818fa846e1e0eda089319bd242"
|
|
|
|
bottle do
|
|
sha256 "c9582daa17aa176cbe6369ef0de3f3d7afdc2247bc97d17779c8473748454b7e" => :sierra
|
|
sha256 "bac96fe4712def220072bbc9f7892342a7d00aa87c8cdfb1a3cf21971468fb26" => :el_capitan
|
|
sha256 "cd8f70a74efb13c54a7f95338d1cb469bb355cb3b6fae1cb059362089235232e" => :yosemite
|
|
sha256 "4cd7dfe4ad735d84b0a1ac17815772c02d26bf086e498122283c34844170c58f" => :mavericks
|
|
end
|
|
|
|
option "with-qt", "Build Qt backend"
|
|
option "with-qt5", "Build Qt5 backend"
|
|
option "with-little-cms2", "Use color management system"
|
|
|
|
deprecated_option "with-qt4" => "with-qt"
|
|
deprecated_option "with-lcms2" => "with-little-cms2"
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "cairo"
|
|
depends_on "fontconfig"
|
|
depends_on "freetype"
|
|
depends_on "gettext"
|
|
depends_on "glib"
|
|
depends_on "gobject-introspection"
|
|
depends_on "jpeg"
|
|
depends_on "libpng"
|
|
depends_on "libtiff"
|
|
depends_on "openjpeg"
|
|
depends_on "qt" => :optional
|
|
depends_on "qt5" => :optional
|
|
depends_on "little-cms2" => :optional
|
|
|
|
conflicts_with "pdftohtml", :because => "both install `pdftohtml` binaries"
|
|
|
|
resource "font-data" do
|
|
url "https://poppler.freedesktop.org/poppler-data-0.4.7.tar.gz"
|
|
sha256 "e752b0d88a7aba54574152143e7bf76436a7ef51977c55d6bd9a48dccde3a7de"
|
|
end
|
|
|
|
def install
|
|
ENV.cxx11 if MacOS.version < :mavericks
|
|
ENV["LIBOPENJPEG_CFLAGS"] = "-I#{Formula["openjpeg"].opt_include}/openjpeg-2.1"
|
|
|
|
args = %W[
|
|
--disable-dependency-tracking
|
|
--prefix=#{prefix}
|
|
--enable-xpdf-headers
|
|
--enable-poppler-glib
|
|
--disable-gtk-test
|
|
--enable-introspection=yes
|
|
]
|
|
|
|
if build.with?("qt") && build.with?("qt5")
|
|
raise "poppler: --with-qt and --with-qt5 cannot be used at the same time"
|
|
elsif build.with? "qt"
|
|
args << "--enable-poppler-qt4"
|
|
elsif build.with? "qt5"
|
|
args << "--enable-poppler-qt5"
|
|
else
|
|
args << "--disable-poppler-qt4" << "--disable-poppler-qt5"
|
|
end
|
|
|
|
args << "--enable-cms=lcms2" if build.with? "little-cms2"
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
resource("font-data").stage do
|
|
system "make", "install", "prefix=#{prefix}"
|
|
end
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/pdfinfo", test_fixtures("test.pdf")
|
|
end
|
|
end
|