This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Sat, 26 Jun 2021 19:49:25 +0200
Subject: [PATCH 1/3] Fix static builds


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1111111..2222222 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,7 +88,7 @@ option(BUILD_SHARED_LIBS "Build poppler as a shared library" ON)
 option(RUN_GPERF_IF_PRESENT "Run gperf if it is found" ON)
 option(INSTALL_GLIB_DEMO "Whether to install the poppler-glib-demo program." OFF)
 if(WIN32)
-  option(ENABLE_RELOCATABLE "Do not hardcode the poppler library location (on Windows)." ON)
+  option(ENABLE_RELOCATABLE "Do not hardcode the poppler library location (on Windows)." ${BUILD_SHARED_LIBS})
 else()
   set(ENABLE_RELOCATABLE OFF)
 endif()

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Thu, 4 Feb 2021 20:44:30 +0100
Subject: [PATCH 2/3] Fix static linking for libopenjpeg >= 2.4


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1111111..2222222 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -328,6 +328,9 @@ else()
   message(FATAL_ERROR "Invalid ENABLE_LIBOPENJPEG value: ${ENABLE_LIBOPENJPEG}")
 endif()
 set(ENABLE_LIBOPENJPEG "${WITH_OPENJPEG}")
+if(ENABLE_LIBOPENJPEG AND NOT BUILD_SHARED_LIBS)
+  add_definitions(-DOPJ_STATIC)
+endif()
 
 find_soft_mandatory_package(ENABLE_LCMS LCMS2 ${LCMS2_REQUIRED_VERSION})
 set(USE_CMS ${ENABLE_LCMS})

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: brodieG <brodieG@users.noreply.github.com>
Date: Sat, 5 Nov 2022 14:08:43 +0000
Subject: [PATCH 3/3] Allow setting PC requires for C Lib

POPPLER_REQUIRES should be set through the .mk file, although
ideally this would all be done through the cmake files (and
even better POPPLER would be configured for EXPORT).

diff --git a/poppler.pc.cmake b/poppler.pc.cmake
index 1111111..2222222 100644
--- a/poppler.pc.cmake
+++ b/poppler.pc.cmake
@@ -7,6 +7,7 @@ Description: PDF rendering library
 Version: @POPPLER_VERSION@
 Requires.private: @PC_REQUIRES_PRIVATE@
 
+Requires.private: @POPPLER_REQUIRES@
 Libs: -L${libdir} -lpoppler
 Libs.private: @PC_LIBS_PRIVATE@
 Cflags: -I${includedir}/poppler
