Hi Johannes,

On 26.07.2017 14:42, Johannes Kliemann wrote:
> Hi,
>
> I tried to build the Qt Virtualkeyboard example.
> I adapted the target.mk of the calculatorform example to point to the
> correct project file.
> Make fails at the project file at line 6 with missing separator. This
> part contains the following:
>
> static {
>     QT += svg
>     QTPLUGIN += qtvirtualkeyboardplugin
> }
>
>
> Is there an additional flag required? Manually running qmake && make
> works fine.

the Genode build system does not run qmake, but includes the qmake project file 
as if it were a Makefile. This works well for simple
project files, but if the project file uses qmake-specific syntax and these 
parts are relevant, they must be replaced with something
that GNU make understands. In your case it would probably suffice to just 
delete the 'static {' line and the '}' line.

The 'QT' variable gets evaluated in [1] and there's no svg support right now. A 
port of the Qt5Svg library would include the
following new files:

- repos/libports/lib/import/import-qt5_svg.mk
- repos/libports/lib/mk/qt5_svg.mk
- repos/libports/lib/mk/qt5_svg_generated.inc

The 'QTPLUGIN' variable does not get evaluated in the 'target_final.inc' file 
right now. To do that, I think you would need to add
each part of the variable content to the LIBS variable (prefixed with 'qt5_'), 
resulting in 'LIBS += qt5_qtvirtualkeyboardplugin' in
your case, and then build the plugin as a shared library, similar to the 
'qt5_qjpeg' library.

I've attached the generated include files and a patch with the script used to 
generate the files, in case you need to change the
configuration and regenerate them.

Regards,
Christian

[1] 
https://github.com/genodelabs/genode/blob/master/repos/libports/src/app/qt5/tmpl/target_final.inc

QT_DEFINES += -DQT_NO_FOREACH -DQT_NO_USING_NAMESPACE -DQT_BUILD_SVG_LIB 
-DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT 
-DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS 
-DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS 
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB 
-DQT_GUI_LIB -DQT_CORE_LIB

QT_INCPATH += \
  qtsvg/src/svg \
  qtsvg/include \
  qtsvg/include/QtSvg \
  qtsvg/include/QtSvg/5.8.0 \
  qtsvg/include/QtSvg/5.8.0/QtSvg \
  qtbase/include/QtWidgets/5.8.0 \
  qtbase/include/QtWidgets/5.8.0/QtWidgets \
  qtbase/include/QtGui/5.8.0 \
  qtbase/include/QtGui/5.8.0/QtGui \
  qtbase/include/QtCore/5.8.0 \
  qtbase/include/QtCore/5.8.0/QtCore \
  qtbase/include \
  qtbase/include/QtWidgets \
  qtbase/include/QtGui \
  qtbase/include/QtCore \
  qtbase/mkspecs/genode-g++

QT_SOURCES += \
  qsvggraphics.cpp \
  qsvghandler.cpp \
  qsvgnode.cpp \
  qsvgstructure.cpp \
  qsvgstyle.cpp \
  qsvgfont.cpp \
  qsvgtinydocument.cpp \
  qsvgrenderer.cpp \
  qsvgwidget.cpp \
  qgraphicssvgitem.cpp \
  qsvggenerator.cpp \
  moc_qsvgwidget.cpp

QT_VPATH += \
  qtsvg/src/svg \

# some source files need to be generated by moc from other source/header files 
before
# they get #included again by the original source file in the compiling stage

# source files generated from existing header files ('moc_%.cpp: %.h' rule in 
import-qt5.inc)
# extracted from 'compiler_moc_header_make_all' target

COMPILER_MOC_HEADER_MAKE_ALL_FILES = \
  moc_qsvgrenderer.cpp \
  moc_qsvgwidget.cpp \
  moc_qgraphicssvgitem.cpp

# source files generated from existing source files ('%.moc: %.cpp' rule in 
import-qt5.inc)
# extracted from 'compiler_moc_source_make_all' rule

COMPILER_MOC_SOURCE_MAKE_ALL_FILES = \
 

QT_DEFINES += -DQT_VIRTUALKEYBOARD_DEFAULT_STYLE=\"default\" 
-DQT_VIRTUALKEYBOARD_DESKTOP -DQT_VIRTUALKEYBOARD_HAVE_XCB -DQT_NO_EXCEPTIONS 
-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN 
-DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NO_QML_DEBUGGER -DQT_NETWORK_LIB 
-DQT_CORE_LIB

QT_INCPATH += \
  qtvirtualkeyboard/src/virtualkeyboard \
  qtdeclarative/include \
  qtdeclarative/include/QtQuick \
  qtbase/include/QtGui/5.8.0 \
  qtbase/include/QtGui/5.8.0/QtGui \
  qtbase/include \
  qtbase/include/QtGui \
  qtdeclarative/include/QtQml \
  qtbase/include/QtNetwork \
  qtbase/include/QtCore/5.8.0 \
  qtbase/include/QtCore/5.8.0/QtCore \
  qtbase/include/QtCore \
  qtbase/mkspecs/genode-g++

QT_SOURCES += \
  platforminputcontext.cpp \
  inputcontext.cpp \
  abstractinputmethod.cpp \
  plaininputmethod.cpp \
  inputengine.cpp \
  shifthandler.cpp \
  plugin.cpp \
  inputmethod.cpp \
  selectionlistmodel.cpp \
  defaultinputmethod.cpp \
  abstractinputpanel.cpp \
  enterkeyaction.cpp \
  enterkeyactionattachedtype.cpp \
  settings.cpp \
  virtualkeyboardsettings.cpp \
  trace.cpp \
  desktopinputpanel.cpp \
  inputview.cpp \
  appinputpanel.cpp \
  qrc_default_style.cpp \
  qrc_retro_style.cpp \
  qrc_content.cpp \
  qrc_layouts.cpp \
  moc_platforminputcontext.cpp \
  moc_inputcontext.cpp \
  moc_abstractinputmethod.cpp \
  moc_plaininputmethod.cpp \
  moc_inputengine.cpp \
  moc_shifthandler.cpp \
  moc_inputmethod.cpp \
  moc_selectionlistmodel.cpp \
  moc_defaultinputmethod.cpp \
  moc_abstractinputpanel.cpp \
  moc_enterkeyaction.cpp \
  moc_enterkeyactionattachedtype.cpp \
  moc_settings.cpp \
  moc_virtualkeyboardsettings.cpp \
  moc_plugin.cpp \
  moc_trace.cpp \
  moc_desktopinputpanel.cpp \
  moc_inputview.cpp \
  moc_appinputpanel.cpp

QT_VPATH += \
  qtvirtualkeyboard/src/virtualkeyboard \

# some source files need to be generated by moc from other source/header files 
before
# they get #included again by the original source file in the compiling stage

# source files generated from existing header files ('moc_%.cpp: %.h' rule in 
import-qt5.inc)
# extracted from 'compiler_moc_header_make_all' target

COMPILER_MOC_HEADER_MAKE_ALL_FILES = \
  moc_platforminputcontext.cpp \
  moc_inputcontext.cpp \
  moc_abstractinputmethod.cpp \
  moc_plaininputmethod.cpp \
  moc_inputengine.cpp \
  moc_shifthandler.cpp \
  moc_inputmethod.cpp \
  moc_selectionlistmodel.cpp \
  moc_defaultinputmethod.cpp \
  moc_abstractinputpanel.cpp \
  moc_enterkeyaction.cpp \
  moc_enterkeyactionattachedtype.cpp \
  moc_settings.cpp \
  moc_virtualkeyboardsettings.cpp \
  moc_plugin.cpp \
  moc_trace.cpp \
  moc_desktopinputpanel.cpp \
  moc_inputview.cpp \
  moc_appinputpanel.cpp

# source files generated from existing source files ('%.moc: %.cpp' rule in 
import-qt5.inc)
# extracted from 'compiler_moc_source_make_all' rule

COMPILER_MOC_SOURCE_MAKE_ALL_FILES = \
 

qt5_create_generated_incs_with_preparation.patch

From: Christian Prochaska <christian.procha...@genode-labs.com>


---
 repos/libports/ports/qt5.hash                      |    2 -
 repos/libports/ports/qt5.port                      |    3 -
 repos/libports/src/lib/qt5/patches/series          |    4 ++
 repos/libports/src/lib/qt5/patches/series.qtwebkit |    4 --
 .../lib_mk_file_generator/create_generated_incs    |    4 ++
 .../create_generated_incs_with_preparation         |   42 ++++++++++++++++++++
 6 files changed, 52 insertions(+), 7 deletions(-)
 delete mode 100644 repos/libports/src/lib/qt5/patches/series.qtwebkit
 create mode 100755 repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs_with_preparation

diff --git a/repos/libports/ports/qt5.hash b/repos/libports/ports/qt5.hash
index fca186b..50fe29e 100644
--- a/repos/libports/ports/qt5.hash
+++ b/repos/libports/ports/qt5.hash
@@ -1 +1 @@
-bd7410b31ae57d778d9da6599c0a4e887fa44fa8
+36cacf7162bcacbebee09921d0cbb490b704c482
diff --git a/repos/libports/ports/qt5.port b/repos/libports/ports/qt5.port
index 09ed443..a5384ea 100644
--- a/repos/libports/ports/qt5.port
+++ b/repos/libports/ports/qt5.port
@@ -22,10 +22,9 @@ DIR(${QTSCRIPTCLASSIC}) := src/lib/qt5/${QTSCRIPTCLASSIC}
 
 PATCHES_DIR             := $(REP_DIR)/src/lib/qt5/patches
 QT5_PATCHES             := $(shell cat $(PATCHES_DIR)/series)
-QT5_WEBKIT_PATCHES      := $(shell cat $(PATCHES_DIR)/series.qtwebkit)
 QTSCRIPTCLASSIC_PATCHES := $(shell cat $(PATCHES_DIR)/series.qtscriptclassic)
 
-PATCHES := $(addprefix src/lib/qt5/patches/, ${QT5_PATCHES} ${QT5_WEBKIT_PATCHES} ${QTSCRIPTCLASSIC_PATCHES})
+PATCHES := $(addprefix src/lib/qt5/patches/, ${QT5_PATCHES} ${QTSCRIPTCLASSIC_PATCHES})
 
 PATCH_OPT                                                  := -p1 -d ${DIR(${QT5})}
 PATCH_OPT(src/lib/qt5/patches/qtscriptclassic_qt5.patch)   := -p1 -d ${DIR(${QTSCRIPTCLASSIC})}
diff --git a/repos/libports/src/lib/qt5/patches/series b/repos/libports/src/lib/qt5/patches/series
index 5151758..ac85478 100644
--- a/repos/libports/src/lib/qt5/patches/series
+++ b/repos/libports/src/lib/qt5/patches/series
@@ -2,12 +2,16 @@ qtbase_fixes.patch
 qtbase_configuration.patch
 qtdeclarative_configuration.patch
 qttools_configuration.patch
+qtwebkit_fixes.patch
+qtwebkit_configuration.patch
 qtbase_generated.patch
 qtdeclarative_generated.patch
 qttools_generated.patch
+qtwebkit_generated.patch
 qtbase_genode.patch
 qtbase_genode_qtscriptclassic.patch
 qtbase_genode_textedit_example.patch
 qtbase_genode_openglwindow_example.patch
 qtdeclarative_genode.patch
+qtwebkit_genode.patch
 host_tools.patch
diff --git a/repos/libports/src/lib/qt5/patches/series.qtwebkit b/repos/libports/src/lib/qt5/patches/series.qtwebkit
deleted file mode 100644
index 087f72d..0000000
--- a/repos/libports/src/lib/qt5/patches/series.qtwebkit
+++ /dev/null
@@ -1,4 +0,0 @@
-qtwebkit_fixes.patch
-qtwebkit_configuration.patch
-qtwebkit_generated.patch
-qtwebkit_genode.patch
diff --git a/repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs b/repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs
index 3c7f8a1..05c68a2 100755
--- a/repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs
+++ b/repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs
@@ -23,6 +23,10 @@ cd qtdeclarative/src/qml                     && ../../../create_generated_inc qt
 cd qtdeclarative/src/quick                   && ../../../create_generated_inc qt5_quick             && cp qt5_quick_generated.inc ../../..             && cd ../../..
 cd qtdeclarative/src/imports/qtquick2        && ../../../../create_generated_inc qt5_qtquick2plugin && cp qt5_qtquick2plugin_generated.inc ../../../.. && cd ../../../..
 
+cd qtsvg/src/svg                             && ../../../create_generated_inc qt5_svg               && cp qt5_svg_generated.inc ../../..               && cd ../../..
+
+cd qtvirtualkeyboard/src/virtualkeyboard     && ../../../create_generated_inc qt5_qtvirtualkeyboardplugin && cp qt5_qtvirtualkeyboardplugin_generated.inc ../../.. && cd ../../..
+
 # qtwebkit
 
 make -C qtwebkit/Source/JavaScriptCore -f Makefile.JavaScriptCore sub-DerivedSources-pri > JavaScriptCore.log
diff --git a/repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs_with_preparation b/repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs_with_preparation
new file mode 100755
index 0000000..491d9d6
--- /dev/null
+++ b/repos/libports/src/lib/qt5/tools/lib_mk_file_generator/create_generated_incs_with_preparation
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# go to genode directory
+cd ../../../../../../..
+
+# disable patches
+sed -i 's/^QT5_PATCHES/#QT5_PATCHES/' repos/libports/ports/qt5.port
+
+# update port hash
+tool/ports/update_hash qt5
+
+# prepare port
+tool/ports/prepare_port qt5
+
+# go to Qt5 source directory
+cd `tool/ports/current qt5`/src/lib/qt5/qt-everywhere-opensource-src-*
+
+# apply patches
+git init
+git add .
+git commit -m "original"
+stg init
+stg import -s ../../../../../../repos/libports/src/lib/qt5/patches/series
+stg goto qtwebkit_configuration.patch
+
+# go to build directory
+cd ..
+mkdir build
+cd build
+
+# copy scripts into build directory
+cp ../../../../../../repos/libports/src/lib/qt5/tools/lib_mk_file_generator/* .
+
+# generate files
+./create_generated_incs
+
+# copy generated files
+cp qt5_*_generated.inc ../../../../../../repos/libports/lib/mk/
+
+# apply the remaining patches
+cd ../qt-everywhere-opensource-src-*
+stg push -a
















------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main

Reply via email to