91 lines
2.6 KiB
Ruby
91 lines
2.6 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.02.0.tar.xz"
|
|
sha256 "5c14759c99891e6e472aced6d5f0ff1dacf85d80cd9026d365c55c653edf792c"
|
|
license "GPL-2.0-only"
|
|
revision 1
|
|
head "https://gitlab.freedesktop.org/poppler/poppler.git"
|
|
|
|
livecheck do
|
|
url :homepage
|
|
regex(/href=.*?poppler[._-]v?(\d+(?:\.\d+)*)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "0e578c37aa3b42d81b080004130978b892f823ae92c1239a7f60a24c3ebd3571"
|
|
sha256 big_sur: "8436b17525a00400cb9152219e66b4331af9f7d91ed4c21aadfc0398466c7456"
|
|
sha256 catalina: "55cc2ef2fd45d91cee4158b9077e58ef4971c0aafef37e90725ea5c8d1d55b6c"
|
|
sha256 mojave: "cae1116097c9080e62e195f972746c09fa1f4a3e49232ea96a3bf0930a229b67"
|
|
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.10.tar.gz"
|
|
sha256 "6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30"
|
|
end
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
args = std_cmake_args + %w[
|
|
-DBUILD_GTK_TESTS=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
|
|
|
|
libpoppler = (lib/"libpoppler.dylib").readlink
|
|
[
|
|
"#{lib}/libpoppler-cpp.dylib",
|
|
"#{lib}/libpoppler-glib.dylib",
|
|
"#{lib}/libpoppler-qt6.dylib",
|
|
*Dir["#{bin}/*"],
|
|
].each do |f|
|
|
macho = MachO.open(f)
|
|
macho.change_dylib("@rpath/#{libpoppler}", "#{opt_lib}/#{libpoppler}")
|
|
macho.write!
|
|
end
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/pdfinfo", test_fixtures("test.pdf")
|
|
end
|
|
end
|