Document Converter
This project provides an example using LibreOffice to converting documents.
Terms of Use and Participation
The source code of the project is provided under the license, which allows its use in third-party applications.
The contributor agreement documents the rights granted by contributors of the Open Mobile Platform.
Information about the contributors is specified in the AUTHORS file.
Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.
Project Structure
The project has a standard structure of an application based on C++ and QML for Aurora OS.
-
application directory contains the application source code:
- application.pro file describes the structure of the application for the qmake build system.
- icons directory contains the application icons for different screen resolutions.
-
qml directory contains the QML source code and the UI resources.
- cover directory contains the application cover implementations.
- icons directory contains the additional custom UI icons.
- pages directory contains the application pages.
- DocumentConverter.qml file provides the application window implementation.
- translations directory contains the UI translation files.
-
src directory contains the C++ source code.
- main.cpp file is the application entry point.
- ru.auroraos.DocumentConverter.desktop file defines the display and parameters for launching the application.
-
rpm directory contains the rpm-package build settings.
- ru.auroraos.DocumentConverter.spec file is used by rpmbuild tool.
- ru.auroraos.DocumentConverter.pro file describes the project that contains two subprojects where the first is responsible for building the libreoffice, and the second describes the structure of the application for the qmake build system.
- upstream directory contains source code LibreOffice (git submodule).
- tarballs directory of dependencies in the form of archives necessary for the build LibreOffice.
- libs directory of dependencies in the form of source codes necessary for the build LibreOffice.
Compatibility
The project is compatible with all the current versions of the Aurora OS.
Project Building
Clear building
- Make sure that you have 32 GB of RAM and SDK with docker (don't use VB for building this example).
- Open a terminal or command prompt.
- Navigate to the directory that contains your Git repository.
- Execute the command "git lfs pull" to download any files tracked by LFS.
- Execute the command "git submodule update --init" to update and initialize submodules in the repository.
- Execute the command "mb2 -t AuroraOS-5.0.0.60-base-armv7hl build-init" to initialize the build environment.
- Execute the command "mb2 -t AuroraOS-5.0.0.60-base-armv7hl prepare" to apply the patches needed for the build.
- Execute the command "mb2 -t AuroraOS-5.0.0.60-base-armv7hl build" to start building the package.
- Execute the command to sign the rpm-package:
sfdk engine exec rpmsign-external sign \
--key absolute/path/to/key/file.pem \
--cert absolute/path/to/cert/file.pem \
absolute/path/to/rpm/package.rpm
The target rpm-package is in the RPMS directory of the project.
Solutions of possible problems
If building is failed with the next error
+ aclocal -I <path/to>/DocumentConverter/upstream/m4
autom4te: error: need GNU m4 1.4 or later: /usr/bin/m4
aclocal: error: echo failed with exit status: 1
then enter into the target and install the m4 dependency manually.
Repeated building for another target
The build is run in the same directory as the application sources so it's necessary to delete the previous building results before a new build for another target.
Run the next commands from the project root directory:
rm -fr libs_build
rm -fr upstream/workdir
rm -f application/Makefile
cd libs/liblangtag && make distclean
Screenshots
Known limitations
LibreOffice in this implementation does not support simultaneous work in multiple threads. Attempting to initialize the Office object while another process is running may delay initialization until the current conversion is complete or cause the application to crash.