Skip to content

Instantly share code, notes, and snippets.

@timsueberkrueb
Last active November 3, 2019 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timsueberkrueb/a6bb5390447d451509f958e46eb106b6 to your computer and use it in GitHub Desktop.
Save timsueberkrueb/a6bb5390447d451509f958e46eb106b6 to your computer and use it in GitHub Desktop.

Install Qt == 5.9.X from https://qt.io (or from the archives).

Install required dependencies (See debian packaging: https://github.com/ubports/ubuntu-ui-toolkit/blob/xenial/debian/control).

If you are using Qt from the archives, run:

sudo apt install \
  libdbus-1-dev \
  libevdev-dev \
  libfontconfig1-dev \
  libfreetype6-dev \
  libgl1-mesa-dri \
  libgles2-mesa-dev \
  libglib2.0-dev \
  libinput-dev \
  liblttng-ust-dev \
  libmtdev-dev \
  libnih-dbus-dev \
  libqt5sql5-sqlite \
  libqt5svg5-dev \
  libudev-dev \
  libx11-dev \
  libxcb1-dev \
  libxi-dev \
  libxkbcommon-dev \
  libxrender-dev \
  qml-module-qt-labs-settings \
  qml-module-qtgraphicaleffects \
  qml-module-qtqml-models2 \
  qml-module-qtquick-layouts \
  qml-module-qtquick-localstorage \
  qml-module-qtquick-window2 \
  qml-module-qtquick2 \
  qml-module-qttest \
  qt5-default \
  qtbase5-dev \
  qtbase5-private-dev \
  qtdeclarative5-dev \
  qtdeclarative5-dev-tools \
  qtdeclarative5-private-dev \
  qtdeclarative5-unity-action-plugin \
  qttools5-dev-tools \
  xvfb
  # Note: qtpim5-dev is missing here because the archive version is too old ...

Install Qt modules missing from the installer from source (or the respective packages from the archive):

git clone http://code.qt.io/cgit/qt/qtsystems.git
cd qtsystems
mkdir build && cd build
qmake ..
make
make install
git clone http://code.qt.io/cgit/qt/qtpim.git
cd qtpim
git checkout 0bd985b
mkdir build && cd build
qmake ..
make
make install
git clone http://code.qt.io/cgit/qt/qtfeedback.git/
cd qtfeedback
mkdir build && cd build
qmake ..
make
make install
git clone https://github.com/ubports/ubuntu-ui-toolkit
cd ubuntu-ui-toolkit
# Building in . because when using a shadow build, installing fails with app-launch-tracepoints :(
# Using CONFIG+=warn_off as otherwise g++ will fail with -Werror=suggest-override
qmake . CONFIG+=warn_off CONFIG+=no_docs
make

For some reason, qmlplugindump which is invoked in order to create plugins.qmltypes doesn't find all required libraries in $QTDIR/lib, therefore we need to patch the wrappers it creates by running:

qt_install_libs_path="$(qmake -query QT_INSTALL_LIBS)";

find . -type f -name "wrapper.sh" -exec sed -i "s~export LD_LIBRARY_PATH.*~export LD_LIBRARY_PATH=$qt_install_libs_path:\$LD_LIBRARY_PATH~g" {} +;
make install
@timsueberkrueb
Copy link
Author

timsueberkrueb commented Oct 18, 2018

Note: have only tried this with my Qt installation which was created using the qt.io online installer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment