Use pkg-config to find the prefix for X11 install
Needed to run the XKB extension where we used to expect X11 to be installed in /usr. In FreeBSD, for instance, X11 is installed in /usr/local like all the other not out-of-the-box packages. Same thing goes for the compose platform input context plugin. Change-Id: Ib7ace3117eaacc6e150394450d1330cba654ba8a Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
This commit is contained in:
parent
260b0b4ed6
commit
38813a3b32
8
configure
vendored
8
configure
vendored
@ -5130,6 +5130,14 @@ if [ "$CFG_XCB" != "no" ]; then
|
||||
else
|
||||
CFG_XCB="system"
|
||||
|
||||
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "x11" 2> /dev/null; then
|
||||
QMAKE_X11_PREFIX="`$PKG_CONFIG --variable=prefix x11`"
|
||||
else
|
||||
# default to LSB prefix
|
||||
QMAKE_X11_PREFIX="/usr"
|
||||
fi
|
||||
QMakeVar set QMAKE_X11_PREFIX "$QMAKE_X11_PREFIX"
|
||||
|
||||
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xcb >= 1.5" 2>/dev/null; then
|
||||
XCB_PACKAGES="xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm"
|
||||
QMAKE_CFLAGS_XCB="`$PKG_CONFIG --cflags $XCB_PACKAGES 2>/dev/null`"
|
||||
|
2
src/3rdparty/xkbcommon.pri
vendored
2
src/3rdparty/xkbcommon.pri
vendored
@ -1,7 +1,7 @@
|
||||
QMAKE_CFLAGS += -std=gnu99 -w
|
||||
INCLUDEPATH += $$PWD/xkbcommon $$PWD/xkbcommon/src $$PWD/xkbcommon/src/xkbcomp
|
||||
|
||||
DEFINES += DFLT_XKB_CONFIG_ROOT='\\"/usr/share/X11/xkb\\"'
|
||||
DEFINES += DFLT_XKB_CONFIG_ROOT='\\"$$QMAKE_X11_PREFIX/share/X11/xkb\\"'
|
||||
|
||||
### RMLVO names can be overwritten with environmental variables (See libxkbcommon documentation)
|
||||
DEFINES += DEFAULT_XKB_RULES='\\"evdev\\"'
|
||||
|
@ -8,6 +8,7 @@ QT += gui-private
|
||||
|
||||
LIBS += $$QMAKE_LIBS_XKBCOMMON
|
||||
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
|
||||
DEFINES += COMPOSE_X11_PREFIX='\\"$$QMAKE_X11_PREFIX\\"'
|
||||
|
||||
SOURCES += $$PWD/main.cpp \
|
||||
$$PWD/qcomposeplatforminputcontext.cpp \
|
||||
|
@ -73,17 +73,13 @@ TableGenerator::TableGenerator() : m_state(NoErrors),
|
||||
|
||||
void TableGenerator::initPossibleLocations()
|
||||
{
|
||||
// AFAICT there is no way to know the exact location
|
||||
// of the compose files. It depends on how Xlib was configured
|
||||
// on a specific platform. During the "./configure" process
|
||||
// xlib generates a config.h file which contains a bunch of defines,
|
||||
// including XLOCALEDIR which points to the location of the compose file dir.
|
||||
// To add an extra system path use the QTCOMPOSE environment variable
|
||||
if (qEnvironmentVariableIsSet("QTCOMPOSE")) {
|
||||
m_possibleLocations.append(QString(qgetenv("QTCOMPOSE")));
|
||||
}
|
||||
m_possibleLocations.append(QStringLiteral("/usr/share/X11/locale"));
|
||||
m_possibleLocations.append(QStringLiteral("/usr/lib/X11/locale"));
|
||||
|
||||
m_possibleLocations.append(QStringLiteral(COMPOSE_X11_PREFIX "/share/X11/locale"));
|
||||
m_possibleLocations.append(QStringLiteral(COMPOSE_X11_PREFIX "/lib/X11/locale"));
|
||||
}
|
||||
|
||||
void TableGenerator::findComposeFile()
|
||||
|
Loading…
Reference in New Issue
Block a user