poppler: update 0.51.0 --> 0.74.0

pull/2302/head
Stefan Löffler 5 years ago committed by Tony Theodore
parent 4581798636
commit e28e9844ce

@ -1,9 +1,11 @@
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: Mon, 15 Sep 2014 19:53:04 -0700
Subject: [PATCH 1/2] Only check for Type1 fonts in custom directory if path is
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
@ -13,28 +15,27 @@ diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
index 1111111..2222222 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -423,7 +423,7 @@ void GlobalParams::setupBaseFonts(char * dir)
if (fontFiles->lookup(fontName))
continue;
@@ -408,7 +408,7 @@ void GlobalParams::setupBaseFonts(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->getCString()) ||
FileExists(replaceSuffix(fontPath, ".pfb", ".pfa")->getCString())) {
if (FileExists(fontPath->c_str()) ||
FileExists(replaceSuffix(fontPath, ".pfb", ".pfa")->c_str())) {
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/2] enable cross-building DLLs
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
@@ -21,7 +21,7 @@
@@ -22,7 +22,7 @@
#ifndef POPPLER_GLOBAL_H
#define POPPLER_GLOBAL_H
@ -47,63 +48,28 @@ diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 1111111..2222222 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -150,6 +150,7 @@ PSFontParam16::~PSFontParam16() {
@@ -104,6 +104,7 @@ GlobalParams *globalParams = nullptr;
static HMODULE hmodule;
+#ifdef DLL_EXPORT
extern "C" {
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
@@ -166,6 +167,7 @@ DllMain (HINSTANCE hinstDLL,
return TRUE;
}
/* Provide declaration to squelch -Wmissing-declarations warning */
BOOL WINAPI
@@ -125,6 +126,7 @@ extern "C" {
return TRUE;
}
}
+#endif
static const char *
get_poppler_datadir (void)
diff --git a/poppler/XpdfPluginAPI.h b/poppler/XpdfPluginAPI.h
index 1111111..2222222 100644
--- a/poppler/XpdfPluginAPI.h
+++ b/poppler/XpdfPluginAPI.h
@@ -47,7 +47,7 @@ extern "C" {
*/
#define xpdfPluginAPIVersion 1
-#ifdef _WIN32
+#if defined(_WIN32) && defined(DLL_EXPORT)
# ifdef __cplusplus
# define PLUGINFUNC(retType) extern "C" __declspec(dllexport) retType
# else
@@ -286,7 +286,7 @@ void (*_xpdfRegisterSecurityHandler)(XpdfSecurityHandler *handler);
} XpdfPluginVecTable;
-#ifdef _WIN32
+#if defined(_WIN32) && defined(DLL_EXPORT)
extern __declspec(dllexport) XpdfPluginVecTable xpdfPluginVecTable;
diff --git a/qt4/src/poppler-export.h b/qt4/src/poppler-export.h
index 1111111..2222222 100644
--- a/qt4/src/poppler-export.h
+++ b/qt4/src/poppler-export.h
@@ -2,7 +2,7 @@
* This file is used to set the poppler_qt4_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_QT4_LIB_EXPORT __declspec(dllexport)
# define _POPPLER_QT4_LIB_IMPORT __declspec(dllimport)
#elif defined(__GNUC__)
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_qt4_EXPORT macros right.
* 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)
@ -115,7 +81,7 @@ index 1111111..2222222 100644
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] do not try to use mman.h (package mman-win32)
Subject: [PATCH 3/4] do not try to use mman.h (package mman-win32)
fix https://github.com/mxe/mxe/issues/1455
@ -123,17 +89,53 @@ diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc
index 1111111..2222222 100644
--- a/poppler/CairoFontEngine.cc
+++ b/poppler/CairoFontEngine.cc
@@ -48,13 +48,6 @@
@@ -51,13 +51,6 @@
#include "Gfx.h"
#include "Page.h"
-#if HAVE_FCNTL_H && HAVE_SYS_MMAN_H && HAVE_SYS_STAT_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
-
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#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
@@ -45,9 +45,10 @@ 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 compile the GTK+ test programs." ON)
-option(BUILD_QT5_TESTS "Whether compile the Qt5 test programs." ON)
-option(BUILD_CPP_TESTS "Whether compile the CPP test programs." ON)
+option(ENABLE_TESTS "Whether compile tests." ON)
+option(BUILD_GTK_TESTS "Whether compile the GTK+ test programs." ${ENABLE_TESTS})
+option(BUILD_QT5_TESTS "Whether compile the Qt5 test programs." ${ENABLE_TESTS})
+option(BUILD_CPP_TESTS "Whether 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)
@@ -665,7 +666,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()

@ -3,65 +3,28 @@
PKG := poppler
$(PKG)_WEBSITE := https://poppler.freedesktop.org/
$(PKG)_IGNORE :=
$(PKG)_VERSION := 0.51.0
$(PKG)_CHECKSUM := e997c9ad81a8372f2dd03a02b00692b8cc479c220340c8881edaca540f402c1f
$(PKG)_VERSION := 0.74.0
$(PKG)_CHECKSUM := 92e09fd3302567fd36146b36bb707db43ce436e8841219025a82ea9fb0076b2f
$(PKG)_SUBDIR := poppler-$($(PKG)_VERSION)
$(PKG)_FILE := poppler-$($(PKG)_VERSION).tar.xz
$(PKG)_URL := https://poppler.freedesktop.org/$($(PKG)_FILE)
$(PKG)_DEPS := cc cairo curl freetype glib jpeg lcms libpng qtbase tiff zlib
$(PKG)_DEPS := cc cairo curl freetype glib jpeg lcms libpng libwebp openjpeg qtbase tiff zlib
define $(PKG)_UPDATE
$(WGET) -q -O- 'https://poppler.freedesktop.org/' | \
$(SED) -n 's,.*"poppler-\([0-9.]\+\)\.tar\.xz".*,\1,p' | \
head -1
$(call GET_LATEST_VERSION, https://poppler.freedesktop.org/releases.html, poppler-)
endef
define $(PKG)_BUILD
# Note: Specifying LIBS explicitly is necessary for configure to properly
# pick up libtiff (otherwise linking a minimal test program fails not
# because libtiff is not found, but because some references are
# undefined)
cd '$(1)' \
&& PATH='$(PREFIX)/$(TARGET)/$(if $(filter qtbase,$($(PKG)_DEPS)),qt5,qt)/bin:$(PATH)' \
./configure \
$(MXE_CONFIGURE_OPTS) \
--disable-silent-rules \
--enable-xpdf-headers \
$(if $(filter qtbase,$($(PKG)_DEPS)), \
--enable-poppler-qt5 \
--disable-poppler-qt4, \
--disable-poppler-qt5 \
--enable-poppler-qt4) \
--enable-zlib \
--enable-cms=lcms2 \
--enable-libcurl \
--enable-libtiff \
--enable-libjpeg \
--enable-libpng \
--enable-poppler-glib \
--enable-poppler-cpp \
--enable-cairo-output \
--enable-splash-output \
--enable-compile-warnings=yes \
--enable-introspection=auto \
--disable-libopenjpeg \
--disable-gtk-test \
--disable-utils \
--disable-gtk-doc \
--disable-gtk-doc-html \
--disable-gtk-doc-pdf \
--with-font-configuration=win32 \
PKG_CONFIG_PATH_$(subst .,_,$(subst -,_,$(TARGET)))='$(PREFIX)/$(TARGET)/qt/lib/pkgconfig' \
CXXFLAGS="-D_WIN32_WINNT=0x0500 -std=c++11" \
LIBTIFF_LIBS="`'$(TARGET)-pkg-config' libtiff-4 --libs`"
$(SED) -i 's,reference,'',g' '$(1)/glib/Makefile'
PATH='$(PREFIX)/$(TARGET)/$(if $(filter qtbase,$($(PKG)_DEPS)),qt5,qt)/bin:$(PATH)' \
$(MAKE) -C '$(1)' -j '$(JOBS)' $(MXE_DISABLE_CRUFT) HTML_DIR=
$(MAKE) -C '$(1)' -j 1 install $(MXE_DISABLE_CRUFT) HTML_DIR=
# build and install the library
cd '$(BUILD_DIR)' && $(TARGET)-cmake \
-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_TESTS=OFF -DENABLE_UTILS=OFF \
'$(SOURCE_DIR)'
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
# Test program
# compile test
'$(TARGET)-g++' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-poppler.exe' \
`'$(TARGET)-pkg-config' poppler poppler-cpp --cflags --libs`
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
`'$(TARGET)-pkg-config' poppler-cpp --cflags --libs`
endef

Loading…
Cancel
Save