commit: 9c336a51298b0f92b3b9ac9400c6bcdd58ee313e Author: Alexander Golubev <fatzer2 <AT> gmail <DOT> com> AuthorDate: Wed Jul 23 21:11:10 2025 +0000 Commit: David Roman <davidroman96 <AT> gmail <DOT> com> CommitDate: Wed Jul 23 21:11:10 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=9c336a51
media-gfx/pdf4qt: several changes * drop 1.4.0.0 1.5.0.0 * add 1.5.1.0 * update 9999 * upstream changed the license to MIT Signed-off-by: Alexander Golubev <fatzer2 <AT> gmail.com> media-gfx/pdf4qt/Manifest | 3 +- .../pdf4qt-1.4.0.0-Disable-test-building.patch | 35 ------- ...ntime-respect-cmake-s-plugin-dir-settings.patch | 113 --------------------- .../files/pdf4qt-1.4.0.0-Minimal-cmake-fixes.patch | 47 --------- ...-1.4.0.0-fix-build-failure-on-resetMatrix.patch | 55 ---------- ...5.1.0-Fix-translation-install-path-on-nix.patch | 102 +++++++++++++++++++ ...t-1.5.1.0-Make-building-of-tests-optional.patch | 67 ++++++++++++ ...ntime-respect-cmake-s-plugin-dir-settings.patch | 103 +++++++++++++++++++ ...ch => pdf4qt-1.5.1.0-Minimal-cmake-fixes.patch} | 18 ++-- media-gfx/pdf4qt/pdf4qt-1.4.0.0-r1.ebuild | 65 ------------ ...pdf4qt-1.5.0.0.ebuild => pdf4qt-1.5.1.0.ebuild} | 18 +--- media-gfx/pdf4qt/pdf4qt-9999.ebuild | 21 +--- 12 files changed, 292 insertions(+), 355 deletions(-) diff --git a/media-gfx/pdf4qt/Manifest b/media-gfx/pdf4qt/Manifest index f1351459b3..700ff35c23 100644 --- a/media-gfx/pdf4qt/Manifest +++ b/media-gfx/pdf4qt/Manifest @@ -1,2 +1 @@ -DIST PDF4QT-1.4.0.0.tar.gz 4088081 BLAKE2B 85073f8821401e4160846dc13bf8170e12c3a06d19efdb0d7c2d7b541818b93dbaae9cea90a2dbc341e0129aba9300ef55e41a68d91c13159118394a9ac7cb0e SHA512 870ce6cb2a6d870c1fa7539a47556de86726a4897e181edc35ec7307a01ff2c0b3bd45b653a9e3a41aae7458cfe94545df6414314dfb5bb34226b7043a4d3a67 -DIST PDF4QT-1.5.0.0.tar.gz 4417709 BLAKE2B aaef7580dca2f29a58bf9167632b2d62876454ea35b163946801e2c51926bc1aefdd07cfffa6690e530a9808e8c8460b516a487e011e32b2cca2197ebc39454a SHA512 6ac2eea9b4d4c3c205f650f6c7655df3e0c92266f5c823a5235eadef150411a6dfa0cd16405e251a0fc4fb841f4fbdcf25661988fb54aa337243c4654b196104 +DIST PDF4QT-1.5.1.0.tar.gz 4560158 BLAKE2B ac479bae1dbae3e3b065ded2e9991c5cd4c2a86f172110c50adf2dd3c04e3cc55b963764a569e8e3770172e6a5c3a1d5cead4b288db4a7dbe4bc009bf67bcbd9 SHA512 483980223e1dd365cb850ac09de10deb8a9ef676a642028ce55bd2c4f315619eb0b4721ad217476c8ff95ab53bbbe49bb7db2c2aae1e8ac4d8f3bfbac9519abc diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Disable-test-building.patch b/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Disable-test-building.patch deleted file mode 100644 index 6210939405..0000000000 --- a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Disable-test-building.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 8b39f6ddb24b5bf681491c7a90b10bbd21255257 Mon Sep 17 00:00:00 2001 -From: Alexander Golubev <[email protected]> -Date: Mon, 11 Nov 2024 19:00:55 +0300 -Subject: [PATCH 1/2] Disable test building - -Due to it requires an extra dependency and fails tests anyway. ---- - CMakeLists.txt | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index cb8219c..c70868a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -49,7 +49,7 @@ include(GNUInstallDirs) - if(PDF4QT_BUILD_ONLY_CORE_LIBRARY) - find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Xml) - else() -- find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport TextToSpeech Test) -+ find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport TextToSpeech) - endif() - - qt_standard_project_setup() -@@ -128,7 +128,7 @@ if(NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY) - add_subdirectory(JBIG2_Viewer) - add_subdirectory(PdfExampleGenerator) - add_subdirectory(PdfTool) -- add_subdirectory(UnitTests) -+# add_subdirectory(UnitTests) - add_subdirectory(Pdf4QtLibGui) - add_subdirectory(Pdf4QtEditorPlugins) - add_subdirectory(Pdf4QtEditor) --- -2.45.2 - diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch b/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch deleted file mode 100644 index 04f38c119c..0000000000 --- a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 5475c2ba7ae732463b6502b916613be9cef02eb5 Mon Sep 17 00:00:00 2001 -From: Alexander Golubev <[email protected]> -Date: Mon, 11 Nov 2024 18:15:32 +0300 -Subject: [PATCH 2/2] Make runtime respect cmake's plugin dir settings - ---- - CMakeLists.txt | 7 +++++++ - Pdf4QtEditorPlugins/CMakeLists.txt | 6 ------ - Pdf4QtLibGui/CMakeLists.txt | 6 ++++++ - Pdf4QtLibGui/pdfprogramcontroller.cpp | 24 +++++++++++------------- - 4 files changed, 24 insertions(+), 19 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c70868a..7f3bf14 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -120,6 +120,13 @@ else() - set(PDF4QT_INSTALL_SHARE_DIR share) - endif() - -+if(PDF4QT_LINUX) -+ set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdf4qt CACHE PATH "Path to where pdf4qt plugins will be installed") -+else() -+ set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdfplugins CACHE PATH "Path to where pdf4qt plugins will be installed") -+endif() -+mark_as_advanced(PDF4QT_PLUGINS_DIR) -+ - add_subdirectory(Pdf4QtLibCore) - - if(NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY) -diff --git a/Pdf4QtEditorPlugins/CMakeLists.txt b/Pdf4QtEditorPlugins/CMakeLists.txt -index 177f01c..a5dae48 100644 ---- a/Pdf4QtEditorPlugins/CMakeLists.txt -+++ b/Pdf4QtEditorPlugins/CMakeLists.txt -@@ -15,12 +15,6 @@ - # You should have received a copy of the GNU Lesser General Public License - # along with PDF4QT. If not, see <https://www.gnu.org/licenses/>. - --if(PDF4QT_LINUX) -- set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdf4qt) --else() -- set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdfplugins) --endif() -- - add_subdirectory(AudioBookPlugin) - add_subdirectory(DimensionsPlugin) - add_subdirectory(ObjectInspectorPlugin) -diff --git a/Pdf4QtLibGui/CMakeLists.txt b/Pdf4QtLibGui/CMakeLists.txt -index 8e7354e..d95b064 100644 ---- a/Pdf4QtLibGui/CMakeLists.txt -+++ b/Pdf4QtLibGui/CMakeLists.txt -@@ -86,6 +86,12 @@ GENERATE_EXPORT_HEADER(Pdf4QtLibGui - PDF4QTLIBGUILIBSHARED_EXPORT - EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}/pdf4qtlibgui_export.h") - -+cmake_path(RELATIVE_PATH PDF4QT_PLUGINS_DIR -+ BASE_DIRECTORY PDF4QT_INSTALL_BIN_DIR -+ OUTPUT_VARIABLE PDF4QT_PLUGINS_RELATIVE_PATH) -+set_source_files_properties(pdfprogramcontroller.cpp -+ PROPERTIES COMPILE_DEFINITIONS "PDF4QT_PLUGINS_RELATIVE_PATH=\"${PDF4QT_PLUGINS_RELATIVE_PATH}\"") -+ - target_link_libraries(Pdf4QtLibGui PRIVATE Pdf4QtLibCore Pdf4QtLibWidgets Qt6::Core Qt6::Gui Qt6::Widgets Qt6::PrintSupport Qt6::TextToSpeech Qt6::Xml Qt6::Svg) - target_include_directories(Pdf4QtLibGui INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - target_include_directories(Pdf4QtLibGui PUBLIC ${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}) -diff --git a/Pdf4QtLibGui/pdfprogramcontroller.cpp b/Pdf4QtLibGui/pdfprogramcontroller.cpp -index ec75f95..422a329 100644 ---- a/Pdf4QtLibGui/pdfprogramcontroller.cpp -+++ b/Pdf4QtLibGui/pdfprogramcontroller.cpp -@@ -70,6 +70,16 @@ - #pragma comment(lib, "Shell32") - #endif - -+#ifndef PDF4QT_PLUGINS_RELATIVE_PATH -+# if defined(Q_OS_WIN) -+# define PDF4QT_PLUGINS_RELATIVE_PATH "pdfplugins" -+# elif defined(Q_OS_UNIX) -+# define PDF4QT_PLUGINS_RELATIVE_PATH "../lib/pdf4qt" -+# else -+# error Implement this for another OS! -+# endif -+#endif -+ - namespace pdfviewer - { - -@@ -2160,23 +2170,11 @@ void PDFProgramController::updatePageLayoutActions() - void PDFProgramController::loadPlugins() - { - QStringList availablePlugins; -- -+ QDir directory(QApplication::applicationDirPath() + "/" PDF4QT_PLUGINS_RELATIVE_PATH); - #if defined(Q_OS_WIN) -- QDir directory(QApplication::applicationDirPath() + "/pdfplugins"); - availablePlugins = directory.entryList(QStringList("*.dll")); - #elif defined(Q_OS_UNIX) --#ifndef NDEBUG -- QDir directory(QApplication::applicationDirPath() + "/../pdfplugins"); - availablePlugins = directory.entryList(QStringList("*.so")); --#else -- QDir directory(QApplication::applicationDirPath()); -- if (directory.cdUp() && -- directory.cd("lib") && -- directory.cd("pdf4qt")) -- { -- availablePlugins = directory.entryList(QStringList("*.so")); -- } --#endif - #else - static_assert(false, "Implement this for another OS!"); - #endif --- -2.45.2 - diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Minimal-cmake-fixes.patch b/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Minimal-cmake-fixes.patch deleted file mode 100644 index fbc5fae869..0000000000 --- a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-Minimal-cmake-fixes.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 4cc5cf70d017030c9e016587e1182060f64429f2 Mon Sep 17 00:00:00 2001 -From: Alexander Golubev <[email protected]> -Date: Fri, 8 Nov 2024 23:07:36 +0300 -Subject: [PATCH 2/2] Minimal cmake fixes - ---- - CMakeLists.txt | 3 +-- - Pdf4QtLibCore/CMakeLists.txt | 2 +- - 2 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ea5518d..cb8219c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -55,7 +55,6 @@ endif() - qt_standard_project_setup() - - find_package(OpenSSL REQUIRED) --find_package(lcms REQUIRED) - find_package(ZLIB REQUIRED) - find_package(Freetype REQUIRED) - find_package(OpenJPEG CONFIG REQUIRED) -@@ -92,7 +91,7 @@ endif() - option(PDF4QT_INSTALL_TO_USR "Install to usr directory" ON) - - if(PDF4QT_LINUX) -- set(PDF4QT_INSTALL_LIB_DIR_IMPL lib) -+ set(PDF4QT_INSTALL_LIB_DIR_IMPL ${CMAKE_INSTALL_LIBDIR}) - set(PDF4QT_INSTALL_BIN_DIR_IMPL bin) - - # Check if VCPKG_OVERLAY_PORTS is set as an environment variable or a CMake argument -diff --git a/Pdf4QtLibCore/CMakeLists.txt b/Pdf4QtLibCore/CMakeLists.txt -index e930b23..2c46c96 100644 ---- a/Pdf4QtLibCore/CMakeLists.txt -+++ b/Pdf4QtLibCore/CMakeLists.txt -@@ -162,7 +162,7 @@ GENERATE_EXPORT_HEADER(Pdf4QtLibCore - EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}/pdf4qtlibcore_export.h") - - target_link_libraries(Pdf4QtLibCore PRIVATE Qt6::Core Qt6::Gui Qt6::Xml Qt6::Svg) --target_link_libraries(Pdf4QtLibCore PRIVATE lcms2::lcms2) -+target_link_libraries(Pdf4QtLibCore PRIVATE lcms2) - target_link_libraries(Pdf4QtLibCore PRIVATE OpenSSL::SSL OpenSSL::Crypto) - target_link_libraries(Pdf4QtLibCore PRIVATE ZLIB::ZLIB) - target_link_libraries(Pdf4QtLibCore PRIVATE Freetype::Freetype) --- -2.45.2 - diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-fix-build-failure-on-resetMatrix.patch b/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-fix-build-failure-on-resetMatrix.patch deleted file mode 100644 index 1a5ce8bbc9..0000000000 --- a/media-gfx/pdf4qt/files/pdf4qt-1.4.0.0-fix-build-failure-on-resetMatrix.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 2a93ca5a1f40ee8178f07ac1590889c3d2623d6c Mon Sep 17 00:00:00 2001 -From: Jakub Melka <[email protected]> -Date: Wed, 10 Jul 2024 20:19:06 +0200 -Subject: [PATCH 01/11] Issue #185: Latest git fails to build in linux - ---- - Pdf4QtLibCore/sources/pdfblpainter.cpp | 12 ++++++------ - RELEASES.txt | 1 + - 2 files changed, 7 insertions(+), 6 deletions(-) - -diff --git a/Pdf4QtLibCore/sources/pdfblpainter.cpp b/Pdf4QtLibCore/sources/pdfblpainter.cpp -index a8b3e85..007c39b 100644 ---- a/Pdf4QtLibCore/sources/pdfblpainter.cpp -+++ b/Pdf4QtLibCore/sources/pdfblpainter.cpp -@@ -302,7 +302,7 @@ void PDFBLPaintEngine::updateState(const QPaintEngineState& updatedState) - if (updatedState.state().testFlag(QPaintEngine::DirtyTransform)) - { - m_currentTransform = updatedState.transform(); -- m_blContext->setMatrix(getBLMatrix(updatedState.transform())); -+ m_blContext->setTransform(getBLMatrix(updatedState.transform())); - } - - if (updatedState.state().testFlag(QPaintEngine::DirtyFont)) -@@ -580,7 +580,7 @@ void PDFBLPaintEngine::drawPathImpl(const QPainterPath& path, bool enableStroke, - if (!fillPath.isEmpty()) - { - m_blContext->save(); -- m_blContext->resetMatrix(); -+ m_blContext->resetTransform(); - m_blContext->fillPath(getBLPath(fillPath)); - m_blContext->restore(); - } -@@ -596,7 +596,7 @@ void PDFBLPaintEngine::drawPathImpl(const QPainterPath& path, bool enableStroke, - if (!finalTransformedStrokedPath.isEmpty()) - { - m_blContext->save(); -- m_blContext->resetMatrix(); -+ m_blContext->resetTransform(); - setBLBrush(m_blContext.value(), m_currentPen.brush()); - m_blContext->fillPath(getBLPath(finalTransformedStrokedPath)); - m_blContext->restore(); -@@ -1183,10 +1183,10 @@ void PDFBLPaintEngine::updateClipping(std::optional<QRegion> clipRegion, - - if (m_clipSingleRect) - { -- BLMatrix2D matrix = m_blContext->userMatrix(); -- m_blContext->resetMatrix(); -+ BLMatrix2D matrix = m_blContext->userTransform(); -+ m_blContext->resetTransform(); - m_blContext->clipToRect(getBLRect(m_finalClipPath->boundingRect())); -- m_blContext->setMatrix(matrix); -+ m_blContext->setTransform(matrix); - } - else - { diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Fix-translation-install-path-on-nix.patch b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Fix-translation-install-path-on-nix.patch new file mode 100644 index 0000000000..14d538407a --- /dev/null +++ b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Fix-translation-install-path-on-nix.patch @@ -0,0 +1,102 @@ +From a577eebae0aa1b73dd0f6baf7ba6e3836c5a158a Mon Sep 17 00:00:00 2001 +From: Alexander Golubev <[email protected]> +Date: Wed, 23 Jul 2025 20:38:29 +0300 +Subject: [PATCH 5/5] Fix translation install path on *nix + +On *nix translations canonically go into <prefix>/share/<project_name> +rather than <prefix>/bin. + +Signed-off-by: Alexander Golubev <[email protected]> +--- + CMakeLists.txt | 15 +++++++++------ + .../sources/pdfapplicationtranslator.cpp | 4 +++- + config.h.cmake | 1 + + 3 files changed, 13 insertions(+), 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e4821ef..5061e79 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -134,14 +134,19 @@ endif() + + if(PDF4QT_LINUX) + set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdf4qt) ++ set(PDF4QT_INSTALL_TRANS_DIR ${PDF4QT_INSTALL_SHARE_DIR}/pdf4qt/translations) + else() + set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdfplugins) ++ set(PDF4QT_INSTALL_TRANS_DIR ${PDF4QT_INSTALL_BIN_DIR}/translations) + endif() + + # Relative paths are used by the config + cmake_path(RELATIVE_PATH PDF4QT_PLUGINS_DIR + BASE_DIRECTORY "${PDF4QT_INSTALL_BIN_DIR}" + OUTPUT_VARIABLE PDF4QT_PLUGINS_RELATIVE_PATH) ++cmake_path(RELATIVE_PATH PDF4QT_INSTALL_TRANS_DIR ++ BASE_DIRECTORY "${PDF4QT_INSTALL_BIN_DIR}" ++ OUTPUT_VARIABLE PDF4QT_TRANSLATIONS_RELATIVE_PATH) + configure_file(config.h.cmake config.h) + + add_subdirectory(Pdf4QtLibCore) +@@ -171,7 +176,7 @@ qt_collect_translation_source_targets(i18n_targets) + message("CMAKE_TRANSLATION_TARGETS = " ${i18n_targets}) + + set(PDF4QT_TRANSLATION_TS_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/translations) +-set(PDF4QT_TRANSLATION_QM_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}/translations) ++set(PDF4QT_TRANSLATION_QM_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_TRANS_DIR}) + + message("PDF4QT_TRANSLATION_TS_OUTPUT_DIRECTORY" ${PDF4QT_TRANSLATION_TS_OUTPUT_DIRECTORY}) + message("PDF4QT_TRANSLATION_QM_OUTPUT_DIRECTORY" ${PDF4QT_TRANSLATION_QM_OUTPUT_DIRECTORY}) +@@ -181,7 +186,7 @@ qt_add_translations(TARGETS Pdf4QtEditor Pdf4QtViewer Pdf4QtPageMaster Pdf4QtDif + MERGE_QT_TRANSLATIONS + TS_OUTPUT_DIRECTORY ${PDF4QT_TRANSLATION_TS_OUTPUT_DIRECTORY} + QM_OUTPUT_DIRECTORY ${PDF4QT_TRANSLATION_QM_OUTPUT_DIRECTORY} +- QM_FILES_OUTPUT_VARIABLE pdf4qt_qm_files) ++ QM_FILES_OUTPUT_VARIABLE PDF4QT_QM_FILES) + + message("CMAKE_PREFIX_PATH = " ${CMAKE_PREFIX_PATH}) + message("CMAKE_TOOLCHAIN_FILE = " ${CMAKE_TOOLCHAIN_FILE}) +@@ -189,10 +194,8 @@ message("CMAKE_TOOLCHAIN_FILE = " ${CMAKE_TOOLCHAIN_FILE}) + configure_file(version.txt.in version.txt) + + if(NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY) +- install(DIRECTORY ${PDF4QT_TRANSLATION_QM_OUTPUT_DIRECTORY} +- RUNTIME DESTINATION ${PDF4QT_INSTALL_BIN_DIR} +- FILES_MATCHING +- PATTERN *.qm) ++ install(FILES ${PDF4QT_QM_FILES} ++ DESTINATION ${PDF4QT_INSTALL_TRANS_DIR}) + + if(WIN32) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Desktop/44x44/ +diff --git a/Pdf4QtLibCore/sources/pdfapplicationtranslator.cpp b/Pdf4QtLibCore/sources/pdfapplicationtranslator.cpp +index 89707f3..5faef08 100644 +--- a/Pdf4QtLibCore/sources/pdfapplicationtranslator.cpp ++++ b/Pdf4QtLibCore/sources/pdfapplicationtranslator.cpp +@@ -27,6 +27,8 @@ + #include <QMetaEnum> + #include <QCoreApplication> + ++#include "config.h" ++ + namespace pdf + { + +@@ -48,7 +50,7 @@ PDFApplicationTranslator::ELanguage PDFApplicationTranslator::getLanguage() cons + void PDFApplicationTranslator::installTranslator() + { + QDir applicationDirectory(QCoreApplication::applicationDirPath()); +- applicationDirectory.cd("translations"); ++ applicationDirectory.cd(PDF4QT_TRANSLATIONS_RELATIVE_PATH); + QString translationPath = applicationDirectory.absolutePath(); + + Q_ASSERT(!m_translator); +diff --git a/config.h.cmake b/config.h.cmake +index 3d68799..30325bb 100644 +--- a/config.h.cmake ++++ b/config.h.cmake +@@ -1 +1,2 @@ + #define PDF4QT_PLUGINS_RELATIVE_PATH "@PDF4QT_PLUGINS_RELATIVE_PATH@" ++#define PDF4QT_TRANSLATIONS_RELATIVE_PATH "@PDF4QT_TRANSLATIONS_RELATIVE_PATH@" +-- +2.49.1 + diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Make-building-of-tests-optional.patch b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Make-building-of-tests-optional.patch new file mode 100644 index 0000000000..95a75e9ee7 --- /dev/null +++ b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Make-building-of-tests-optional.patch @@ -0,0 +1,67 @@ +From 2fb17775ac879e41e1b6f8a9f24bc28651c6df15 Mon Sep 17 00:00:00 2001 +From: Alexander Golubev <[email protected]> +Date: Mon, 11 Nov 2024 19:04:44 +0300 +Subject: [PATCH 3/5] Make building of tests optional + +--- + CMakeLists.txt | 13 +++++++++++-- + UnitTests/CMakeLists.txt | 1 + + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fed05c6..bc16b59 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,6 +39,7 @@ if(WIN32 AND MSVC) + endif() + + option(PDF4QT_BUILD_ONLY_CORE_LIBRARY "Build only core library" OFF) ++option(PDF4QT_BUILD_TESTS "Build UnitTests" ON) + + set(PDF4QT_QT_ROOT "" CACHE PATH "Qt root directory") + +@@ -56,7 +57,11 @@ find_package(Qt6 REQUIRED COMPONENTS Core LinguistTools) + if(PDF4QT_BUILD_ONLY_CORE_LIBRARY) + find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Xml) + else() +- find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport TextToSpeech Test) ++ find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport TextToSpeech) ++endif() ++ ++if(PDF4QT_BUILD_TESTS) ++ find_package(Qt6 REQUIRED COMPONENTS Test) + endif() + + qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES en de cs es ko) +@@ -135,7 +140,6 @@ if(NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY) + add_subdirectory(JBIG2_Viewer) + add_subdirectory(PdfExampleGenerator) + add_subdirectory(PdfTool) +- add_subdirectory(UnitTests) + add_subdirectory(Pdf4QtLibGui) + add_subdirectory(Pdf4QtEditorPlugins) + add_subdirectory(Pdf4QtEditor) +@@ -146,6 +150,11 @@ if(NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY) + add_subdirectory(WixInstaller) + endif() + ++if(PDF4QT_BUILD_TESTS) ++ enable_testing() ++ add_subdirectory(UnitTests) ++endif() ++ + qt_collect_translation_source_targets(i18n_targets) + message("CMAKE_TRANSLATION_TARGETS = " ${i18n_targets}) + +diff --git a/UnitTests/CMakeLists.txt b/UnitTests/CMakeLists.txt +index c1a912f..9f64ec8 100644 +--- a/UnitTests/CMakeLists.txt ++++ b/UnitTests/CMakeLists.txt +@@ -32,3 +32,4 @@ set_target_properties(UnitTests PROPERTIES + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_LIB_DIR} + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR} + ) ++add_test(UnitTests "${CMAKE_BINARY_DIR}/${PDF4QT_INSTALL_BIN_DIR}/UnitTests") +-- +2.49.1 + diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch new file mode 100644 index 0000000000..181eda7b14 --- /dev/null +++ b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch @@ -0,0 +1,103 @@ +From 25c123fdfa0b92841de35963a5663b719f0c8645 Mon Sep 17 00:00:00 2001 +From: Alexander Golubev <[email protected]> +Date: Mon, 11 Nov 2024 18:15:32 +0300 +Subject: [PATCH 4/5] Make runtime respect cmake's plugin dir settings + +This fixes plugin lookup on linux where plugins were installed into +<prefix>/lib/pdf4qt but were expected at <prefix>/pdfplugins. +--- + CMakeLists.txt | 12 ++++++++++++ + Pdf4QtEditorPlugins/CMakeLists.txt | 6 ------ + Pdf4QtLibGui/pdfprogramcontroller.cpp | 16 +++------------- + config.h.cmake | 1 + + 4 files changed, 16 insertions(+), 19 deletions(-) + create mode 100644 config.h.cmake + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bc16b59..e4821ef 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -132,6 +132,18 @@ else() + set(PDF4QT_INSTALL_SHARE_DIR share) + endif() + ++if(PDF4QT_LINUX) ++ set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdf4qt) ++else() ++ set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdfplugins) ++endif() ++ ++# Relative paths are used by the config ++cmake_path(RELATIVE_PATH PDF4QT_PLUGINS_DIR ++ BASE_DIRECTORY "${PDF4QT_INSTALL_BIN_DIR}" ++ OUTPUT_VARIABLE PDF4QT_PLUGINS_RELATIVE_PATH) ++configure_file(config.h.cmake config.h) ++ + add_subdirectory(Pdf4QtLibCore) + + if(NOT PDF4QT_BUILD_ONLY_CORE_LIBRARY) +diff --git a/Pdf4QtEditorPlugins/CMakeLists.txt b/Pdf4QtEditorPlugins/CMakeLists.txt +index 33019ca..26e2615 100644 +--- a/Pdf4QtEditorPlugins/CMakeLists.txt ++++ b/Pdf4QtEditorPlugins/CMakeLists.txt +@@ -20,12 +20,6 @@ + # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + # SOFTWARE. + +-if(PDF4QT_LINUX) +- set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdf4qt) +-else() +- set(PDF4QT_PLUGINS_DIR ${PDF4QT_INSTALL_LIB_DIR}/pdfplugins) +-endif() +- + add_subdirectory(AudioBookPlugin) + add_subdirectory(DimensionsPlugin) + add_subdirectory(ObjectInspectorPlugin) +diff --git a/Pdf4QtLibGui/pdfprogramcontroller.cpp b/Pdf4QtLibGui/pdfprogramcontroller.cpp +index 937b6f1..25ca44c 100644 +--- a/Pdf4QtLibGui/pdfprogramcontroller.cpp ++++ b/Pdf4QtLibGui/pdfprogramcontroller.cpp +@@ -71,6 +71,8 @@ + #include <windows.h> + #endif + ++#include "config.h" ++ + #if defined(PDF4QT_USE_PRAGMA_LIB) + #pragma comment(lib, "Shell32") + #endif +@@ -2165,23 +2167,11 @@ void PDFProgramController::updatePageLayoutActions() + void PDFProgramController::loadPlugins() + { + QStringList availablePlugins; +- ++ QDir directory(QApplication::applicationDirPath() + "/" PDF4QT_PLUGINS_RELATIVE_PATH); + #if defined(Q_OS_WIN) +- QDir directory(QApplication::applicationDirPath() + "/pdfplugins"); + availablePlugins = directory.entryList(QStringList("*.dll")); + #elif defined(Q_OS_UNIX) +-#ifndef NDEBUG +- QDir directory(QApplication::applicationDirPath() + "/../pdfplugins"); + availablePlugins = directory.entryList(QStringList("*.so")); +-#else +- QDir directory(QApplication::applicationDirPath()); +- if (directory.cdUp() && +- directory.cd("lib") && +- directory.cd("pdf4qt")) +- { +- availablePlugins = directory.entryList(QStringList("*.so")); +- } +-#endif + #else + static_assert(false, "Implement this for another OS!"); + #endif +diff --git a/config.h.cmake b/config.h.cmake +new file mode 100644 +index 0000000..3d68799 +--- /dev/null ++++ b/config.h.cmake +@@ -0,0 +1 @@ ++#define PDF4QT_PLUGINS_RELATIVE_PATH "@PDF4QT_PLUGINS_RELATIVE_PATH@" +-- +2.49.1 + diff --git a/media-gfx/pdf4qt/files/pdf4qt-1.5.0.0-Minimal-cmake-fixes.patch b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Minimal-cmake-fixes.patch similarity index 80% rename from media-gfx/pdf4qt/files/pdf4qt-1.5.0.0-Minimal-cmake-fixes.patch rename to media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Minimal-cmake-fixes.patch index 524d216b48..96269bf4a3 100644 --- a/media-gfx/pdf4qt/files/pdf4qt-1.5.0.0-Minimal-cmake-fixes.patch +++ b/media-gfx/pdf4qt/files/pdf4qt-1.5.1.0-Minimal-cmake-fixes.patch @@ -1,7 +1,7 @@ -From 4cc5cf70d017030c9e016587e1182060f64429f2 Mon Sep 17 00:00:00 2001 +From 42887fb8136b362637db318907b78128b13c251a Mon Sep 17 00:00:00 2001 From: Alexander Golubev <[email protected]> Date: Fri, 8 Nov 2024 23:07:36 +0300 -Subject: [PATCH 2/2] Minimal cmake fixes +Subject: [PATCH 1/5] Minimal cmake fixes --- CMakeLists.txt | 3 +-- @@ -9,18 +9,18 @@ Subject: [PATCH 2/2] Minimal cmake fixes 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index ea5518d..cb8219c 100644 +index b943d3f..fed05c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -55,7 +55,6 @@ endif() - qt_standard_project_setup() +@@ -62,7 +62,6 @@ endif() + qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES en de cs es ko) find_package(OpenSSL REQUIRED) -find_package(lcms2 REQUIRED) find_package(ZLIB REQUIRED) find_package(Freetype REQUIRED) find_package(OpenJPEG CONFIG REQUIRED) -@@ -92,7 +91,7 @@ endif() +@@ -99,7 +98,7 @@ endif() option(PDF4QT_INSTALL_TO_USR "Install to usr directory" ON) if(PDF4QT_LINUX) @@ -30,10 +30,10 @@ index ea5518d..cb8219c 100644 # Check if VCPKG_OVERLAY_PORTS is set as an environment variable or a CMake argument diff --git a/Pdf4QtLibCore/CMakeLists.txt b/Pdf4QtLibCore/CMakeLists.txt -index e930b23..2c46c96 100644 +index f3436e0..7c719ce 100644 --- a/Pdf4QtLibCore/CMakeLists.txt +++ b/Pdf4QtLibCore/CMakeLists.txt -@@ -162,7 +162,7 @@ GENERATE_EXPORT_HEADER(Pdf4QtLibCore +@@ -170,7 +170,7 @@ GENERATE_EXPORT_HEADER(Pdf4QtLibCore EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}/pdf4qtlibcore_export.h") target_link_libraries(Pdf4QtLibCore PRIVATE Qt6::Core Qt6::Gui Qt6::Xml Qt6::Svg) @@ -43,5 +43,5 @@ index e930b23..2c46c96 100644 target_link_libraries(Pdf4QtLibCore PRIVATE ZLIB::ZLIB) target_link_libraries(Pdf4QtLibCore PRIVATE Freetype::Freetype) -- -2.45.2 +2.49.1 diff --git a/media-gfx/pdf4qt/pdf4qt-1.4.0.0-r1.ebuild b/media-gfx/pdf4qt/pdf4qt-1.4.0.0-r1.ebuild deleted file mode 100644 index f78ba3f6e8..0000000000 --- a/media-gfx/pdf4qt/pdf4qt-1.4.0.0-r1.ebuild +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 -inherit cmake xdg-utils - -DESCRIPTION="Open source PDF WYSIWYG editor based on Qt" -HOMEPAGE="https://jakubmelka.github.io/" -MY_PN="${PN^^}" -if [[ ${PV} == 9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/JakubMelka/${MY_PN}" -else - MY_P="${MY_PN}-${PV}" - SRC_URI="https://github.com/JakubMelka/${MY_PN}/archive/refs/tags/v${PV}.tar.gz - -> ${MY_P}.tar.gz" - KEYWORDS="~amd64" - S=${WORKDIR}/${MY_P} -fi - -LICENSE="LGPL-3+" -SLOT="0" - -RDEPEND=" - dev-cpp/tbb:= - dev-libs/openssl - dev-qt/qtbase:6[gui,widgets,xml] - dev-qt/qtspeech:6 - dev-qt/qtsvg:6 - media-libs/blend2d - media-libs/freetype - media-libs/lcms - media-libs/libjpeg-turbo - media-libs/openjpeg - sys-libs/zlib -" -DEPEND="$RDEPEND" - -DOCS=( NOTES.txt README.md RELEASES.txt ) -PATCHES=( - "${FILESDIR}/pdf4qt-1.4.0.0-fix-build-failure-on-resetMatrix.patch" - "${FILESDIR}/pdf4qt-1.4.0.0-minor-fix-remove-extention-from-Icon-endtry-in-a-des.patch" - "${FILESDIR}/pdf4qt-1.4.0.0-Minimal-cmake-fixes.patch" - "${FILESDIR}/pdf4qt-1.4.0.0-Disable-test-building.patch" - "${FILESDIR}/pdf4qt-1.4.0.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch" -) - -src_configure() { - local mycmakeargs=( - -DPDF4QT_INSTALL_DEPENDENCIES=OFF - -DPDF4QT_INSTALL_TO_USR=OFF - -DVCPKG_OVERLAY_PORTS="" # suppress a warning - ) - cmake_src_configure -} - -pkg_postinst() { - xdg_icon_cache_update - xdg_desktop_database_update -} - -pkg_postrm() { - xdg_icon_cache_update - xdg_desktop_database_update -} diff --git a/media-gfx/pdf4qt/pdf4qt-1.5.0.0.ebuild b/media-gfx/pdf4qt/pdf4qt-1.5.1.0.ebuild similarity index 80% rename from media-gfx/pdf4qt/pdf4qt-1.5.0.0.ebuild rename to media-gfx/pdf4qt/pdf4qt-1.5.1.0.ebuild index 535eb9e5f1..1c391f0589 100644 --- a/media-gfx/pdf4qt/pdf4qt-1.5.0.0.ebuild +++ b/media-gfx/pdf4qt/pdf4qt-1.5.1.0.ebuild @@ -18,7 +18,7 @@ else S=${WORKDIR}/${MY_P} fi -LICENSE="LGPL-3+" +LICENSE="MIT" SLOT="0" IUSE="test" RESTRICT="!test? ( test )" @@ -44,24 +44,16 @@ DOCS=( NOTES.txt README.md RELEASES.txt ) PATCHES=( "${FILESDIR}/${PN}-1.4.0.0-minor-fix-remove-extention-from-Icon-endtry-in-a-des.patch" "${FILESDIR}/${P}-Minimal-cmake-fixes.patch" - "${FILESDIR}/${PN}-1.4.0.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch" + "${FILESDIR}/${P}-Make-building-of-tests-optional.patch" + "${FILESDIR}/${P}-Make-runtime-respect-cmake-s-plugin-dir-settings.patch" + "${FILESDIR}/${P}-Fix-translation-install-path-on-nix.patch" ) -src_prepare() { - cmake_src_prepare - - # Conditionally dissable test build - if ! use test; then - sed -i -e '/find_package(Qt6/s/Test//' \ - -e '/add_subdirectory(UnitTests)/d' \ - CMakeLists.txt || die - fi -} - src_configure() { local mycmakeargs=( -DPDF4QT_INSTALL_DEPENDENCIES=OFF -DPDF4QT_INSTALL_TO_USR=OFF + -DPDF4QT_BUILD_TESTS="$(usex test)" -DVCPKG_OVERLAY_PORTS="" # suppress a warning ) cmake_src_configure diff --git a/media-gfx/pdf4qt/pdf4qt-9999.ebuild b/media-gfx/pdf4qt/pdf4qt-9999.ebuild index db93c0f70f..9406e160ae 100644 --- a/media-gfx/pdf4qt/pdf4qt-9999.ebuild +++ b/media-gfx/pdf4qt/pdf4qt-9999.ebuild @@ -18,7 +18,7 @@ else S=${WORKDIR}/${MY_P} fi -LICENSE="LGPL-3+" +LICENSE="MIT" SLOT="0" IUSE="test" RESTRICT="!test? ( test )" @@ -42,27 +42,16 @@ DEPEND="$RDEPEND DOCS=( NOTES.txt README.md RELEASES.txt ) PATCHES=( - "${FILESDIR}/pdf4qt-1.4.0.0-minor-fix-remove-extention-from-Icon-endtry-in-a-des.patch" - "${FILESDIR}/pdf4qt-1.5.0.0-Minimal-cmake-fixes.patch" - "${FILESDIR}/pdf4qt-1.4.0.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch" + "${FILESDIR}/${PN}-1.5.1.0-Make-building-of-tests-optional.patch" + "${FILESDIR}/${PN}-1.5.1.0-Make-runtime-respect-cmake-s-plugin-dir-settings.patch" + "${FILESDIR}/${PN}-1.5.1.0-Fix-translation-install-path-on-nix.patch" ) -src_prepare() { - cmake_src_prepare - - # Conditionally dissable test build - if ! use test; then - sed -i -e '/find_package(Qt6/s/Test//' \ - -e '/add_subdirectory(UnitTests)/d' \ - CMakeLists.txt || die - fi -} - src_configure() { local mycmakeargs=( -DPDF4QT_INSTALL_DEPENDENCIES=OFF -DPDF4QT_INSTALL_TO_USR=OFF - -DVCPKG_OVERLAY_PORTS="" # suppress a warning + -DPDF4QT_BUILD_TESTS="$(usex test)" ) cmake_src_configure }
