From 081018bdd0c370246529cec262fb9616cc53f0c2 Mon Sep 17 00:00:00 2001 From: Fincer Date: Fri, 17 Mar 2017 22:52:11 +0200 Subject: [PATCH] Add Microsoft Office OOXML thumbnailer (Plasma 5 version) --- Readme.md | 17 +++++++++ kde-thumbnailer-ooxml-kf5/PKGBUILD | 40 ++++++++++++++++++++ kde-thumbnailer-ooxml-kf5/port-to-qt5.patch | 42 +++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 kde-thumbnailer-ooxml-kf5/PKGBUILD create mode 100644 kde-thumbnailer-ooxml-kf5/port-to-qt5.patch diff --git a/Readme.md b/Readme.md index 326118f..e4258d5 100644 --- a/Readme.md +++ b/Readme.md @@ -123,6 +123,23 @@ Plasma 5 Dolphin service menu script for hacking and breaking PDF password prote FORMAT: Arch Linux PKGBUILD script. +**kde-thumbnailer-ooxml-kf5** +-------------- + +Plasma 5 thumbnailer for Microsoft Office Open XML Documents. + +According to the developer: + +*This plugin should support all ooxml documents with thumbnails saved, including docx pptx ppsx xlsx files. However, most docx and xlsx documents do not have thumbnail image saved along with document body, you may not see the previews.* + +*It only depends on qt and kde library. It is shipped with internal libkowmf copy for rendering wmf graphics from calligra suite. You do not need any office suite installed to make this plugin work.* + +Homepage: + +[KDE Office Open XML Document Thumbnailer](https://www.linux-apps.com/content/show.php?content=149048) + +FORMAT: Arch Linux PKGBUILD script + a patch file. + **kdegraphics-dreamdesktop** -------------- diff --git a/kde-thumbnailer-ooxml-kf5/PKGBUILD b/kde-thumbnailer-ooxml-kf5/PKGBUILD new file mode 100644 index 0000000..4d9e53e --- /dev/null +++ b/kde-thumbnailer-ooxml-kf5/PKGBUILD @@ -0,0 +1,40 @@ +_pkgname=kde-thumbnailer-ooxml +pkgname=${_pkgname}-kf5 +pkgver=1.1 +pkgrel=1 +pkgdesc="Microsoft Office Open XML document thumbnailer for KDE" +url="http://kde-apps.org/content/show.php?content=149048" +arch=('i686' 'x86_64') +license=('GPL' 'LGPL' 'FDL') +groups=('kde' 'kdegraphics') +depends=('kdelibs4support' 'zlib') +makedepends=('cmake' 'extra-cmake-modules' 'kdoctools' 'qt5-tools' 'kdesignerplugin') +source=("https://dl.opendesktop.org/api/files/download/id/1460971619/149048-kde-thumbnailer-ooxml-1.1.tar.bz2" +port-to-qt5.patch) +sha1sums=('445acee9c3f78077a70944cba2253432849d6d8e' + '3ac44a6954ca77aa238af845e846566c9ba761b3') + +prepare() { + cd "${srcdir}"/${_pkgname} + rm -rf build + mkdir -p build + patch -Np1 -i $srcdir/port-to-qt5.patch +} + +build() { + mkdir build + cd build + cd "${srcdir}"/${_pkgname} + cmake -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_INSTALL_DIR=lib \ + -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \ + -DSYSCONF_INSTALL_DIR=/etc \ + -DBUILD_TESTING=OFF + make +} + +package() { + cd "${srcdir}"/${_pkgname} + make DESTDIR="${pkgdir}" install +} diff --git a/kde-thumbnailer-ooxml-kf5/port-to-qt5.patch b/kde-thumbnailer-ooxml-kf5/port-to-qt5.patch new file mode 100644 index 0000000..a93964d --- /dev/null +++ b/kde-thumbnailer-ooxml-kf5/port-to-qt5.patch @@ -0,0 +1,42 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,21 @@ + project(kde-thumbnailer-ooxml) +-cmake_minimum_required(VERSION 2.6) ++cmake_minimum_required(VERSION 2.8.12) + +-find_package(KDE4 REQUIRED) +-include(KDE4Defaults) ++set(SHARED_MIME_INFO_MINIMUM_VERSION "0.30") + +-add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) +-include_directories(${QT_INCLUDES} ${KDE4_INCLUDES}) ++find_package(ECM REQUIRED NO_MODULE) ++set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) ++ ++include(KDEInstallDirs) ++include(KDECompilerSettings) ++include(KDECMakeSettings) ++include(FeatureSummary) ++ ++find_package(Qt5 REQUIRED COMPONENTS Widgets) ++find_package(KF5 REQUIRED COMPONENTS KDELibs4Support KIO Archive) ++ ++add_definitions(${QT_DEFINITIONS}) ++include_directories(${QT_INCLUDES}) + + set(libkowmf_SRCS + libkowmf/WmfAbstractBackend.cpp +@@ -17,9 +27,9 @@ + + set(ooxmlthumbnail_SRCS ooxmlcreator.cpp ${libkowmf_SRCS}) + +-kde4_add_plugin(ooxmlthumbnail ${ooxmlthumbnail_SRCS}) +-target_link_libraries(ooxmlthumbnail +- ${KDE4_KIO_LIBS} ++add_library(ooxmlthumbnail MODULE ${libkowmf_SRCS}) ++target_link_libraries(ooxmlthumbnail PRIVATE ++ KF5::KDELibs4Support KF5::KIOCore KF5::Archive + ${QT_QTXML_LIBRARY} + ) +