From 53769d18435ee5f547c60cd35d0f6d19e7164e43 Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Thu, 15 Aug 2024 12:31:48 +0300 Subject: [PATCH] Update pdf2htmlEX and it's asset collection mechanism --- app/CMakeLists.txt | 17 +++-------------- app/conanfile.py | 22 ++++++++++++++++++++++ app/conanfile.txt | 8 -------- 3 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 app/conanfile.py delete mode 100644 app/conanfile.txt diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 40a05aa4b944..212feedac4c1 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -32,17 +32,6 @@ function(copy_assets sourcevar dstsubdir) endif() endfunction() -copy_assets("pdf2htmlex_RES_DIRS_DEBUG" "pdf2htmlEX") -copy_assets("pdf2htmlex_RES_DIRS_RELEASE" "pdf2htmlEX") -copy_assets("pdf2htmlex_RES_DIRS_RELWITHDEBINFO" "pdf2htmlEX") -copy_assets("pdf2htmlex_RES_DIRS_MINSIZEREL" "pdf2htmlEX") - -copy_assets("poppler-data_RES_DIRS_DEBUG" "poppler-data") -copy_assets("poppler-data_RES_DIRS_RELEASE" "poppler-data") -copy_assets("poppler-data_RES_DIRS_RELWITHDEBINFO" "poppler-data") -copy_assets("poppler-data_RES_DIRS_MINSIZEREL" "poppler-data") - -copy_assets("fontconfig_RES_DIRS_DEBUG" "fontconfig") -copy_assets("fontconfig_RES_DIRS_RELEASE" "fontconfig") -copy_assets("fontconfig_RES_DIRS_RELWITHDEBINFO" "fontconfig") -copy_assets("fontconfig_RES_DIRS_MINSIZEREL" "fontconfig") +copy_assets("PDF2HTMLEX_RES_DIR" "pdf2htmlEX") +copy_assets("POPPLER_DATA_RES_DIR" "poppler-data") +copy_assets("FONTCONFIG_RES_DIR" "fontconfig") diff --git a/app/conanfile.py b/app/conanfile.py new file mode 100644 index 000000000000..1bd47ec8d3b5 --- /dev/null +++ b/app/conanfile.py @@ -0,0 +1,22 @@ +from conan import ConanFile +from conan.tools.cmake import CMakeToolchain, CMakeDeps + +required_conan_version = ">=2.0.6" + + +class pdf2htmlEXConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + # Remove pdf2htmlex dep once https://github.com/opendocument-app/OpenDocument.core/pull/380 is merged + requires = "odrcore/4.1.1@", "pdf2htmlex/0.18.8.rc1-20240814-git" + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + + # @TODO: figure out how to use POPPLER_DATA_DIR exported by poppler-data + tc.variables["POPPLER_DATA_RES_DIR"] = self.dependencies['poppler-data'].cpp_info.resdirs[0] + tc.variables["PDF2HTMLEX_RES_DIR"] = self.dependencies['pdf2htmlex'].cpp_info.resdirs[0] + tc.variables["FONTCONFIG_RES_DIR"] = self.dependencies['fontconfig'].cpp_info.resdirs[0] + tc.generate() + diff --git a/app/conanfile.txt b/app/conanfile.txt deleted file mode 100644 index f77350235ab2..000000000000 --- a/app/conanfile.txt +++ /dev/null @@ -1,8 +0,0 @@ -[requires] -odrcore/4.1.1@ -# Remove once https://github.com/opendocument-app/OpenDocument.core/pull/380 is merged -pdf2htmlex/0.18.8.rc1-20240805-git - -[generators] -CMakeToolchain -CMakeDeps