Skip to content

Howto build for Sailfish OS

Karas Lukáš edited this page Feb 5, 2019 · 8 revisions

Before you start, you should know that build process is little bit commplicated. If something don't work for you, read carefully following articles:

Steps:

Sailfish SDK

  • Install SailfishOS SDK on your machine. This howto expect that it is installed in default location - your home directory.
  • Create projects directory and checkout osmscout-sailfish:
mkdir -p ~/SailfishOS/projects/
cd ~/SailfishOS/projects/
git clone --recursive https://github.com/Karry/osmscout-sailfish.git osmscout-sailfish
cd osmscout-sailfish
  • Start Mer SDK and SailfishOS Emulator virtual machines:
VBoxManage startvm "SailfishOS Emulator" 
VBoxHeadless -startvm "Sailfish OS Build Engine"
  • Connect to SDK vm
ssh mersdk@localhost -p 2222 -i ~/SailfishOS/vmshare/ssh/private_keys/engine/mersdk

Prepare libraries

Mb2 mapping don't contains gcc libraries like libgomp.so (GNU OpenMP implementation), to make it available for OSM Scout, we have to make following hack.

. /etc/os-release
sudo cp /srv/mer/toolings/SailfishOS-${VERSION_ID}/opt/cross/armv7hl-meego-linux-gnueabi/lib/libgomp.so.1.0.0  /srv/mer/targets/SailfishOS-${VERSION_ID}-armv7hl/usr/lib/libgomp.so.1
sudo cp /srv/mer/toolings/SailfishOS-${VERSION_ID}/usr/lib/libgomp.so.1.0.0  /srv/mer/targets/SailfishOS-${VERSION_ID}-i486/usr/lib/libgomp.so.1

Build rpm packages

  • Build rpm packages inside SDK vm:
cd /home/mersdk/share/SailfishOS/projects/osmscout-sailfish
mb2 -t SailfishOS-3.0.1.11-i486 build
mb2 -t SailfishOS-3.0.1.11-armv7hl build

When this step was successful (it should), you win already - you may copy generated rpm package (~/SailfishOS/projects/osmscout-sailfish/RPMS/) to your device and install it.

Manual build steps

When you need binaries with debug symbols or solve error in build process, you may run build steps separately. First of all, install necessary tools.

  • Install cmake and elf tools in SDK vm:
sb2 -t SailfishOS-3.0.1.11-armv7hl -m sdk-install -R zypper in cmake patchelf chrpath
sb2 -t SailfishOS-3.0.1.11-i486    -m sdk-install -R zypper in cmake patchelf chrpath
  • Compile project inside SDK vm:
cd /home/mersdk/share/SailfishOS/projects/osmscout-sailfish
mkdir -p build-SailfishOS-i486
cd build-SailfishOS-i486
sb2 -t SailfishOS-3.0.1.11-i486 -m sdk-build cmake ..
sb2 -t SailfishOS-3.0.1.11-i486 -m sdk-build make

cd /home/mersdk/share/SailfishOS/projects/osmscout-sailfish
mkdir -p build-SailfishOS-armv7hl
cd build-SailfishOS-armv7hl
sb2 -t SailfishOS-3.0.1.11-armv7hl -m sdk-build cmake ..
sb2 -t SailfishOS-3.0.1.11-armv7hl -m sdk-build make
Clone this wiki locally