93 lines
2.7 KiB
Ruby
93 lines
2.7 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-21.09.0.tar.xz"
|
|
sha256 "5a47fef738c2b99471f9b459a8bf8b40aefb7eed92caa4861c3798b2e126d05b"
|
|
license "GPL-2.0-only"
|
|
head "https://gitlab.freedesktop.org/poppler/poppler.git", branch: "master"
|
|
|
|
livecheck do
|
|
url :homepage
|
|
regex(/href=.*?poppler[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "1dd6f10a72ad0f63afef4f7d408446a173a8c7a305a419a11e80c6495c6f17bd"
|
|
sha256 big_sur: "ac1bbd7709dd6cccbfced46079c03a775c3981b467ee087255fb9f8f1fce4ec0"
|
|
sha256 catalina: "831a96471fe69af4d86767d162c24c6cb43184229bbe5915105970f9f2b9c6a6"
|
|
sha256 mojave: "0366441466951432fb7ccebb1cf4a213f858b7ccee3743ad5b05dbe822f43319"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "cairo"
|
|
depends_on "fontconfig"
|
|
depends_on "freetype"
|
|
depends_on "gettext"
|
|
depends_on "glib"
|
|
depends_on "jpeg"
|
|
depends_on "libpng"
|
|
depends_on "libtiff"
|
|
depends_on "little-cms2"
|
|
depends_on "nss"
|
|
depends_on "openjpeg"
|
|
depends_on "qt"
|
|
|
|
uses_from_macos "gperf" => :build
|
|
uses_from_macos "curl"
|
|
|
|
conflicts_with "pdftohtml", "pdf2image", "xpdf",
|
|
because: "poppler, pdftohtml, pdf2image, and xpdf install conflicting executables"
|
|
|
|
resource "font-data" do
|
|
url "https://poppler.freedesktop.org/poppler-data-0.4.11.tar.gz"
|
|
sha256 "2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb3069bb0874825f08c"
|
|
end
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
args = std_cmake_args + %w[
|
|
-DBUILD_GTK_TESTS=OFF
|
|
-DENABLE_BOOST=OFF
|
|
-DENABLE_CMS=lcms2
|
|
-DENABLE_GLIB=ON
|
|
-DENABLE_QT5=OFF
|
|
-DENABLE_QT6=ON
|
|
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON
|
|
-DWITH_GObjectIntrospection=ON
|
|
]
|
|
|
|
system "cmake", ".", *args
|
|
system "make", "install"
|
|
system "make", "clean"
|
|
system "cmake", ".", "-DBUILD_SHARED_LIBS=OFF", *args
|
|
system "make"
|
|
lib.install "libpoppler.a"
|
|
lib.install "cpp/libpoppler-cpp.a"
|
|
lib.install "glib/libpoppler-glib.a"
|
|
resource("font-data").stage do
|
|
system "make", "install", "prefix=#{prefix}"
|
|
end
|
|
|
|
if OS.mac?
|
|
libpoppler = (lib/"libpoppler.dylib").readlink
|
|
[
|
|
"#{lib}/libpoppler-cpp.dylib",
|
|
"#{lib}/libpoppler-glib.dylib",
|
|
"#{lib}/libpoppler-qt#{Formula["qt"].version.major}.dylib",
|
|
*Dir["#{bin}/*"],
|
|
].each do |f|
|
|
macho = MachO.open(f)
|
|
macho.change_dylib("@rpath/#{libpoppler}", "#{opt_lib}/#{libpoppler}")
|
|
macho.write!
|
|
end
|
|
end
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/pdfinfo", test_fixtures("test.pdf")
|
|
end
|
|
end
|