qt5: build Qt libraries and applications with qmake

Fixes #3795
This commit is contained in:
Christian Prochaska
2020-06-28 14:21:09 +02:00
committed by Norman Feske
parent 0310c733d5
commit 5af4552511
516 changed files with 1824 additions and 20989 deletions

View File

@@ -5,15 +5,6 @@ content: $(MIRROR_FROM_REP_DIR) LICENSE
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
MIRROR_FROM_LIBPORTS := src/app/qt5/tmpl/target_defaults.inc \
src/app/qt5/tmpl/target_final.inc
content: $(MIRROR_FROM_LIBPORTS)
$(MIRROR_FROM_LIBPORTS):
mkdir -p $(dir $@)
cp -r $(GENODE_DIR)/repos/libports/$@ $(dir $@)
MIRROR_FROM_OS := include/mixer
content: $(MIRROR_FROM_OS)

View File

@@ -1,12 +1,10 @@
base
libc
mesa
os
qoost
qt5_core
qt5_gui
qt5_qjpeg
qt5_qpa_genode
qt5_widgets
qt5
qt5_component
report_session
stdcxx
vfs

View File

@@ -5,14 +5,5 @@ content: $(MIRROR_FROM_REP_DIR) LICENSE
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
MIRROR_FROM_LIBPORTS := src/app/qt5/tmpl/target_defaults.inc \
src/app/qt5/tmpl/target_final.inc
content: $(MIRROR_FROM_LIBPORTS)
$(MIRROR_FROM_LIBPORTS):
mkdir -p $(dir $@)
cp -r $(GENODE_DIR)/repos/libports/$@ $(dir $@)
LICENSE:
cp $(GENODE_DIR)/LICENSE $@

View File

@@ -1,12 +1,10 @@
base
libc
mesa
os
qoost
qt5_core
qt5_gui
qt5_qjpeg
qt5_qpa_genode
qt5_widgets
qt5
qt5_component
report_session
stdcxx
timer_session

View File

@@ -1,16 +1,7 @@
source ${genode_dir}/repos/libports/run/qt5_common.inc
import_from_depot [depot_user]/src/dynamic_rom \
[depot_user]/src/mixer_gui_qt \
[depot_user]/src/qt5_widgets
#
# Build
#
append build_components [qt5_build_components feature]
build $build_components
[depot_user]/src/mixer_gui_qt
#
# Generate config
@@ -19,7 +10,7 @@ build $build_components
append config {
<config>
<parent-provides>}
append config [qt5_parent_provides feature]
append config [qt5_parent_provides]
append config {
</parent-provides>
<default caps="100"/>
@@ -27,7 +18,7 @@ append config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append config [qt5_start_nodes feature]
append config [qt5_start_nodes]
append config {
<start name="dynamic_rom">
@@ -75,6 +66,7 @@ append config {
<inline name="rtc">2018-01-01 00:01</inline>
</dir>
<tar name="qt5_dejavusans.tar"/>
<tar name="qt5_libqgenode.tar"/>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
</config>
@@ -94,7 +86,7 @@ install_config $config
# Boot modules
#
append boot_modules [qt5_boot_modules feature]
append boot_modules [qt5_boot_modules]
build_boot_image $boot_modules

View File

@@ -1,9 +1,7 @@
source ${genode_dir}/repos/libports/run/qt5_common.inc
import_from_depot [depot_user]/src/qt5_component \
[depot_user]/src/qt5_printsupport \
[depot_user]/src/qt5_textedit \
[depot_user]/src/qt5_widgets \
[depot_user]/src/dynamic_rom \
[depot_user]/src/test-tiled_wm
@@ -43,12 +41,12 @@ proc qt5_decorator_config { } {
append config {
<config>
<parent-provides>} [qt5_parent_provides feature] {
<parent-provides>} [qt5_parent_provides] {
</parent-provides>
<default caps="100"/>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>} [qt5_start_nodes feature] {
</default-route>} [qt5_start_nodes] {
<start name="test_reports">
<binary name="report_rom"/>
@@ -120,6 +118,7 @@ append config {
</dir>
<dir name="fs"> <ram/> </dir>
<tar name="qt5_dejavusans.tar"/>
<tar name="qt5_libqgenode.tar"/>
</vfs>
</config>
<route>
@@ -145,6 +144,7 @@ append config {
</dir>
<dir name="fs"> <ram/> </dir>
<tar name="qt5_dejavusans.tar"/>
<tar name="qt5_libqgenode.tar"/>
</vfs>
</config>
<route>
@@ -167,6 +167,7 @@ append config {
</dir>
<dir name="fs"> <ram/> </dir>
<tar name="qt5_dejavusans.tar"/>
<tar name="qt5_libqgenode.tar"/>
</vfs>
</config>
<route>
@@ -189,6 +190,7 @@ append config {
</dir>
<dir name="fs"> <ram/> </dir>
<tar name="qt5_dejavusans.tar"/>
<tar name="qt5_libqgenode.tar"/>
</vfs>
</config>
<route>
@@ -210,6 +212,7 @@ append config {
</dir>
<dir name="fs"> <ram/> </dir>
<tar name="qt5_dejavusans.tar"/>
<tar name="qt5_libqgenode.tar"/>
</vfs>
</config>
<route>
@@ -224,14 +227,11 @@ append config {
install_config $config
append build_components [qt5_build_components feature]
# for debugging only
#append build_components { app/window_layouter app/themed_decorator }
#build $build_components
build $build_components
append boot_modules [qt5_boot_modules feature]
append boot_modules [qt5_boot_modules]
# for debugging only
#append boot_modules { window_layouter themed_decorator }

View File

@@ -4,6 +4,13 @@
* \date 2015-10-15
*/
/*
* Copyright (C) 2015-2020 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <base/log.h>
#include <base/thread.h>
@@ -15,6 +22,9 @@
#include <QDebug>
#include <QFile>
/* qt5_component includes */
#include <qt5_component/qpa_init.h>
/* application includes */
#include "main_window.h"
@@ -89,13 +99,11 @@ static inline void load_stylesheet()
}
extern void initialize_qt_gui(Genode::Env &);
void Libc::Component::construct(Libc::Env &env)
{
Libc::with_libc([&] {
initialize_qt_gui(env);
qpa_init(env);
int argc = 1;
char const *argv[] = { "mixer_gui_qt", 0 };

View File

@@ -1,9 +1,14 @@
include $(call select_from_repositories,src/app/qt5/tmpl/target_defaults.inc)
QMAKE_PROJECT_FILE = $(PRG_DIR)/mixer_gui_qt.pro
include $(call select_from_repositories,src/app/qt5/tmpl/target_final.inc)
QMAKE_TARGET_BINARIES = mixer_gui_qt
main_window.o: main_window.moc
QT5_PORT_LIBS = libQt5Core libQt5Gui libQt5Widgets
LIBS += qoost qt5_gui qt5_widgets qt5_core libc base
LIBS = base libc libm mesa stdcxx qoost $(QT5_PORT_LIBS)
CC_CXX_WARN_STRICT =
include $(call select_from_repositories,lib/import/import-qt5_qmake.mk)
QT5_GENODE_LIBS_APP += ld.lib.so
QT5_GENODE_LIBS_APP := $(filter-out qt5_component.lib.so,$(QT5_GENODE_LIBS_APP))
qmake_prepared.tag: qmake_root/lib/ld.lib.so

View File

@@ -1,3 +1,4 @@
include $(PRG_DIR)/../target.inc
QMAKE_PROJECT_FILE = $(PRG_DIR)/app.pro
QMAKE_TARGET_BINARIES = test-tiled_wm-app
LIBS += base
include $(PRG_DIR)/../target.inc

View File

@@ -1,3 +1,4 @@
include $(PRG_DIR)/../target.inc
QMAKE_PROJECT_FILE = $(PRG_DIR)/overlay.pro
QMAKE_TARGET_BINARIES = test-tiled_wm-overlay
LIBS += base
include $(PRG_DIR)/../target.inc

View File

@@ -1,5 +1,6 @@
QMAKE_PROJECT_FILE = $(PRG_DIR)/panel.pro
QMAKE_TARGET_BINARIES = test-tiled_wm-panel
qmake_prepared.tag: icon.h
include $(PRG_DIR)/../target.inc
LIBS += base
panel.o main.o: icon.h

View File

@@ -1,13 +1,16 @@
include $(call select_from_repositories,src/app/qt5/tmpl/target_defaults.inc)
QT5_PORT_LIBS = libQt5Core libQt5Gui libQt5Widgets
include $(call select_from_repositories,src/app/qt5/tmpl/target_final.inc)
LIBS = base libc libm mesa stdcxx qoost $(QT5_PORT_LIBS)
CC_CXX_WARN_STRICT =
include $(call select_from_repositories,lib/import/import-qt5_qmake.mk)
QT5_GENODE_LIBS_APP += ld.lib.so
QT5_GENODE_LIBS_APP := $(filter-out qt5_component.lib.so,$(QT5_GENODE_LIBS_APP))
qmake_prepared.tag: qmake_root/lib/ld.lib.so
INC_DIR += $(PRG_DIR)/..
LIBS += qoost
#
# We need Qt headers in a local directory for MOC to work correctly
#
@@ -22,4 +25,3 @@ endif
icon.h: $(ICON_H)
$(VERBOSE)cp $(ICON_H) .

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2018 Genode Labs GmbH
* Copyright (C) 2018-2020 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
@@ -33,6 +33,8 @@
/* Libc includes */
#include <libc/component.h>
/* qt5_component includes */
#include <qt5_component/qpa_init.h>
typedef Genode::String<32> Name;
@@ -75,11 +77,9 @@ class Genode_signal_proxy : public QObject,
* Qt initialization
*/
extern void initialize_qt_gui(Genode::Env &);
static inline QApplication & qt5_initialization(Libc::Env &env)
{
initialize_qt_gui(env);
qpa_init(env);
char const *argv[] = { "qt5_app", 0 };
int argc = sizeof(argv)/sizeof(*argv);