Build docviewer with libreoffice support for xenial
-
while pdf files should already work, it was not yet possible to build a docviewer packages with libreoffice support.
I wanted to post the steps I already did and the results -
Here some screenshots to the steps described in https://github.com/ubports/docviewer-app/pull/25
If you uncomment the line "#INSTALL( DIRECTORY ${UPSTREAM_LIBS_DIR}/opt/libreoffice/lib/libreoffice/ DESTINATION ${DATA_DIR}lib/${ARCH_TRIPLET}/libreoffice )" in Click.cmake, you get a click package without libreoffice support (e.g. text and pdf files work).
If you try to open an odt file, you get the message:
If you add (e.g. in a chroot environment with clickable --container-mode) libreoffice to the dependencies, and put the line " #INSTALL(DIRECTORY /usr/lib/libreoffice/ DESTINATION ${DATA_DIR}lib/${ARCH_TRIPLET}/libreoffice )" to the Click.cmake, you get an about 80MB click package.
Again opening an example odt file, you now get:
In the logviewer you see, for example:
After adding the missing dependencies, at some point it was no longer complaining, the screen looked like:
and the corresponding log:
qml: Path of the document: /media/phablet/7873-B162/Documents/example.odt
[FILE] Extracting information from the file...
[FILE] Requested file mime type: QVariant(QString, "application/vnd.oasis.opendocument.text")
[FILE] Path parsed as: "/media/phablet/7873-B162/Documents/example.odt"
Loading document...
LibreOffice binaries found at: "/opt/click.ubuntu.com/.click/users/phablet/com.ubuntu.docviewer/lib/arm-linux-gnueabihf/libreoffice/program"
LibreOffice profile path: "file:///home/phablet/.config/com.ubuntu.docviewer/libreoffice/4"
Document loaded successfully !But at that point docviewer crashed. I will not have much time currently to look into that in more detail, but at least that is where I got on Saturday...
-
Yesterday I tried the same for the amd64 clickable container (adding the dependendies manually and run in desktop mode), and got:
[FILE] Extracting information from the file...
[FILE] Requested file mime type: QVariant(QString, "application/vnd.oasis.opendocument.text")
[FILE] Path parsed as: "/tmp/Documents/hello.odt"
Loading document...
LibreOffice binaries found at: "/home/chris/git/docviewer-app/build/tmp/lib/x86_64-linux-gnu/libreoffice/program"
LibreOffice profile path: "file:///tmp/.config/com.ubuntu.docviewer/libreoffice/4"
Bootstrapping exception 'component context fails to supply singleton com.sun.star.configuration.theDefaultProvider of type com.sun.star.lang.XMultiServiceFactory'
/home/chris/git/docviewer-app/build/tmp/lib/x86_64-linux-gnu/bin/ubuntu-docviewer-app: line 5: 10 Segmentation fault (core dumped) ubuntu-docviewer-app -
We got a working build now which will appear in Openstore until Friday or so. Thanks for your efforts!
-
Excellent work @flohack!