Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[poppler/22.07.0] Add version #11860

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions recipes/poppler/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
sources:
"20.09.0":
url: "https://poppler.freedesktop.org/poppler-20.09.0.tar.xz"
sha256: "4ed6eb5ddc4c37f2435c9d78ff9c7c4036455aea3507d1ce8400070aab745363"
"22.07.0":
url: "https://poppler.freedesktop.org/poppler-22.07.0.tar.xz"
sha256: "420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428"
"21.07.0":
url: "https://poppler.freedesktop.org/poppler-21.07.0.tar.xz"
sha256: "e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4"
patches:
"20.09.0":
- patch_file: "patches/20/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0002-cmake-use_CONAN_PKG-targets.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0003-cmake-disable-tests.patch"
url: "https://poppler.freedesktop.org/poppler-20.09.0.tar.xz"
sha256: "4ed6eb5ddc4c37f2435c9d78ff9c7c4036455aea3507d1ce8400070aab745363"
patches:
"22.07.0":
- patch_file: "patches/22/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0004-add-POPPLER_DATADIR-environment-variable.patch"
- patch_file: "patches/22/0002-cmake-use_CONAN_PKG-targets.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch"
- patch_file: "patches/22/0004-add-POPPLER_DATADIR-environment-variable.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0006-missing-symbol-dll-windows.patch"
- patch_file: "patches/21/0008-disable-qt-tests-and-demos.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0007-cmake-use_conan_qt.patch"
- patch_file: "patches/22/0009-replace-qlinked-list-by-std-list.patch"
base_path: "source_subfolder"
"21.07.0":
- patch_file: "patches/21/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch"
Expand All @@ -32,3 +31,20 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/21/0007-cmake-use_conan_qt.patch"
base_path: "source_subfolder"
- patch_file: "patches/21/0008-disable-qt-tests-and-demos.patch"
base_path: "source_subfolder"
"20.09.0":
- patch_file: "patches/20/0001-cmake-use-PROJECT_SOURCE_DIR-fix-CMAKE_MODULE_PATH.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0002-cmake-use_CONAN_PKG-targets.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0003-cmake-disable-tests.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0004-add-POPPLER_DATADIR-environment-variable.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0005-fix-visual-studio-basetsd.h-libjpeg-INT32.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0006-missing-symbol-dll-windows.patch"
base_path: "source_subfolder"
- patch_file: "patches/20/0007-cmake-use_conan_qt.patch"
base_path: "source_subfolder"
36 changes: 19 additions & 17 deletions recipes/poppler/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from conan.tools.files import apply_conandata_patches
from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os
Expand Down Expand Up @@ -88,38 +89,38 @@ def configure(self):
del self.options.with_libiconv

def requirements(self):
self.requires("poppler-data/0.4.10")
self.requires("freetype/2.10.4")
self.requires("poppler-data/0.4.11")
self.requires("freetype/2.12.1")
if self.options.get_safe("with_libiconv"):
self.requires("libiconv/1.16")
self.requires("libiconv/1.17")
if self.options.fontconfiguration == "fontconfig":
self.requires("fontconfig/2.13.93")
if self.options.with_cairo:
self.requires("cairo/1.17.4")
if self.options.get_safe("with_glib"):
self.requires("glib/2.69.0")
self.requires("glib/2.73.2")
if self.options.get_safe("with_gobject_introspection"):
self.requires("gobject-introspection/1.68.0")
self.requires("gobject-introspection/1.72.0")
if self.options.with_qt:
self.requires("qt/6.1.2")
self.requires("qt/6.3.1")
if self.options.get_safe("with_gtk"):
self.requires("gtk/4.1.2")
self.requires("gtk/4.7.0")
if self.options.with_openjpeg:
self.requires("openjpeg/2.4.0")
self.requires("openjpeg/2.5.0")
if self.options.with_lcms:
self.requires("lcms/2.11")
self.requires("lcms/2.13.1")
if self.options.with_libjpeg == "libjpeg":
self.requires("libjpeg/9d")
if self.options.with_png:
self.requires("libpng/1.6.37")
if self.options.with_tiff:
self.requires("libtiff/4.3.0")
if self.options.splash:
self.requires("boost/1.76.0")
self.requires("boost/1.79.0")
if self.options.with_libcurl:
self.requires("libcurl/7.78.0")
self.requires("libcurl/7.84.0")
if self.options.with_zlib:
self.requires("zlib/1.2.11")
self.requires("zlib/1.2.12")

@property
def _minimum_compilers_version(self):
Expand Down Expand Up @@ -231,15 +232,16 @@ def _configure_cmake(self):
return self._cmake

def _patch_sources(self):
for patchdata in self.conan_data["patches"][self.version]:
tools.patch(**patchdata)
apply_conandata_patches(self)

if tools.Version(self.version) < "21.07.0" and not self.options.shared:
poppler_global = os.path.join(self._source_subfolder, "cpp", "poppler-global.h")
tools.replace_in_file(poppler_global, "__declspec(dllimport)", "")
tools.replace_in_file(poppler_global, "__declspec(dllexport)", "")
tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"),
"FREETYPE_INCLUDE_DIRS",
"Freetype_INCLUDE_DIRS")
if tools.Version(self.version) < "22.07.0":
tools.replace_in_file(os.path.join(self._source_subfolder, "CMakeLists.txt"),
"FREETYPE_INCLUDE_DIRS",
"Freetype_INCLUDE_DIRS")

def build(self):
self._patch_sources()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/qt5/CMakeLists.txt b/qt5/CMakeLists.txt
index 64e81601..80bd001a 100644
--- a/qt5/CMakeLists.txt
+++ b/qt5/CMakeLists.txt
@@ -9,5 +9,5 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050900)
add_definitions(-DQT_NO_DEPRECATED_WARNINGS)

add_subdirectory(src)
-add_subdirectory(tests)
-add_subdirectory(demos)
+#add_subdirectory(tests)
+#add_subdirectory(demos)
diff --git a/qt6/CMakeLists.txt b/qt6/CMakeLists.txt
index 89e612d1..b6e8a876 100644
--- a/qt6/CMakeLists.txt
+++ b/qt6/CMakeLists.txt
@@ -7,5 +7,5 @@ endif()

add_subdirectory(src)

-add_subdirectory(tests)
-add_subdirectory(demos)
+#add_subdirectory(tests)
+#add_subdirectory(demos)
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
commit 788830d1c849a339d3db930e64caee0b90cedd57
Author: Martin Delille <martin@delille.org>
Date: Fri Jul 22 14:20:54 2022 +0200

CMake use PROJECT_SOURCE_DIR

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06e4b338..23edb8a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)

project(poppler)

-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
+list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)

include(PopplerDefaults)
include(PopplerMacros)
@@ -90,7 +90,7 @@ option(EXTRA_WARN "Enable extra compile warnings" OFF)

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

-set(TESTDATADIR "${CMAKE_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.")
+set(TESTDATADIR "${PROJECT_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.")
if(NOT (EXISTS ${TESTDATADIR} AND EXISTS ${TESTDATADIR}/test-poppler.c))
message(WARNING "
No test data found in $testdatadir.
@@ -845,4 +845,4 @@ add_custom_target(dist
COMMAND tar -C ${CMAKE_BINARY_DIR} -rf ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar ChangeLog --transform='s,,${ARCHIVE_NAME}/,' --owner root:0 --group root:0
COMMAND tar -C ${CMAKE_BINARY_DIR} -rf ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar glib/reference/html --transform='s,,${ARCHIVE_NAME}/,' --owner root:0 --group root:0
COMMAND xz -9 ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt
index 143af809..7553245a 100644
--- a/cpp/tests/CMakeLists.txt
+++ b/cpp/tests/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_BINARY_DIR}/..
- ${CMAKE_SOURCE_DIR}/utils
+ ${PROJECT_SOURCE_DIR}/utils
)

macro(CPP_ADD_SIMPLETEST exe)
@@ -14,8 +14,8 @@ macro(CPP_ADD_SIMPLETEST exe)
target_link_libraries(${exe} poppler-cpp poppler)
endmacro(CPP_ADD_SIMPLETEST)

-cpp_add_simpletest(poppler-dump poppler-dump.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc)
-cpp_add_simpletest(poppler-render poppler-render.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc)
+cpp_add_simpletest(poppler-dump poppler-dump.cpp ${PROJECT_SOURCE_DIR}/utils/parseargs.cc)
+cpp_add_simpletest(poppler-render poppler-render.cpp ${PROJECT_SOURCE_DIR}/utils/parseargs.cc)

if(ENABLE_FUZZER)
cpp_add_simpletest(doc_fuzzer ./fuzzing/doc_fuzzer.cc)
diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index e28d43ab..480595c9 100644
--- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt
@@ -84,9 +84,9 @@ set(poppler_glib_SRCS
)
set(poppler_glib_generated_SRCS
${CMAKE_CURRENT_BINARY_DIR}/poppler-enums.c
- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc
)
add_library(poppler-glib ${poppler_glib_SRCS} ${poppler_glib_generated_SRCS})
generate_export_header(poppler-glib EXPORT_MACRO_NAME POPPLER_PUBLIC EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/poppler-macros.h")
diff --git a/glib/reference/CMakeLists.txt b/glib/reference/CMakeLists.txt
index 15515406..e3091869 100644
--- a/glib/reference/CMakeLists.txt
+++ b/glib/reference/CMakeLists.txt
@@ -1,7 +1,7 @@
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp
DEPENDS poppler-glib
- COMMAND ${CMAKE_SOURCE_DIR}/make-glib-api-docs --src-dir=${CMAKE_SOURCE_DIR} --build-dir=${CMAKE_BINARY_DIR}
+ COMMAND ${PROJECT_SOURCE_DIR}/make-glib-api-docs --src-dir=${PROJECT_SOURCE_DIR} --build-dir=${CMAKE_BINARY_DIR}
COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp
)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4d57f665..af5d308f 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -19,7 +19,7 @@ if (GTK_FOUND)
)

include_directories(
- ${CMAKE_SOURCE_DIR}/glib
+ ${PROJECT_SOURCE_DIR}/glib
${CMAKE_BINARY_DIR}/glib
)

@@ -33,9 +33,9 @@ if (GTK_FOUND)

set (pdf_inspector_SRCS
pdf-inspector.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc
)
poppler_add_test(pdf-inspector BUILD_GTK_TESTS ${pdf_inspector_SRCS})
target_link_libraries(pdf-inspector ${CAIRO_LIBRARIES} Freetype::Freetype ${common_libs} ${GTK3_LIBRARIES} poppler)
@@ -61,9 +61,9 @@ if (HAVE_CAIRO)
find_package(Threads)
set(cairo_thread_test_SRCS
cairo-thread-test.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoFontEngine.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc
- ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoFontEngine.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoOutputDev.cc
+ ${PROJECT_SOURCE_DIR}/poppler/CairoRescaleBox.cc
)
add_executable(cairo-thread-test ${cairo_thread_test_SRCS})
target_link_libraries(cairo-thread-test ${CAIRO_LIBRARIES} Freetype::Freetype Threads::Threads poppler)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
commit 2b9af0312a19b41da03130b300b95f1fd51b747c
Author: Martin Delille <martin@delille.org>
Date: Fri Jul 22 14:36:30 2022 +0200

CMake use CONAN_PKG-targets

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 23edb8a6..21a60bb0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -257,7 +257,7 @@ if(ENABLE_ZLIB_UNCOMPRESS AND NOT ENABLE_ZLIB)
endif()
set(WITH_OPENJPEG FALSE)
if(ENABLE_LIBOPENJPEG STREQUAL "openjpeg2")
- find_package(OpenJPEG)
+ find_package(OpenJPEG REQUIRED)
set(WITH_OPENJPEG ${OpenJPEG_FOUND})
if(NOT OpenJPEG_FOUND OR OPENJPEG_MAJOR_VERSION VERSION_LESS 2)
message(STATUS "Could NOT find openjpeg2.")
@@ -278,13 +278,13 @@ else()
endif()
set(ENABLE_LIBOPENJPEG "${WITH_OPENJPEG}")
if(ENABLE_CMS STREQUAL "lcms2")
- find_package(LCMS2)
+ find_package(LCMS2 REQUIRED)
set(USE_CMS ${LCMS2_FOUND})
elseif(NOT ENABLE_CMS STREQUAL "none")
message(FATAL_ERROR "Invalid ENABLE_CMS value: ${ENABLE_CMS}")
endif()
if(ENABLE_LIBCURL)
- find_package(CURL)
+ find_package(CURL REQUIRED)
if(CURL_FOUND)
set(POPPLER_HAS_CURL_SUPPORT ON)
else()
@@ -458,14 +458,14 @@ set(poppler_SRCS
splash/SplashXPath.cc
splash/SplashXPathScanner.cc
)
-set(poppler_LIBS Freetype::Freetype)
-if(FONTCONFIG_FOUND)
+set(poppler_LIBS CONAN_PKG::freetype)
+if(WITH_FONTCONFIGURATION_FONTCONFIG)
+ set(poppler_LIBS ${poppler_LIBS} CONAN_PKG::fontconfig)
add_definitions(${FONTCONFIG_DEFINITIONS})
include_directories(SYSTEM ${FONTCONFIG_INCLUDE_DIR})
- set(poppler_LIBS ${poppler_LIBS} ${FONTCONFIG_LIBRARIES})
endif()

-if(JPEG_FOUND)
+if(ENABLE_JPEG)
set(poppler_SRCS ${poppler_SRCS}
poppler/DCTStream.cc
)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index daf7e5c8..55bcaddf 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -31,7 +31,7 @@ if(MINGW AND BUILD_SHARED_LIBS)
get_target_property(POPPLER_CPP_SOVERSION poppler-cpp SOVERSION)
set_target_properties(poppler-cpp PROPERTIES SUFFIX "-${POPPLER_CPP_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
-target_link_libraries(poppler-cpp poppler ${ICONV_LIBRARIES})
+target_link_libraries(poppler-cpp poppler CONAN_PKG::libiconv)
install(TARGETS poppler-cpp RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
commit 94509214b1c2cc3e2a643bdd4472ae28a143cea2
Author: Martin Delille <martin@delille.org>
Date: Fri Jul 22 14:45:42 2022 +0200

Add POPPLER_DATADIR environment variable

diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index a7e7fed4..39f56e71 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -402,6 +402,9 @@ const SysFontInfo *SysFontList::find(const std::string &name, bool fixedWidth, b

GlobalParams::GlobalParams(const char *customPopplerDataDir) : popplerDataDir(customPopplerDataDir)
{
+ if (!popplerDataDir) {
+ popplerDataDir = ::getenv("POPPLER_DATADIR");
+ }
// scan the encoding in reverse because we want the lowest-numbered
// index for each char name ('space' is encoded twice)
macRomanReverseMap = new NameToCharCode();
Loading