Skip to content

Commit

Permalink
poppler: add 23.01.0 bottle.
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgit committed Jan 19, 2023
1 parent 3993e56 commit 072fe89
Showing 1 changed file with 23 additions and 40 deletions.
63 changes: 23 additions & 40 deletions Formula/poppler.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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-22.05.0.tar.xz"
sha256 "a969ced458e050d6202367bd7427054e2bd19bae39e8f969910d3b9151abf958"
url "https://poppler.freedesktop.org/poppler-23.01.0.tar.xz"
sha256 "fae9b88d3d5033117d38477b79220cfd0d8e252c278ec870ab1832501741fd94"
license "GPL-2.0-only"
head "https://gitlab.freedesktop.org/poppler/poppler.git", branch: "master"

Expand All @@ -12,12 +12,8 @@ class Poppler < Formula
end

bottle do
sha256 arm64_monterey: "6a9a03ef00b96147cb7dd8f1d55d318ac98577255d21b24b3556514426372127"
sha256 arm64_big_sur: "580dc54efe7f80a7696c3d5a52b3435b6b909d1d34eb334e68fe8d9af7d8a179"
sha256 monterey: "347cea91f23b1c28233e33b891de63326627f20f4b6e2c451f67e7fe11ab7d81"
sha256 big_sur: "c2c904b91a1a56af30804ab486371693daabe5d32d0b82a4e916ac1d551e28ac"
sha256 catalina: "5bb6da938581b58c4c396a988c1cce2c7b0d21196889bf81fc614c36670706f0"
sha256 x86_64_linux: "34b88907d8a4ec05ae6f5a1935593aa605850d3cddce4e9405348bf77c1fd22a"
root_url "https://github.com/gromgit/homebrew-core-aarch64_linux/releases/download/poppler"
sha256 cellar: :any_skip_relocation, aarch64_linux: "bfba67c9e5fb239557adce9876f783f555a741990b60ff24a7e4c975fed1537b"
end

depends_on "cmake" => :build
Expand All @@ -28,23 +24,18 @@ class Poppler < Formula
depends_on "freetype"
depends_on "gettext"
depends_on "glib"
depends_on "jpeg"
depends_on "jpeg-turbo"
depends_on "libpng"
depends_on "libtiff"
depends_on "little-cms2"
depends_on "nspr"
depends_on "nss"
depends_on "openjpeg"
depends_on "qt"

uses_from_macos "gperf" => :build
uses_from_macos "curl"
uses_from_macos "curl", since: :catalina # 7.55.0 required by poppler
uses_from_macos "zlib"

on_linux do
depends_on "gcc"
end

conflicts_with "pdftohtml", "pdf2image", "xpdf",
because: "poppler, pdftohtml, pdf2image, and xpdf install conflicting executables"

Expand All @@ -58,45 +49,37 @@ class Poppler < Formula
def install
ENV.cxx11

args = std_cmake_args + %w[
# removes /usr/include from CFLAGS (not clear why)
ENV["PKG_CONFIG_SYSTEM_INCLUDE_PATH"] = "/usr/include" if MacOS.version < :mojave

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_QT6=OFF
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON
-DWITH_GObjectIntrospection=ON
-DCMAKE_INSTALL_RPATH=#{rpath}
]

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"
system "cmake", "-S", ".", "-B", "build_shared", *args
system "cmake", "--build", "build_shared"
system "cmake", "--install", "build_shared"

system "cmake", "-S", ".", "-B", "build_static", *args, "-DBUILD_SHARED_LIBS=OFF"
system "cmake", "--build", "build_static"
lib.install "build_static/libpoppler.a"
lib.install "build_static/cpp/libpoppler-cpp.a"
lib.install "build_static/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")
system bin/"pdfinfo", test_fixtures("test.pdf")
end
end

0 comments on commit 072fe89

Please sign in to comment.