--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Compositor.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <X11/extensions/XKBcommon.h>
+#include <X11/keysym.h>
+
+#include <QtCore/qnamespace.h>
+
+int main(int argc, char **argv)
+{
+ struct xkb_rule_names names;
+ names.rules = "evdev";
+ names.model = "pc105";
+ names.layout = "us";
+ names.variant = "";
+ names.options = "";
+
+ struct xkb_desc *xkb = xkb_compile_keymap_from_rules(&names);
+ Q_UNUSED(xkb);
+ return 0;
+}
--- /dev/null
+TEMPLATE = app
+TARGET = xkbcommon
+QT = core
+DEPENDPATH += .
+INCLUDEPATH += .
+
+!contains(QT_CONFIG, no-pkg-config) {
+ QMAKE_CFLAGS_XKBCOMMON=$$system(pkg-config --cflags xkbcommon 2>/dev/null)
+ QMAKE_LIBS_XKBCOMMON=$$system(pkg-config --libs xkbcommon 2>/dev/null)
+}
+
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+LIBS += $$QMAKE_LIBS_XKBCOMMON
+
+# Input
+SOURCES += main.cpp
TEMPLATE=subdirs
+CONFIG += ordered
-module_qtcompositor_src.subdir = src
-module_qtcompositor_src.target = module-module_qtcompositor_src
+module_qtwayland_src.subdir = src
+module_qtwayland_src.target = module-qtwayland-src
-module_qtcompositor_examples.subdir = examples
-module_qtcompositor_examples.target = module_qtcompositor_examples
-module_qtcompositor_examples.depends = module_qtcompositor_src
+module_qtwayland_examples.subdir = examples
+module_qtwayland_examples.target = module-qtwayland-examples
+module_qtwayland_examples.depends = module_qtwayland_src
!contains(QT_BUILD_PARTS,examples) {
- module_qtcompositor_examples.CONFIG = no_default_target no_default_install
+ module_qtwayland_examples.CONFIG = no_default_target no_default_install
}
-SUBDIRS += tests \
- module_qtcompositor_src \
- module_qtcompositor_examples \
+module_qtwayland_tests.subdir = tests
+module_qtwayland_tests.target = module-qtwayland-tests
+module_qtwayland_tests.depends = module_qtwayland_src
+!contains(QT_BUILD_PARTS,tests):!with-tests {
+ module_qtwayland_tests.CONFIG += no_default_target
+}
+
+SUBDIRS += module_qtwayland_src \
+ module_qtwayland_examples \
+ module_qtwayland_tests
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
DEFINES += QT_BUILD_COMPOSITOR_LIB
-!mac:use_pkgconfig {
- CONFIG += link_pkgconfig
- PKGCONFIG += wayland-server
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-server 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_SERVER=$$system(pkg-config --libs-only-l wayland-server 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-server 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-server 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
+}
- #set the rpath
- !isEmpty(QMAKE_LFLAGS_RPATH) {
- WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
- !isEmpty(WAYLAND_NEEDS_RPATH) {
- WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
- !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
- }
- }
-} else {
- INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_SERVER
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
!isEmpty(QMAKE_LIBDIR_WAYLAND) {
- LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
}
- LIBS += -lwayland-server -lffi
}
HEADERS += qtcompositorversion.h
DESTDIR = $$QT.gui.plugins/platforms
-DEFINES += Q_PLATFORM_WAYLAND
-DEFINES += $$QMAKE_DEFINES_WAYLAND
-
-mac {
- DEFINES += QT_NO_WAYLAND_XKB
-}
-
QT += core-private gui-private platformsupport-private
-WAYLANDSOURCES += \
- $$PWD/../../../../extensions/surface-extension.xml \
- $$PWD/../../../../extensions/sub-surface-extension.xml \
- $$PWD/../../../../extensions/output-extension.xml \
- $$PWD/../../../../extensions/touch-extension.xml
-
SOURCES = main.cpp \
qwaylandintegration.cpp \
qwaylandnativeinterface.cpp \
qwaylandtouch.h \
$$PWD/../../../shared/qwaylandmimehelper.h
+DEFINES += Q_PLATFORM_WAYLAND
+
+contains(config_test_xkbcommon,yes) {
+ !contains(QT_CONFIG, no-pkg-config) {
+ QMAKE_CFLAGS_XKBCOMMON=$$system(pkg-config --cflags xkbcommon 2>/dev/null)
+ QMAKE_LIBS_XKBCOMMON=$$system(pkg-config --libs xkbcommon 2>/dev/null)
+ }
+
+ QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ QMAKE_CFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ LIBS += $$QMAKE_LIBS_XKBCOMMON
+} else {
+ DEFINES += QT_NO_WAYLAND_XKB
+}
+
+WAYLANDSOURCES += \
+ $$PWD/../../../../extensions/surface-extension.xml \
+ $$PWD/../../../../extensions/sub-surface-extension.xml \
+ $$PWD/../../../../extensions/output-extension.xml \
+ $$PWD/../../../../extensions/touch-extension.xml
+
+
OTHER_FILES += wayland.json
INCLUDEPATH += $$PWD/../../../shared
-INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
-
-LIBS += $$QMAKE_LIBS_WAYLAND
-mac {
- LIBS += -lwayland-client
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-client 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_CLIENT=$$system(pkg-config --libs-only-l wayland-client 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-client 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-client 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
}
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_CLIENT
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
+ !isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
+ }
+}
target.path += $$[QT_INSTALL_PLUGINS]/platforms
INSTALLS += target
%dependencies = (
"qtbase" => "refs/heads/master",
);
+
+# Compile tests
+%configtests = (
+ "xkbcommon" => {}
+);
QT += testlib
QT += core-private gui-private
-use_pkgconfig {
- CONFIG += link_pkgconfig
- PKGCONFIG += wayland-server
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-client 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_CLIENT=$$system(pkg-config --libs-only-l wayland-client 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_SERVER=$$system(pkg-config --libs-only-l wayland-server 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-client 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-client 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
+}
- #set the rpath
- !isEmpty(QMAKE_LFLAGS_RPATH) {
- WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
- !isEmpty(WAYLAND_NEEDS_RPATH) {
- WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
- !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
- }
- }
-} else {
- INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_CLIENT
+LIBS += $$QMAKE_LIBS_WAYLAND_SERVER
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
!isEmpty(QMAKE_LIBDIR_WAYLAND) {
- LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
}
- LIBS += -lwayland-server -lffi
}
SOURCES += tst_client.cpp \
QT += testlib
QT += core-private gui-private compositor
-INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-server 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_SERVER=$$system(pkg-config --libs-only-l wayland-server 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_CLIENT=$$system(pkg-config --libs-only-l wayland-client 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-server 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-server 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
+}
+
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_SERVER
+LIBS += $$QMAKE_LIBS_WAYLAND_CLIENT
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
-LIBS += $$QMAKE_LIBS_WAYLAND
-mac {
- LIBS += -lwayland-client
+!isEmpty(QMAKE_LFLAGS_RPATH) {
+ !isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
+ }
}
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND