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
@@ -82,7 +82,7 @@ option(USE_FLOAT "Use single precision arithmetic in the Splash backend" OFF)
 option(BUILD_SHARED_LIBS "Build poppler as a shared library" ON)
 option(RUN_GPERF_IF_PRESENT "Run gperf if it is found" ON)
 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
@@ -308,6 +308,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()
 if(ENABLE_CMS STREQUAL "lcms2")
   find_package(LCMS2)
   set(USE_CMS ${LCMS2_FOUND})

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
@@ -6,5 +6,6 @@ Name: poppler
 Description: PDF rendering library
 Version: @POPPLER_VERSION@
 
+Requires.private: @POPPLER_REQUIRES@
 Libs: -L${libdir} -lpoppler
 Cflags: -I${includedir}/poppler
