meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
organicmaps [2022/09/30 01:10]
boroli added upstream bug
organicmaps [2022/11/16 04:56] (current)
boroli add compile from source
Line 24: Line 24:
 # Confirm that you trust and add the flathub repo to flatpak # Confirm that you trust and add the flathub repo to flatpak
 flatpak install flathub app.organicmaps.desktop flatpak install flathub app.organicmaps.desktop
 +</​code>​
 +
 +==== Compiling from source ====
 +
 +As the compilation of organicmaps requires at least [[https://​github.com/​organicmaps/​organicmaps/​blob/​master/​docs/​INSTALL.md|4GB RAM]] you can't compile it directly locally on the phone, as this would result in a kernel panic.
 +
 +== Setup QEMU ==
 +
 +As your host is most likely running on an amd64 architecture,​ you need to install QEMU system for arm64:
 +<​code>​sudo apt install qemu-system-arm</​code>​
 +
 +Get (an up to date) debian image. The ''​nocloud''​ image allows root access without password:
 +<​code>​wget -c https://​cdimage.debian.org/​cdimage/​cloud/​bookworm/​daily/​20221112-1197/​debian-12-nocloud-arm64-daily-20221112-1197.qcow2</​code>​
 +
 +Increase the virtual image size, so there is enough space for the compilation process:
 +<​code>​qemu-img resize debian-12-nocloud-arm64-daily-20221112-1197.qcow2 +10G</​code>​
 +
 +Then start the image. As organicmaps requires at least 4GB of memory, give it at least 6GB to avoid any kernel panic during compilation or linking:
 +<​code>​
 +qemu-system-aarch64 -m 6G -cpu max -smp 4 -M virt -nographic -bios /​usr/​share/​qemu-efi-aarch64/​QEMU_EFI.fd -drive if=none,​file=debian-12-nocloud-arm64-daily-20221112-1197.qcow2,​id=hd0 -device virtio-blk-device,​drive=hd0 -device virtio-net-device,​netdev=net0 -netdev user,​hostfwd=tcp:​127.0.0.1:​2222-:​22,​id=net0
 +</​code>​
 +
 +Once the image startet successfully,​ you can login as ''​root''​ without any password.
 +You still need to grow the filesystem. As there were some errors in regards to wrong checksums of backup supernodes of the ext4 FS, deactivate the following option in ''/​etc/​fstab''​ as otherwise you'll end up with a read-only filesystem:
 +
 +<​code>​vim /etc/fstab
 +"​remove the grub option: errors=remount-ro from the first entry"
 +</​code>​
 +
 +Then extend the FS
 +<​code>​growpart /dev/vda 1</​code>​
 +
 +and add the ''​contrib''​ component to debian sources, update and reboot:
 +<​code>​vim /​etc/​apt/​sources.list.d/​debian.sources
 +sudo apt update
 +reboot
 +</​code>​
 +
 +== Install dependencies ==
 +
 +<​code>​
 +# install build-requirements
 +sudo apt install build-essential clang ninja-build python3 qtbase5-dev libc++-dev libfreetype-dev libglu1-mesa-dev libicu-dev libqt5svg5-dev libsqlite3-dev zlib1g-dev ccache cmake git
 +</​code>​
 +
 +== Get the sources ==
 +
 +As several paths are hard coded during the compilation process, make sure you create at pseudo home directory for mobian.
 +
 +There was an error with some boost libraries during the ''​./​configure''​ stage. As a solution, you need to clone also all submodules (there is most likely a much better solution, by utilising existing boost packages from debian.)
 +
 +<​code>​
 +## create fake mobian dir
 +mkdir /​home/​mobian
 +cd /​home/​mobian
 +## shallow copy for a one off compilation
 +git clone --filter=blob:​limit=128k --depth=1 --shallow-submodules ​ https://​github.com/​organicmaps/​organicmaps.git
 +## only due to error messages from boost libraries ​
 +cd organicmaps
 +git submodule update --init --recursive
 +</​code>​
 +
 +== build package ==
 +
 +You can use more than 1 core for compilation,​ but I found that I run twice out of memory and into a kernel panic, so in the end I stuck to a single kernel:
 +
 +<​code>​
 +./​configure.sh
 +tools/​unix/​build_omim.sh -n 1 -r desktop
 +</​code>​
 +
 +== copy it to mobian ==
 +
 +As the executable relies on several other files, it's best to copy the whole build directory to your phone (choose your IP address, and make sure the ssh server is running on your phone: ''​sudo service ssh status''​):​
 +
 +<​code>​
 +scp -r omim-build-release mobian@10.42.0.1:​~/​
 +</​code>​
 +
 +And make sure there is a [[https://​github.com/​organicmaps/​organicmaps/​blob/​master/​docs/​INSTALL.md#​testing|data]] directory in the build directory. If not present, copy it from the source directory.
 +
 +== run it under mobian ==
 +
 +Check which dynamic libraries are missing under phosh/​mobian
 +<​code>​
 +ldd ~/​omim-build-release/​OMaps
 +</​code>​
 +
 +I needed to install at least those two additional runtime packages, and in particular I'm not certain if this is the right one for ''​libOpenGL.so.0''​ (please feel free to improve)
 +
 +<​code>​
 +# install runtime dependencies
 +sudo apt install libicu72 libopengl0
 +</​code>​
 +
 +Finally run Organicmaps with (currently for the very first start, it will ask to accept the Copyright and ask to Download the worldmap - then it will crash phosh. For the second startup, it will show the same error messages as with the flatpak package)
 +
 +<​code>​
 +~/​omim-build-release/​OMaps
 </​code>​ </​code>​