From 8944dd3987e472fff5094487f5403e01bbb2643b Mon Sep 17 00:00:00 2001 From: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> Date: Tue, 7 Jan 2025 08:58:50 -0800 Subject: [PATCH] [libmupdf] Update to 1.25.2 and fix build error C2099 (#43078) --- ports/libmupdf/fix-NAN-on-Win11.patch | 22 ++++++++++++++++++++++ ports/libmupdf/portfile.cmake | 3 ++- ports/libmupdf/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/l-/libmupdf.json | 5 +++++ 5 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 ports/libmupdf/fix-NAN-on-Win11.patch diff --git a/ports/libmupdf/fix-NAN-on-Win11.patch b/ports/libmupdf/fix-NAN-on-Win11.patch new file mode 100644 index 0000000000..399aee25d7 --- /dev/null +++ b/ports/libmupdf/fix-NAN-on-Win11.patch @@ -0,0 +1,22 @@ +diff --git a/source/fitz/geometry.c b/source/fitz/geometry.c +index 473d1dc..b02ab39 100644 +--- a/source/fitz/geometry.c ++++ b/source/fitz/geometry.c +@@ -29,6 +29,8 @@ + #define MAX4(a,b,c,d) fz_max(fz_max(a,b), fz_max(c,d)) + #define MIN4(a,b,c,d) fz_min(fz_min(a,b), fz_min(c,d)) + ++#define MY_NAN (0.0 / 0.0) ++ + /* A useful macro to add with overflow detection and clamping. + + We want to do "b = a + x", but to allow for overflow. Consider the +@@ -388,7 +390,7 @@ const fz_irect fz_invalid_irect = { 0, 0, -1, -1 }; + const fz_irect fz_unit_bbox = { 0, 0, 1, 1 }; + + const fz_quad fz_infinite_quad = { { -INFINITY, INFINITY}, {INFINITY, INFINITY}, {-INFINITY, -INFINITY}, {INFINITY, -INFINITY} }; +-const fz_quad fz_invalid_quad = { {NAN, NAN}, {NAN, NAN}, {NAN, NAN}, {NAN, NAN} }; ++const fz_quad fz_invalid_quad = { {MY_NAN, MY_NAN}, {MY_NAN, MY_NAN}, {MY_NAN, MY_NAN}, {MY_NAN, MY_NAN} }; + + fz_irect + fz_irect_from_rect(fz_rect r) diff --git a/ports/libmupdf/portfile.cmake b/ports/libmupdf/portfile.cmake index 7f853711ee..fd5d31a8a9 100644 --- a/ports/libmupdf/portfile.cmake +++ b/ports/libmupdf/portfile.cmake @@ -4,10 +4,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ArtifexSoftware/mupdf REF "${VERSION}" - SHA512 d8b6d643b12c9cdf91bf292c8d43a0086eb614a87344d12bbac04e74fc5a333dc699cd37c7715e73f2bee00a233e9b80a1942b879a51275aa865aa12c6fa6b0d + SHA512 6d053b140a34061fcf5eb30f23f87e51dd8e80be29a3e505c42312c11198491102a79c2ca290f13971d25b9a286354ad44bd825593c076373c18f58bbc7b950e HEAD_REF master PATCHES dont-generate-extract-3rd-party-things.patch + fix-NAN-on-Win11.patch # https://github.com/ArtifexSoftware/mupdf/pull/54 ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") diff --git a/ports/libmupdf/vcpkg.json b/ports/libmupdf/vcpkg.json index df7b99e798..236631d9f7 100644 --- a/ports/libmupdf/vcpkg.json +++ b/ports/libmupdf/vcpkg.json @@ -1,6 +1,6 @@ { "name": "libmupdf", - "version": "1.24.11", + "version": "1.25.2", "description": "a lightweight PDF, XPS, and E-book library", "homepage": "https://github.com/ArtifexSoftware/mupdf", "license": "AGPL-3.0-only", diff --git a/versions/baseline.json b/versions/baseline.json index 00340f27fa..7b031afe8d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4861,7 +4861,7 @@ "port-version": 0 }, "libmupdf": { - "baseline": "1.24.11", + "baseline": "1.25.2", "port-version": 0 }, "libmysofa": { diff --git a/versions/l-/libmupdf.json b/versions/l-/libmupdf.json index b4a9642ac1..0fc52213d0 100644 --- a/versions/l-/libmupdf.json +++ b/versions/l-/libmupdf.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "defca87fb5e4293272118094c10f9825a924e84e", + "version": "1.25.2", + "port-version": 0 + }, { "git-tree": "f76ab7716730acd4fdfdc16d23a19099fed8bc2a", "version": "1.24.11",