diff --git a/kde-apps/okular/okular_kf6-24.12.3.recipe b/kde-apps/okular/okular_kf6-24.12.3.recipe new file mode 100644 index 000000000..b47df3c1f --- /dev/null +++ b/kde-apps/okular/okular_kf6-24.12.3.recipe @@ -0,0 +1,189 @@ +SUMMARY="Universal document viewer based on KDE Frameworks" +DESCRIPTION="Okular is a universal document viewer developed by KDE. Okular works on multiple \ +platforms, including but not limited to Linux, Windows, Mac OS X, *BSD, etc. + +Features: +* Supported Formats: PDF, PS, Tiff, CHM, DjVu, Images, DVI, XPS, ODT, Fiction Book, Comic Book, \ +Plucker, EPub, Fax +* Sidebar with contents, thumbnails, reviews and bookmarks +* Annotations support" +HOMEPAGE="https://okular.kde.org" +COPYRIGHT="2010-2025 KDE Organisation" +LICENSE="GNU LGPL v2" +REVISION="1" +SOURCE_URI="https://download.kde.org/stable/release-service/$portVersion/src/okular-$portVersion.tar.xz" +CHECKSUM_SHA256="8d0894dc006b715dec2d8d57c228b8a9d5d9488e3144dd1af93b3b8363e466a0" +SOURCE_DIR="okular-$portVersion" +PATCHES="okular-$portVersion.patchset" +ADDITIONAL_FILES="okular.rdef.in" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +libVersion="3.0.0" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + +PROVIDES=" + okular_kf6$secondaryArchSuffix = $portVersion + app:Okular$secondaryArchSuffix = $portVersion + lib:libOkular6Core$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libdjvulibre$secondaryArchSuffix + lib:libepub$secondaryArchSuffix + lib:libKExiv2Qt6$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libmarkdown$secondaryArchSuffix + lib:libphonon4Qt6$secondaryArchSuffix + lib:libpoppler_Qt6$secondaryArchSuffix + lib:libQMobipocket6$secondaryArchSuffix + lib:libspectre$secondaryArchSuffix + lib:libtiff$secondaryArchSuffix + lib:libz$secondaryArchSuffix + # KF6 + lib:libKF6Archive$secondaryArchSuffix + lib:libKF6Bookmarks$secondaryArchSuffix + lib:libKF6ColorScheme$secondaryArchSuffix + lib:libKF6Completion$secondaryArchSuffix + lib:libKF6ConfigCore$secondaryArchSuffix + lib:libKF6ConfigWidgets$secondaryArchSuffix + lib:libKF6CoreAddons$secondaryArchSuffix + lib:libKF6Crash$secondaryArchSuffix + lib:libKF6GuiAddons$secondaryArchSuffix + lib:libKF6I18n$secondaryArchSuffix + lib:libKF6IconThemes$secondaryArchSuffix + lib:libKF6JobWidgets$secondaryArchSuffix + lib:libKF6KIOCore$secondaryArchSuffix + lib:libKF6Parts$secondaryArchSuffix + lib:libKF6Service$secondaryArchSuffix + lib:libKF6Solid$secondaryArchSuffix + lib:libKF6ThreadWeaver$secondaryArchSuffix + lib:libKF6WidgetsAddons$secondaryArchSuffix + lib:libKF6WindowSystem$secondaryArchSuffix + lib:libKF6XmlGui$secondaryArchSuffix + # Qt6 + lib:libQt6Core$secondaryArchSuffix + lib:libQt6DBus$secondaryArchSuffix + lib:libQt6Gui$secondaryArchSuffix + lib:libQt6Network$secondaryArchSuffix + lib:libQt6PrintSupport$secondaryArchSuffix + lib:libQt6Qml$secondaryArchSuffix + lib:libQt6Svg$secondaryArchSuffix + lib:libQt6Widgets$secondaryArchSuffix + lib:libQt6Xml$secondaryArchSuffix + " + +PROVIDES_devel=" + okular_kf6${secondaryArchSuffix}_devel = $portVersion + devel:libOkular6Core$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + okular_kf6$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libdjvulibre$secondaryArchSuffix + devel:libepub$secondaryArchSuffix + devel:libKExiv2Qt6$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix + devel:libmarkdown$secondaryArchSuffix + devel:libphonon4Qt6$secondaryArchSuffix + devel:libpoppler$secondaryArchSuffix >= 146 + devel:libpoppler_Qt6$secondaryArchSuffix >= 3.4.0 + devel:libQMobipocket6$secondaryArchSuffix + devel:libspectre$secondaryArchSuffix + devel:libtiff$secondaryArchSuffix + devel:libz$secondaryArchSuffix + # KF6 + extra_cmake_modules$secondaryArchSuffix + devel:libKF6Archive$secondaryArchSuffix + devel:libKF6Bookmarks$secondaryArchSuffix + devel:libKF6Completion$secondaryArchSuffix + devel:libKF6ConfigCore$secondaryArchSuffix + devel:libKF6ConfigWidgets$secondaryArchSuffix + devel:libKF6CoreAddons$secondaryArchSuffix + devel:libKF6Crash$secondaryArchSuffix + devel:libKF6DocTools$secondaryArchSuffix + devel:libKF6GuiAddons$secondaryArchSuffix + devel:libKF6I18n$secondaryArchSuffix + devel:libKF6IconThemes$secondaryArchSuffix + devel:libKF6KIOCore$secondaryArchSuffix + devel:libKF6Parts$secondaryArchSuffix + devel:libKF6Purpose$secondaryArchSuffix + devel:libKF6TextWidgets$secondaryArchSuffix + devel:libKF6ThreadWeaver$secondaryArchSuffix + devel:libKF6WidgetsAddons$secondaryArchSuffix + devel:libKF6XmlGui$secondaryArchSuffix + # Qt6 + devel:libQt6Core$secondaryArchSuffix + devel:libQt6Svg$secondaryArchSuffix + devel:libQt6TextToSpeech$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:g++$secondaryArchSuffix + cmd:make + cmd:msgfmt$secondaryArchSuffix + cmd:msgmerge$secondaryArchSuffix + cmd:pkg_config$secondaryArchSuffix + " + +PATCH() +{ + # disable docs generation + sed -e '/ add_subdirectory(doc)/ s/^#*/#/' -i CMakeLists.txt + sed -e '/ kdoctools_install(po)/ s/^#*/#/' -i CMakeLists.txt +} + +BUILD() +{ + export LDFLAGS="-lbsd" + + cmake -B build -S . -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS="-D_BSD_SOURCE -D_GNU_SOURCE" \ + -DCMAKE_CXX_FLAGS="-D_BSD_SOURCE -D_GNU_SOURCE" \ + $cmakeDirArgs \ + -DCMAKE_INSTALL_BINDIR=$appsDir \ + -DCMAKE_INSTALL_DATAROOTDIR=$dataDir \ + -DKDE_INSTALL_PLUGINDIR=$addOnsDir/Qt6 \ + -DECM_DIR=/system/data/cmake/Modules/ECM/cmake \ + -Wno-dev + + make -C build $jobArgs +} + +INSTALL() +{ + make -C build install + + mv $appsDir/okular $appsDir/Okular + + # cleanup + rm -rf $dataDir/{applications,config.kcfg,icons,kconf_update,metainfo,qlogging-categories6} + + prepareInstalledDevelLib \ + libOkular6Core + + packageEntries devel \ + $developDir \ + $libDir/cmake + + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + local LONG_INFO="$SUMMARY" + local APP_SIGNATURE="application/x-vnd.kde-okular" + sed \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + $portDir/additional-files/okular.rdef.in > okular.rdef + + addResourcesToBinaries okular.rdef $appsDir/Okular + addAppDeskbarSymlink $appsDir/Okular +} diff --git a/kde-apps/okular/patches/okular-24.12.3.patchset b/kde-apps/okular/patches/okular-24.12.3.patchset new file mode 100644 index 000000000..391cd0675 --- /dev/null +++ b/kde-apps/okular/patches/okular-24.12.3.patchset @@ -0,0 +1,107 @@ +From fb0aa36bbc5a835e122ab6bd919f1432445d133f Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Wed, 11 May 2022 19:29:57 +1000 +Subject: Fix build for x86 + + +diff --git a/generators/tiff/generator_tiff.cpp b/generators/tiff/generator_tiff.cpp +index 1fce24c..fdea096 100644 +--- a/generators/tiff/generator_tiff.cpp ++++ b/generators/tiff/generator_tiff.cpp +@@ -243,7 +243,7 @@ QImage TIFFGenerator::image(Okular::PixmapRequest *request) + } + + QImage image(width, height, QImage::Format_RGB32); +- uint32_t *data = reinterpret_cast(image.bits()); ++ uint32 *data = reinterpret_cast(image.bits()); + + // read data + if (TIFFReadRGBAImageOriented(d->tiff, width, height, data, orientation) != 0) { +@@ -373,7 +373,7 @@ Okular::Document::PrintError TIFFGenerator::print(QPrinter &printer) + } + + QImage image(width, height, QImage::Format_RGB32); +- uint32_t *data = reinterpret_cast(image.bits()); ++ uint32 *data = reinterpret_cast(image.bits()); + + // read data + if (TIFFReadRGBAImageOriented(d->tiff, width, height, data, ORIENTATION_TOPLEFT) != 0) { +-- +2.48.1 + + +From ff5364303c70db416efda917f04a277f42fee8b2 Mon Sep 17 00:00:00 2001 +From: Begasus +Date: Mon, 24 Feb 2025 09:39:11 +0100 +Subject: Disable KF6Wallet, KF6Pty on Haiku + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b8dd450..94d4a6d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -122,7 +122,7 @@ find_package(KF6 ${KF_REQUIRED_VERSION} REQUIRED COMPONENTS + XmlGui + ) + +-if (NOT WIN32) ++if (NOT WIN32 AND NOT HAIKU) + find_package(KF6Wallet ${KF_REQUIRED_VERSION}) + set_okular_optional_package_properties(KF6Wallet PROPERTIES + PURPOSE "Required for document storing passwords in secure wallets.") +diff --git a/generators/comicbook/CMakeLists.txt b/generators/comicbook/CMakeLists.txt +index fcc23b9..af78e8a 100644 +--- a/generators/comicbook/CMakeLists.txt ++++ b/generators/comicbook/CMakeLists.txt +@@ -16,7 +16,7 @@ set_target_properties(okular_comicbook PROPERTIES POSITION_INDEPENDENT_CODE ON) + + okular_add_generator(okularGenerator_comicbook generator_comicbook.cpp) + target_link_libraries(okularGenerator_comicbook okular_comicbook) +-if (UNIX AND NOT ANDROID) ++if (UNIX AND NOT ANDROID AND NOT HAIKU) + find_package(KF6Pty REQUIRED) + target_compile_definitions(okular_comicbook PRIVATE -DWITH_KPTY=1) + target_link_libraries(okular_comicbook KF6::Pty) +-- +2.48.1 + + +From baf2211fef682f01f984697fdbf32f6e40b58872 Mon Sep 17 00:00:00 2001 +From: Luc Schrijvers +Date: Tue, 25 Mar 2025 09:18:34 +0100 +Subject: Use system colors/icons + + +diff --git a/part/part.cpp b/part/part.cpp +index b946b8f..eb63a21 100644 +--- a/part/part.cpp ++++ b/part/part.cpp +@@ -838,9 +838,11 @@ void Part::setupActions() + { + KActionCollection *ac = actionCollection(); + ++#ifndef Q_OS_HAIKU + auto manager = new KColorSchemeManager(this); + KActionMenu *schemeMenu = KColorSchemeMenu::createMenu(manager, this); + ac->addAction(QStringLiteral("colorscheme_menu"), schemeMenu->menu()->menuAction()); ++#endif + + m_copy = KStandardAction::create(KStandardAction::Copy, m_pageView, SLOT(copyTextSelection()), ac); + +diff --git a/shell/main.cpp b/shell/main.cpp +index d98af8c..aa15f8b 100644 +--- a/shell/main.cpp ++++ b/shell/main.cpp +@@ -37,7 +37,9 @@ int main(int argc, char **argv) + * trigger initialisation of proper icon theme + */ + #if KICONTHEMES_VERSION >= QT_VERSION_CHECK(6, 3, 0) ++#ifndef Q_OS_HAIKU + KIconTheme::initTheme(); ++#endif + #endif + + /** +-- +2.48.1 +