|
1 | 1 | class Podofo < Formula |
2 | 2 | desc "Library to work with the PDF file format" |
3 | 3 | homepage "https://github.com/podofo/podofo" |
4 | | - url "https://github.com/podofo/podofo/archive/refs/tags/0.10.4.tar.gz" |
5 | | - sha256 "6b1b13cdfb2ba5e8bbc549df507023dd4873bc946211bc6942183b8496986904" |
| 4 | + url "https://github.com/podofo/podofo/archive/refs/tags/1.0.0.tar.gz" |
| 5 | + sha256 "e44276d927838034b51c4c79001e7ae5c3fef90b6844824004c77f160c1a22ea" |
6 | 6 | license all_of: ["LGPL-2.0-only", "GPL-2.0-only"] |
7 | 7 | head "https://github.com/podofo/podofo.git", branch: "master" |
8 | 8 |
|
@@ -35,15 +35,28 @@ class Podofo < Formula |
35 | 35 | uses_from_macos "libxml2" |
36 | 36 | uses_from_macos "zlib" |
37 | 37 |
|
| 38 | + on_ventura :or_older do |
| 39 | + depends_on "llvm" |
| 40 | + |
| 41 | + fails_with :clang do |
| 42 | + cause "error: 'to_chars' is unavailable: introduced in macOS 13.3" |
| 43 | + end |
| 44 | + end |
| 45 | + |
38 | 46 | def install |
| 47 | + if OS.mac? && MacOS.version <= :ventura |
| 48 | + ENV.llvm_clang |
| 49 | + # When using Homebrew's superenv shims, we need to use HOMEBREW_LIBRARY_PATHS |
| 50 | + # rather than LDFLAGS for libc++ in order to correctly link to LLVM's libc++. |
| 51 | + ENV.prepend_path "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib/"c++" |
| 52 | + # Workaround for error: call to 'from_chars' is ambiguous |
| 53 | + inreplace "src/podofo/private/charconv_compat.h", "#define WANT_FROM_CHARS", "" |
| 54 | + end |
| 55 | + |
39 | 56 | args = %W[ |
40 | 57 | -DCMAKE_INSTALL_NAME_DIR=#{opt_lib} |
41 | 58 | -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON |
42 | | - -DCMAKE_DISABLE_FIND_PACKAGE_CppUnit=ON |
43 | | - -DCMAKE_DISABLE_FIND_PACKAGE_LUA=ON |
44 | | - -DPODOFO_BUILD_TOOLS=TRUE |
45 | | - -DFREETYPE_INCLUDE_DIR_FT2BUILD=#{Formula["freetype"].opt_include}/freetype2 |
46 | | - -DFREETYPE_INCLUDE_DIR_FTHEADER=#{Formula["freetype"].opt_include}/freetype2/config/ |
| 59 | + -DPODOFO_BUILD_UNSUPPORTED_TOOLS=TRUE |
47 | 60 | ] |
48 | 61 | system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args |
49 | 62 | system "cmake", "--build", "build" |
|
0 commit comments