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

Build with pdf2htmlEX #380

Merged
merged 106 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
fa02f29
Build with pdf2htmlEX
ViliusSutkus89 Aug 7, 2024
ce3d376
Macos-14 image is actually arm64, not x86_64. Fix conan profile
ViliusSutkus89 Aug 7, 2024
cf15af3
Add odr to default remote position, not 0. This may reduce some load …
ViliusSutkus89 Aug 7, 2024
21d9043
Use msvc-19.40 compiler instead of 19.39
ViliusSutkus89 Aug 7, 2024
2a5baf1
Disable msvc compiler
ViliusSutkus89 Aug 8, 2024
e38d0c8
Revert "Disable msvc compiler"
ViliusSutkus89 Aug 8, 2024
0176499
Don't depend on pdf2htmlEX when building for Windows
ViliusSutkus89 Aug 8, 2024
75b9f56
Revert msvc compiler to 19.39. Remove pdf2htmlEX config from it's con…
ViliusSutkus89 Aug 8, 2024
11060cc
Add msvc-19.40, alongside 19.39
ViliusSutkus89 Aug 8, 2024
51321cb
Raise min cppstd to 20
ViliusSutkus89 Aug 8, 2024
ce3fd9b
"Fix" shared/fPIC build options. BUILD_SHARED_LIBS is already passed …
ViliusSutkus89 Aug 8, 2024
597955f
Add with_pdf2htmlEX option. Attempt to default disable for Windows. M…
ViliusSutkus89 Aug 8, 2024
2f0978d
Remove with_pdf2htmlEX option on Windows
ViliusSutkus89 Aug 8, 2024
982abb6
Link against pdf2htmlEX in CMake
ViliusSutkus89 Aug 8, 2024
7302ce1
Pass WITH_PDF2HTMLEX parameter to CMake correctly
ViliusSutkus89 Aug 8, 2024
326dab5
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 10, 2024
2be61ef
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 13, 2024
16f27e8
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 13, 2024
6fe7b1c
Add pdf2htmlEX_wrapper, actually call pdf2htmlEX
ViliusSutkus89 Aug 15, 2024
c4475b7
Format pdf2htmlEX_wrapper.cpp
ViliusSutkus89 Aug 15, 2024
5c37f20
Upgrade pdf2htmlEX to 20240814-git
ViliusSutkus89 Aug 15, 2024
581767d
Compile with original pdf files, even if they aren't used at runtime.…
ViliusSutkus89 Aug 15, 2024
cc091d9
Process annotation, don't process outline. Ignore drm. DRM is for cop…
ViliusSutkus89 Aug 15, 2024
71622a0
formatting
ViliusSutkus89 Aug 15, 2024
1c00561
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 16, 2024
b808def
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 16, 2024
5ff2c61
Fix macos-14 pdf2htmlEX conan profile
ViliusSutkus89 Aug 16, 2024
b7120b9
Remove pdf2htmlEX-config. Default options should work now
ViliusSutkus89 Aug 16, 2024
b0fab38
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 18, 2024
538fe12
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 21, 2024
4e65796
Build with wvWare
ViliusSutkus89 Aug 21, 2024
05af0da
inline errorPrinter
ViliusSutkus89 Aug 21, 2024
bac6e12
cmakedefine WITH_PDF2HTMLEX and WITH_WVWARE in project_info.hpp
ViliusSutkus89 Aug 21, 2024
9f3ee87
Introduce Html OpenDocumentReader::pdf2htmlEX() instead of using html…
ViliusSutkus89 Aug 21, 2024
0578221
Add and expose wvWare_wrapper
ViliusSutkus89 Aug 21, 2024
3728064
Formatting
ViliusSutkus89 Aug 21, 2024
cba968e
#include unistd.h in wvWare_wrapper.cpp to find unlink()
ViliusSutkus89 Aug 21, 2024
e5b1f72
Formatting
ViliusSutkus89 Aug 21, 2024
35298f9
Don't build dependencies in CI, they should be built already. Error o…
ViliusSutkus89 Aug 21, 2024
4e090c4
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Aug 21, 2024
4299c5d
Revert accidentally changed formatting in html.cpp
ViliusSutkus89 Aug 22, 2024
1596670
Update wvWare wrapper
ViliusSutkus89 Aug 22, 2024
3e4f52b
clang format wvWare_wrapper.cpp
ViliusSutkus89 Aug 22, 2024
2e164be
Update wvWare wrapper
ViliusSutkus89 Aug 22, 2024
7dd61fc
Install .hpp files from ${CMAKE_CURRENT_BINARY_DIR}/src/ too (generat…
ViliusSutkus89 Aug 22, 2024
05cb086
Update WVDATADIR setting
ViliusSutkus89 Aug 25, 2024
9d2f359
Install .h headers too
ViliusSutkus89 Aug 25, 2024
79ac7b3
Update header installation. Install .h headers too, not just .hpp
ViliusSutkus89 Aug 25, 2024
c385c8c
Update wvWare and pdf2htmlEX wrappers
ViliusSutkus89 Aug 25, 2024
79d8117
Formatting
ViliusSutkus89 Aug 25, 2024
9bcdfe7
Allow passing passwords to pdf2htmlEX and wvWare
ViliusSutkus89 Aug 25, 2024
eab720e
Clean-up wvWare
ViliusSutkus89 Aug 25, 2024
9799978
More wvWare cleanup
ViliusSutkus89 Aug 25, 2024
2f9389a
More wvWare cleanup
ViliusSutkus89 Aug 25, 2024
f9bdad4
Fix header install
ViliusSutkus89 Aug 25, 2024
19f2a64
Update with_pdf2htmlEX and with_wvWare options, allow, but default Fa…
ViliusSutkus89 Aug 26, 2024
ae8acdc
Move wvWare.c to wvWare conan package
ViliusSutkus89 Aug 26, 2024
0322ffb
Format wvWare_wrapper.cpp
ViliusSutkus89 Aug 26, 2024
cde62f8
Unexpose pdf2htmlEX and wvWare in odr::OpenDocumentReader class
ViliusSutkus89 Aug 27, 2024
a010d3d
Add std::optional header include in wvWare_wrapper header
ViliusSutkus89 Aug 27, 2024
3343f18
Remove leftover headers from wvWare_wrapper
ViliusSutkus89 Aug 27, 2024
7f31990
Add pdf2htmlEX wrapper tests. Will probably fail, because of missing …
ViliusSutkus89 Aug 28, 2024
8466d39
[2/2] Add pdf2htmlEX wrapper tests
ViliusSutkus89 Aug 28, 2024
fa7803a
Format pdf2htmlEX_wrapper_test
ViliusSutkus89 Aug 28, 2024
04fd03d
Fix env vars in pdf2htmlEX and wvWare
ViliusSutkus89 Aug 28, 2024
7a3e1e9
add wvWare wrapper tests
ViliusSutkus89 Aug 28, 2024
ddbb7b4
Formatting
ViliusSutkus89 Aug 28, 2024
714a3b1
Don't build with pdf2htmlEX on Macos, no idea how it wasn't build bre…
ViliusSutkus89 Aug 28, 2024
c30a155
Supply password to password protected test in pdf2htmlEX wrapper test
ViliusSutkus89 Aug 28, 2024
961ccbb
Skip password protected files in wvWare wrapper test
ViliusSutkus89 Aug 28, 2024
80b356a
Disable wvWare on Macos
ViliusSutkus89 Aug 28, 2024
1d0fcd4
Fix password for encrypted_fontfile3_opentype.pdf
ViliusSutkus89 Aug 31, 2024
ed6122a
Try test on ubuntu-22.04/gcc-13
ViliusSutkus89 Sep 1, 2024
b101505
[2/2]Try test on ubuntu-22.04/gcc-13
ViliusSutkus89 Sep 1, 2024
9e7df8f
Try gcc-12 instead of gcc-13
ViliusSutkus89 Sep 1, 2024
1fb92b5
Remove gcc-12
ViliusSutkus89 Sep 1, 2024
fd01c3f
Attempt to print stacktrace to figure out what the exception is
ViliusSutkus89 Sep 1, 2024
3490508
Include execinfo header. Print test file
ViliusSutkus89 Sep 1, 2024
2d751a2
print stacktrace only on gcc
ViliusSutkus89 Sep 1, 2024
3511801
Format
ViliusSutkus89 Sep 1, 2024
76375fb
Add extra test output
ViliusSutkus89 Sep 1, 2024
a38b9ba
Print stacktrace on clang too
ViliusSutkus89 Sep 1, 2024
e4c2fff
Temporarily disable macos and msvc tests
ViliusSutkus89 Sep 1, 2024
1894686
formatting
ViliusSutkus89 Sep 1, 2024
dd67e28
Temporarily disable build-test-downstream and docker
ViliusSutkus89 Sep 1, 2024
5ed5d73
Add more instrumentation
ViliusSutkus89 Sep 1, 2024
aa4b752
Reenable tests
ViliusSutkus89 Sep 1, 2024
6fa428d
Merge branch 'main' into pdf2htmlex-conan
ViliusSutkus89 Sep 1, 2024
64cec06
[2/2] reenable tests
ViliusSutkus89 Sep 1, 2024
7706a94
Add more instrumentation
ViliusSutkus89 Sep 1, 2024
50bbb4d
Format
ViliusSutkus89 Sep 1, 2024
4e99ad4
Update test filtering
ViliusSutkus89 Sep 1, 2024
aa8e3f8
Artifact and download .conan2 dir. Test job needs this
ViliusSutkus89 Sep 2, 2024
a21fb29
test speed of compression levels
ViliusSutkus89 Sep 2, 2024
d23ae95
Set artifact compression level to 0
ViliusSutkus89 Sep 2, 2024
06903d0
Keep default compression level for first artifact
ViliusSutkus89 Sep 2, 2024
9c7b4ab
Remove previously added rdynamic cxxflag and exception stacktrace pri…
ViliusSutkus89 Sep 2, 2024
8758438
Update submodules
ViliusSutkus89 Sep 3, 2024
afbac96
Remove pdf2htmlEX ad wvWare from reference outputs, when running test…
ViliusSutkus89 Sep 3, 2024
5ea4cc1
Reduce instrumentation in pdf2htmlEX_wrapper and _test
ViliusSutkus89 Sep 3, 2024
65c3c9b
Call target_sources instead of appending source files
ViliusSutkus89 Sep 4, 2024
0f69469
Move pdf2htmlEX and wvWare test output to output-pdf2htmlEX and outpu…
ViliusSutkus89 Sep 4, 2024
a744ecd
Remove extra empty line that was previously added
ViliusSutkus89 Sep 4, 2024
637105e
Formatting
ViliusSutkus89 Sep 4, 2024
f975773
Add pdf2htmlEX workaround to screenshotter in html_render_diff
ViliusSutkus89 Sep 4, 2024
b945cbe
Update PDF2HTMLEX_DATA_DIR, POPPLER_DATA_DIR, FONTCONFIG_PATH and WVD…
ViliusSutkus89 Sep 5, 2024
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
2 changes: 2 additions & 0 deletions .github/config/macos-13-clang-14/conan/profiles/default
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include(pdf2htmlEX-config)

[settings]
arch=x86_64
build_type=Release
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[options]
# @TODO: Fix linker errors caused by the absense of these options
# Fontforge build failure if GLib built with mount
glib/*:with_mount=False
# Fontforge build failure if FreeType built with Brotli
freetype/*:with_brotli=False
4 changes: 3 additions & 1 deletion .github/config/macos-14-clang-14/conan/profiles/default
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include(pdf2htmlEX-config)

[settings]
arch=x86_64
arch=armv8
build_type=Release
compiler=apple-clang
compiler.version=14
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[options]
# @TODO: Fix linker errors caused by the absense of these options
# Fontforge build failure if GLib built with mount
glib/*:with_mount=False
# Fontforge build failure if FreeType built with Brotli
freetype/*:with_brotli=False
2 changes: 2 additions & 0 deletions .github/config/ubuntu-24.04-clang-16/conan/profiles/default
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include(pdf2htmlEX-config)

[settings]
arch=x86_64
build_type=Release
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[options]
# @TODO: Fix linker errors caused by the absense of these options
# Fontforge build failure if GLib built with mount
glib/*:with_mount=False
# Fontforge build failure if FreeType built with Brotli
freetype/*:with_brotli=False
2 changes: 2 additions & 0 deletions .github/config/ubuntu-24.04-gcc-12/conan/profiles/default
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include(pdf2htmlEX-config)

[settings]
arch=x86_64
build_type=Release
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[options]
# @TODO: Fix linker errors caused by the absense of these options
# Fontforge build failure if GLib built with mount
glib/*:with_mount=False
# Fontforge build failure if FreeType built with Brotli
freetype/*:with_brotli=False
8 changes: 8 additions & 0 deletions .github/config/windows-2022-msvc-1940/conan/profiles/default
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.version=194
compiler.cppstd=20
compiler.runtime=dynamic
os=Windows
6 changes: 4 additions & 2 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- { os: macos-13, compiler: clang-14 }
- { os: macos-14, compiler: clang-14 }
- { os: windows-2022, compiler: msvc-1939 }
- { os: windows-2022, compiler: msvc-1940 }
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -50,7 +51,7 @@ jobs:
run: pip install conan

- name: conan remote
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
andiwand marked this conversation as resolved.
Show resolved Hide resolved
run: conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan login
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}
- name: conan config
Expand Down Expand Up @@ -224,6 +225,7 @@ jobs:
- { os: macos-13, compiler: clang-14 }
- { os: macos-14, compiler: clang-14 }
- { os: windows-2022, compiler: msvc-1939 }
- { os: windows-2022, compiler: msvc-1940 }
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -247,7 +249,7 @@ jobs:
run: pip install conan

- name: conan remote
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
run: conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan config
run: conan config install .github/config/${{ matrix.os }}-${{ matrix.compiler }}/conan

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: pip install --upgrade pip conan

- name: conan remote
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
run: conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan login
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}
- name: conan config
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: pip install --upgrade pip conan

- name: conan remote
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
run: conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan config
run: conan config install .github/config/${{ matrix.os }}-${{ matrix.compiler }}/conan
- name: conan install
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
option(ODR_TEST "enable tests" OFF)
option(ODR_CLANG_TIDY "Run clang-tidy static analysis" OFF)
option(WITH_PDF2HTMLEX "Build with pdf2htmlEX" ON)

# TODO defining global compiler flags seems to be bad practice with conan
# TODO consider using conan profiles
Expand Down Expand Up @@ -187,6 +189,11 @@ target_link_libraries(odr
utf8::cpp
)

if(WITH_PDF2HTMLEX)
find_package(pdf2htmlEX REQUIRED)
target_link_libraries(odr PRIVATE pdf2htmlex::pdf2htmlex)
endif(WITH_PDF2HTMLEX)

if (EXISTS "${PROJECT_SOURCE_DIR}/.git")
add_dependencies(odr check_git)
endif ()
Expand Down
19 changes: 17 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,27 @@ class OpenDocumentCoreConan(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
"with_pdf2htmlEX": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"with_pdf2htmlEX": True,
}

exports_sources = ["cli/*", "cmake/*", "src/*", "CMakeLists.txt"]

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
# @TODO: ideally Windows should just default_options['with_pdf2htmlEX'] = False
# But by the time config_options() is executed, default_options is already done parsed.
del self.options.with_pdf2htmlEX

def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")

def requirements(self):
self.requires("pugixml/1.14")
self.requires("cryptopp/8.8.0")
Expand All @@ -34,19 +47,21 @@ def requirements(self):
self.requires("vincentlaucsb-csv-parser/2.1.3")
self.requires("uchardet/0.0.7")
self.requires("utfcpp/4.0.4")
if self.options.get_safe("with_pdf2htmlEX"):
self.requires("pdf2htmlex/0.18.8.rc1-20240805-git")

def build_requirements(self):
self.test_requires("gtest/1.14.0")

def validate_build(self):
if self.settings.get_safe("compiler.cppstd"):
check_min_cppstd(self, 17)
check_min_cppstd(self, 20)

def generate(self):
tc = CMakeToolchain(self)
tc.variables["CMAKE_PROJECT_VERSION"] = self.version
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
andiwand marked this conversation as resolved.
Show resolved Hide resolved
tc.variables["ODR_TEST"] = False
tc.variables["WITH_PDF2HTMLEX"] = self.options.get_safe("with_pdf2htmlEX", False)
tc.generate()

deps = CMakeDeps(self)
Expand Down