how to build sailfish-office(cmake && mb2/sb2)

http://jollaphone.eu/?p=3125


I would like to contribute some features to sailfish-office (the pdf viewer plugin). So here is how far I progressed on the way, this might apply to eg the sailfish-browser as well

1. Find the source

https://github.com/sailfishos/sailfish-office

2. fork/clone it

3. create a checkout (of your fork)

 git clone [email protected]:sailfishos/sailfish-office.git

4. open some (new/placeholder) project in the sailfish IDE

5. start the SDK

6. ssh into the SDK
    login in to the mer sdk as user “mersdk”:

ssh -p 2222 -i ~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk mersdk@localhost

7. go to the checkout dir (your home dir is mounted in ~/share/)

cd ~/share/path/to/the/code/sailfish-office/

8. try compiling an rpm

For the emulator:

mb2 -t SailfishOS-i486 -s rpm/sailfish-office.spec build

For your device:

mb2 -t SailfishOS-armv7hl -s rpm/sailfish-office.spec build

9. Notice missing dependencies

[mersdk@SailfishSDK sailfish-office]$ mb2 -t SailfishOS-i486 -s rpm/sailfish-office.spec build
Package 'libjollasignonuiservice-qt5-devel' not found.
Building target platforms: i486-meego-linux-gnu
Building for target i486-meego-linux-gnu
error: Failed build dependencies:
        libqt5sparql-devel is needed by sailfish-office-1.1.5-1.i486
        poppler-qt5-devel is needed by sailfish-office-1.1.5-1.i486
        poppler-qt5 is needed by sailfish-office-1.1.5-1.i486
        poppler-devel is needed by sailfish-office-1.1.5-1.i486
        cmake is needed by sailfish-office-1.1.5-1.i486
        libjollasignonuiservice-qt5-devel is needed by sailfish-office-1.1.5-1.i486

**STOP following here**

10. install dependencies

sudo zypper in  libqt5sparql-devel poppler-qt5-devel poppler-devel cmake

11. fail

There is no package providing **libjollasignonuiservice-qt5-devel**

Installing the other packages does not in fact make mb2 happy, ie

[mersdk@SailfishSDK sailfish-office]$ mb2 -t SailfishOS-i486 -s rpm/sailfish-office.spec build
Package 'libjollasignonuiservice-qt5-devel' not found.
Building target platforms: i486-meego-linux-gnu
Building for target i486-meego-linux-gnu
error: Failed build dependencies:
        libqt5sparql-devel is needed by sailfish-office-1.1.5-1.i486
        poppler-qt5-devel is needed by sailfish-office-1.1.5-1.i486
        poppler-qt5 is needed by sailfish-office-1.1.5-1.i486
        poppler-devel is needed by sailfish-office-1.1.5-1.i486
        cmake is needed by sailfish-office-1.1.5-1.i486
        libjollasignonuiservice-qt5-devel is needed by sailfish-office-1.1.5-1.i486

remains as the output.

Manuall compilation:

have a look at rpm/sailfish-office.spec:

BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Widgets)
#BuildRequires: pkgconfig(Qt5WebKit)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: libqt5sparql-devel
BuildRequires: poppler-qt5-devel poppler-qt5 poppler-devel poppler
BuildRequires: mapplauncherd-qt5-devel
BuildRequires: cmake
BuildRequires: qt5-qttools-linguist
BuildRequires: libjollasignonuiservice-qt5-devel

so we need to install all of this (additionally to what was installed above)

sudo zypper in qt5-qtdeclarative-qtquick-devel qt5-qtdbus-devel qt5-qttools-linguist mapplauncherd-qt5-devel

however, again, libjollasignonuiservice-qt5-devel is actually not in the repo, so we cant install it

mkdir build
cd build
cmake ../sailfish-office/

will fail with

[mersdk@SailfishSDK build]$ cmake ../sailfish-office/
-- The C compiler identification is GNU 4.6.4
-- The CXX compiler identification is GNU 4.6.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found QtSparql: /usr/include/Qt5Sparql  
-- Found Booster: /usr/include/mdeclarativecache5  
-- Could NOT find libjollasignonuiservice (missing:  JOLLASIGNONUISERVICE_INCLUDE_DIR JOLLASIGNONUISERVICE_LIBRARY) 
-- Found Poppler: /usr/include/poppler/cpp  
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
JOLLASIGNONUISERVICE_INCLUDE_DIR (ADVANCED)
   used as include directory in directory /home/mersdk/share/proggn/jolla/sailfish-office
   used as include directory in directory /home/mersdk/share/proggn/jolla/sailfish-office/plugin
   used as include directory in directory /home/mersdk/share/proggn/jolla/sailfish-office/pdf
JOLLASIGNONUISERVICE_LIBRARY (ADVANCED)
    linked by target "sailfish-office" in directory /home/mersdk/share/proggn/jolla/sailfish-office

-- Configuring incomplete, errors occurred!

Credits

https://together.jolla.com/question/7793/nemo-qml-plugin-alarms-qt5-binary-packages-missing-in-sdk-how-to-compile-from-source/

Todo

1. create arm packages to test on device
2. use open build service to create packages
3. setup an openrepo for the build from open build service ?
4. cleanup of this wannabe guide

Can anyone help? @Jolla could someone provide the missing package? I will update this entry as I/we progress




你可能感兴趣的:(how to build sailfish-office(cmake && mb2/sb2))