status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
293 stars 78 forks source link

Makefile: Qt installation is not found on Ubuntu because of libs relative paths #13068

Open igor-sirotin opened 10 months ago

igor-sirotin commented 10 months ago

Description

This is the problem that @chair28980 is facing.

We use qmake -query to get paths to Qt's libraries (and further for /pkgconfig).

But in some cases the returned paths are relative:

chair@table:~/Downloads$ qmake -query
QT_SYSROOT:
QT_INSTALL_PREFIX:/..
QT_INSTALL_ARCHDATA:/..
QT_INSTALL_DATA:/..
QT_INSTALL_DOCS:/../doc
QT_INSTALL_HEADERS:/../include
QT_INSTALL_LIBS:/../lib
QT_INSTALL_LIBEXECS:/../libexec
QT_INSTALL_BINS:/../bin
QT_INSTALL_TESTS:/../tests
QT_INSTALL_PLUGINS:/../plugins
QT_INSTALL_IMPORTS:/../imports
QT_INSTALL_QML:/../qml
QT_INSTALL_TRANSLATIONS:/../translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/../examples
QT_INSTALL_DEMOS:/../examples
QT_HOST_PREFIX:/..
QT_HOST_DATA:/..
QT_HOST_BINS:/../bin
QT_HOST_LIBS:/../lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:linux-g++
QMAKE_VERSION:3.1
QT_VERSION:5.15.2

Our Makefile code is not prepared for that and eventually fails on pkg-config --libs Qt5Core call here: https://github.com/status-im/status-desktop/blob/5d906e7ab4c4eb5fbc07aef852344a65c64ff873/Makefile#L191

Though this might be OS issue, I believe our code should be able to handle this. Even a dumb old solution by manually passing and overriding QTDIR is fine to me.

Additional Information

igor-sirotin commented 10 months ago

@chair28980 can you please post results of this commands:

caybro commented 10 months ago

Perhaps we might want to use realpath to canonicalize the input not to contain relative paths

chair28980 commented 10 months ago

@igor-sirotin

chair@table:~/status-desktop$ git rev-parse HEAD
3b162e054125920e6a8d3256946af0f847cebc94

and

chair@table:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:    22.04
Codename:   jammy