Skip to content

Building Headunit Desktop

Viktor Verebelyi edited this page Feb 20, 2021 · 31 revisions

Installing dependencies Debian based systems

The following commands are for Debian and its derivatives, some of the package names might be different on Ubuntu.

The minimum supported version of Qt is 5.11. You will need to install Qt and some of its modules first:

apt-get install qt5-default qml-module-qtquick2 qtdeclarative5-dev qtmultimedia5-dev libqt5multimedia5-plugins \
qml-module-qtquick* qml-module-qtmultimedia qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel qml-module-qt-labs-platform \
libqt5xmlpatterns5-dev libqt5bluetooth5 qtconnectivity5-dev qml-module-qtbluetooth libqt5charts5 qml-module-qtcharts libqt5serialport5

Each module has its own dependencies, you will need to install the following libraries and tools to get everything working:

apt-get install build-essential protobuf-compiler libusb-1.0-0-dev libssl-dev openssl libglib2.0-dev \
libboost-dev libudev-dev libtag1-dev libprotobuf-dev libgstreamer1.0-dev gstreamer1.0-plugins-base-apps \
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa libgstreamer-plugins-base1.0-dev \
gstreamer1.0-pulseaudio gstreamer1.0-qt5 libfaad-dev libfftw3-dev librtlsdr-dev libairspy-dev libusb-1.0-0-dev mesa-common-dev \
libglu1-mesa-dev zlib1g-dev  portaudio19-dev libsndfile1-dev libsamplerate0-dev ofono ofono-dev \
ofono-phonesim pulseaudio bluez bluez-obexd pulseaudio-module-bluetooth qtconnectivity5-dev \
qml-module-qtbluetooth libkf5bluezqt-dev qml-module-org-kde-bluezqt qtbase5-private-dev libcanberra-dev \
libqt5charts5 libqt5charts5-dev qml-module-qtcharts libqt5serialport5-dev \
libgconf2-dev libpulse-dev libmp3lame-dev libsoapysdr-dev libmpg123-dev

The following libraries will also need to be installed, however they are not readily available on the current Debian repositories (some of them will be available on Ubuntu), so you will have to build them. Build instructions for these packages can be found in this wiki, please refer to the building additional dependencies page. The packages you will need are:

qtpim qofono

Compiling headunit-desktop

Once all the dependencies are installed you are ready to building the project. Before running any make command you will need to generate the protobuf files for Android Auto. Run the following command to do that:

protoc --proto_path=modules/android-auto/headunit/hu/ --cpp_out=modules/android-auto/headunit/hu/generated.x64/ modules/android-auto/headunit/hu/hu.proto

After this you need to create make files from the qmake project file. You can change the PREFIX variable to any location to your liking. It is highly recommended that you don't build the project in you source folder, so either create a build sub folder or build it outside the source path. In this case we will create a build dir inside the source path

mkdir build && cd build
qmake PREFIX=~/hud ../headunit-desktop.pro

If you are building for a Raspberry Pi then you need to enable some specific features by using the RPI build flag

qmake PREFIX=~/hud RPI=1 ../headunit-desktop.pro

Then run make. Make sure that you change number after -j to the number of your systems processor cores + 1

make -j4

And install the project in the directory you specified earlier. This step can be skipped as you can run HUD from the build dir, but it is recommended that you run it from a separate folder as the build directory contains a lot of temporary files. The build directory can be deleted after installing HUD.

make install

Running on a headless Raspbian install

The built app can be run on the lite version of Raspbian. There is no additional software needed for it. You just need to set the following environment variable:

QT_QPA_PLATFORM=eglfs
Clone this wiki locally