1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
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: Sun, 5 Nov 2017 20:53:42 +0100
Subject: [PATCH 1/4] Only check for Type1 fonts in custom directory if path is
non-NULL
Otherwise, programs using poppler may crash
Proposed upstream at https://bugs.freedesktop.org/show_bug.cgi?id=49037
diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index 1111111..2222222 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -382,7 +382,7 @@ void GlobalParams::setupBaseFonts(const char *dir)
GooString *fontName = new GooString(displayFontTab[i].name);
- if (dir) {
+ if (dir && displayFontTab[i].t1FileName) {
GooString *fontPath = appendToPath(new GooString(dir), displayFontTab[i].t1FileName);
if (FileExists(fontPath->c_str()) || FileExists(replaceSuffix(fontPath, ".pfb", ".pfa")->c_str())) {
addFontFile(fontName, fontPath);
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: darealshinji <djcj@gmx.de>
Date: Thu, 14 Jul 2016 13:21:26 +0200
Subject: [PATCH 2/4] enable cross-building DLLs
diff --git a/cpp/poppler-global.h b/cpp/poppler-global.h
index 1111111..2222222 100644
--- a/cpp/poppler-global.h
+++ b/cpp/poppler-global.h
@@ -22,7 +22,7 @@
#ifndef POPPLER_GLOBAL_H
#define POPPLER_GLOBAL_H
-#if defined(_WIN32)
+#if defined(_WIN32) && defined(DLL_EXPORT)
# define LIB_EXPORT __declspec(dllexport)
# define LIB_IMPORT __declspec(dllimport)
#else
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 1111111..2222222 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -104,6 +104,7 @@ std::unique_ptr<GlobalParams> globalParams;
static HMODULE hmodule;
+#ifdef DLL_EXPORT
extern "C" {
/* Provide declaration to squelch -Wmissing-declarations warning */
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
@@ -119,6 +120,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE;
}
}
+#endif
static const char *get_poppler_datadir(void)
{
diff --git a/qt5/src/poppler-export.h b/qt5/src/poppler-export.h
index 1111111..2222222 100644
--- a/qt5/src/poppler-export.h
+++ b/qt5/src/poppler-export.h
@@ -2,7 +2,7 @@
* This file is used to set the poppler_qt5_EXPORT macros right.
* This is needed for setting the visibility on windows, it will have no effect on other platforms.
*/
-#if defined(_WIN32)
+#if defined(_WIN32) && defined(DLL_EXPORT)
# define _POPPLER_QT5_LIB_EXPORT __declspec(dllexport)
# define _POPPLER_QT5_LIB_IMPORT __declspec(dllimport)
#elif defined(__GNUC__)
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Boris Nagaev <bnagaev@gmail.com>
Date: Wed, 27 Jul 2016 10:29:52 +0200
Subject: [PATCH 3/4] do not try to use mman.h (package mman-win32)
fix https://github.com/mxe/mxe/issues/1455
diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc
index 1111111..2222222 100755
--- a/poppler/CairoFontEngine.cc
+++ b/poppler/CairoFontEngine.cc
@@ -53,13 +53,6 @@
#include "Gfx.h"
#include "Page.h"
-#if defined(HAVE_FCNTL_H) && defined(HAVE_SYS_MMAN_H) && defined(HAVE_SYS_STAT_H)
-# include <fcntl.h>
-# include <sys/stat.h>
-# include <sys/mman.h>
-# define CAN_CHECK_OPEN_FACES 1
-#endif
-
//------------------------------------------------------------------------
// CairoFont
//------------------------------------------------------------------------
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Sat, 2 Mar 2019 12:42:53 +0100
Subject: [PATCH 4/4] Add the possibility to disable tests
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1111111..2222222 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,10 +48,11 @@ set (CMAKE_CXX_EXTENSIONS OFF)
# command line switches
option(ENABLE_UNSTABLE_API_ABI_HEADERS "Install API/ABI unstable xpdf headers." OFF)
-option(BUILD_GTK_TESTS "Whether to compile the GTK+ test programs." ON)
-option(BUILD_QT5_TESTS "Whether to compile the Qt5 test programs." ON)
-option(BUILD_QT6_TESTS "Whether to compile the Qt6 test programs." ON)
-option(BUILD_CPP_TESTS "Whether to compile the CPP test programs." ON)
+option(ENABLE_TESTS "Whether compile tests." ON)
+option(BUILD_GTK_TESTS "Whether to compile the GTK+ test programs." ${ENABLE_TESTS})
+option(BUILD_QT5_TESTS "Whether to compile the Qt5 test programs." ${ENABLE_TESTS})
+option(BUILD_QT6_TESTS "Whether to compile the Qt6 test programs." ${ENABLE_TESTS})
+option(BUILD_CPP_TESTS "Whether to compile the CPP test programs." ${ENABLE_TESTS})
option(ENABLE_SPLASH "Build the Splash graphics backend." ON)
option(ENABLE_UTILS "Compile poppler command line utils." ON)
option(ENABLE_CPP "Compile poppler cpp wrapper." ON)
@@ -727,7 +728,9 @@ endif()
if(ENABLE_GLIB)
add_subdirectory(glib)
endif()
-add_subdirectory(test)
+if(ENABLE_TESTS)
+ add_subdirectory(test)
+endif()
if(ENABLE_QT5)
add_subdirectory(qt5)
endif()
|