diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 7e0a875191a3..22a881781f19 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -40,14 +40,11 @@ jobs: - name: conan profile run: conan profile detect - - name: checkout core - run: git submodule update --init --depth 1 OpenDocument.core - - name: checkout conan-index - run: cd OpenDocument.core; git submodule update --init --depth 1 conan-odr-index + run: git submodule update --init --depth 1 conan-odr-index - name: export conan-odr-index - run: python OpenDocument.core/conan-odr-index/scripts/conan_export_all_packages.py + run: python conan-odr-index/scripts/conan_export_all_packages.py - name: Gradle cache uses: gradle/actions/setup-gradle@v3 diff --git a/.gitmodules b/.gitmodules index ac856351dc1e..97d2b5bd3217 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "OpenDocument.core"] - path = OpenDocument.core - url = https://github.com/opendocument-app/OpenDocument.core +[submodule "conan-odr-index"] + path = conan-odr-index + url = https://github.com/opendocument-app/conan-odr-index.git diff --git a/OpenDocument.core b/OpenDocument.core deleted file mode 160000 index 7862afa37b1d..000000000000 --- a/OpenDocument.core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7862afa37b1d68d545fa6bf08619bde06ea79983 diff --git a/README.md b/README.md index 98abe165e196..4e9339cd609b 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,5 @@ Please help to translate on the https://crowdin.com/project/opendocument - install conan using pip in a venv - `conan profile detect --force` - make sure `conan` is in your $PATH or replace conan-call in `app/build.gradle` -- `git submodule update --init --depth 1 OpenDocument.core` -- `cd OpenDocument.core; git submodule update --init --depth 1 conan-odr-index` -- `python OpenDocument.core/conan-odr-index/scripts/conan_export_all_packages.py` +- `git submodule update --init --depth 1 conan-odr-index` +- `python conan-odr-index/scripts/conan_export_all_packages.py` diff --git a/app/conandeployer.py b/app/conandeployer.py index 6cc0b50cc30a..b91911af577d 100644 --- a/app/conandeployer.py +++ b/app/conandeployer.py @@ -26,33 +26,6 @@ def deploy(graph, output_folder: str, **kwargs): **copytree_kwargs, ) - if "pdf2htmlex" in deps: - dep = deps["pdf2htmlex"] - conanfile.output.info(f"Deploying pdf2htmlex to {output_folder}") - shutil.copytree( - f"{dep.package_folder}/share/pdf2htmlEX", - f"{output_folder}/pdf2htmlex", - **copytree_kwargs, - ) - - if "poppler-data" in deps: - dep = deps["poppler-data"] - conanfile.output.info(f"Deploying poppler-data to {output_folder}") - shutil.copytree( - f"{dep.package_folder}/share/poppler", - f"{output_folder}/poppler", - **copytree_kwargs, - ) - - if "fontconfig" in deps: - dep = deps["fontconfig"] - conanfile.output.info(f"Deploying fontconfig to {output_folder}") - shutil.copytree( - f"{dep.package_folder}/res/share", - f"{output_folder}/fontconfig", - **copytree_kwargs, - ) - if "libmagic" in deps: dep = deps["libmagic"] conanfile.output.info(f"Deploying libmagic to {output_folder}") diff --git a/app/conanfile.txt b/app/conanfile.txt index af579bb2c50f..61008dc0f949 100644 --- a/app/conanfile.txt +++ b/app/conanfile.txt @@ -1,5 +1,5 @@ [requires] -odrcore/5.2.0 +odrcore/5.4.0 [generators] CMakeToolchain @@ -7,5 +7,6 @@ CMakeDeps [options] odrcore/*:shared=False -odrcore/*:with_pdf2htmlEX=True -odrcore/*:with_wvWare=True +odrcore/*:with_pdf2htmlEX=False +odrcore/*:with_wvWare=False +odrcore/*:bundle_assets=False diff --git a/app/src/main/cpp/core_wrapper.cpp b/app/src/main/cpp/core_wrapper.cpp index f0aafa601c4b..faa97dc5c767 100644 --- a/app/src/main/cpp/core_wrapper.cpp +++ b/app/src/main/cpp/core_wrapper.cpp @@ -67,7 +67,7 @@ namespace { protected: void log_impl(Time time, odr::LogLevel level, const std::string &message, - const std::source_location &location) override { + const std::source_location &location) const override { __android_log_print(to_android_log_level(level), "smn", "%s", message.c_str()); } @@ -85,16 +85,10 @@ Java_at_tomtasche_reader_background_CoreWrapper_setGlobalParams(JNIEnv *env, jcl jclass paramsClass = env->GetObjectClass(params); std::string odrCoreDataPath = getStringField(env, paramsClass, params, "coreDataPath"); - std::string fontconfigDataPath = getStringField(env, paramsClass, params, "fontconfigDataPath"); - std::string popplerDataPath = getStringField(env, paramsClass, params, "popplerDataPath"); - std::string pdf2htmlexDataPath = getStringField(env, paramsClass, params, "pdf2htmlexDataPath"); std::string libmagicDatabasePath = getStringField(env, paramsClass, params, "libmagicDatabasePath"); std::string customTmpfilePath = getStringField(env, paramsClass, params, "customTmpfilePath"); odr::GlobalParams::set_odr_core_data_path(odrCoreDataPath); - odr::GlobalParams::set_fontconfig_data_path(fontconfigDataPath); - odr::GlobalParams::set_poppler_data_path(popplerDataPath); - odr::GlobalParams::set_pdf2htmlex_data_path(pdf2htmlexDataPath); odr::GlobalParams::set_libmagic_database_path(libmagicDatabasePath); tmpfile_hack::set_tmpfile_directory(customTmpfilePath); @@ -252,9 +246,7 @@ Java_at_tomtasche_reader_background_CoreWrapper_hostFileNative(JNIEnv *env, jcla try { odr::DecodePreference decodePreference; - decodePreference.engine_priority = {odr::DecoderEngine::poppler, - odr::DecoderEngine::wvware, - odr::DecoderEngine::odr}; + decodePreference.engine_priority = {odr::DecoderEngine::odr}; odr::DecodedFile file = odr::open(inputPathCpp, decodePreference, *logger); if (file.password_encrypted()) { diff --git a/app/src/main/java/at/tomtasche/reader/background/CoreWrapper.java b/app/src/main/java/at/tomtasche/reader/background/CoreWrapper.java index cfe2a2cbe068..6f2ba2470e6b 100644 --- a/app/src/main/java/at/tomtasche/reader/background/CoreWrapper.java +++ b/app/src/main/java/at/tomtasche/reader/background/CoreWrapper.java @@ -15,9 +15,6 @@ public class CoreWrapper { public static class GlobalParams { public String coreDataPath; - public String fontconfigDataPath; - public String popplerDataPath; - public String pdf2htmlexDataPath; public String libmagicDatabasePath; public String customTmpfilePath; @@ -28,24 +25,15 @@ public static class GlobalParams { public static void initialize(Context context) { File assetsDirectory = new File(context.getFilesDir(), "assets"); File odrCoreDataDirectory = new File(assetsDirectory, "odrcore"); - File fontconfigDataDirectory = new File(assetsDirectory, "fontconfig"); - File popplerDataDirectory = new File(assetsDirectory, "poppler"); - File pdf2htmlexDataDirectory = new File(assetsDirectory, "pdf2htmlex"); File libmagicDataDirectory = new File(assetsDirectory, "libmagic"); AssetExtractor ae = new AssetExtractor(context.getAssets()); ae.setOverwrite(); ae.extract(assetsDirectory, "core/odrcore"); - ae.extract(assetsDirectory, "core/fontconfig"); - ae.extract(assetsDirectory, "core/poppler"); - ae.extract(assetsDirectory, "core/pdf2htmlex"); ae.extract(assetsDirectory, "core/libmagic"); CoreWrapper.GlobalParams globalParams = new CoreWrapper.GlobalParams(); globalParams.coreDataPath = odrCoreDataDirectory.getAbsolutePath(); - globalParams.fontconfigDataPath = fontconfigDataDirectory.getAbsolutePath(); - globalParams.popplerDataPath = popplerDataDirectory.getAbsolutePath(); - globalParams.pdf2htmlexDataPath = pdf2htmlexDataDirectory.getAbsolutePath(); globalParams.libmagicDatabasePath = new File(libmagicDataDirectory, "magic.mgc").getAbsolutePath(); globalParams.customTmpfilePath = context.getCacheDir().getAbsolutePath(); CoreWrapper.setGlobalParams(globalParams); diff --git a/conan-odr-index b/conan-odr-index new file mode 160000 index 000000000000..5d1caec12e93 --- /dev/null +++ b/conan-odr-index @@ -0,0 +1 @@ +Subproject commit 5d1caec12e930bbde6190c8c537c086497a668f3