diff --git a/.gitignore b/.gitignore index 9a6d3cef38..a911812f64 100644 --- a/.gitignore +++ b/.gitignore @@ -129,6 +129,7 @@ /libports/src/lib/ncurses/make_keys /libports/src/lib/ncurses/names.c /libports/src/lib/ncurses/unctrl.c +/libports/src/lib/qt5/qtjsbackend /libports/src/lib/qt5/qtwebkit/Source/JavaScriptCore /libports/src/lib/qt5/qtwebkit/Source/WebCore/generated /libports/tool/mesa/glsl diff --git a/libports/lib/import/import-qt5_qml.mk b/libports/lib/import/import-qt5_qml.mk new file mode 100644 index 0000000000..cb6cbd6ed8 --- /dev/null +++ b/libports/lib/import/import-qt5_qml.mk @@ -0,0 +1,7 @@ +IMPORT_QT5_INC=$(call select_from_repositories,lib/import/import-qt5.inc) + +include $(IMPORT_QT5_INC) + +QT5_INC_DIR += $(QT5_REP_DIR)/contrib/$(QT5)/qtdeclarative/include +QT5_INC_DIR += $(QT5_REP_DIR)/contrib/$(QT5)/qtdeclarative/include/QtQml + diff --git a/libports/lib/import/import-qt5_qtquick2plugin.mk b/libports/lib/import/import-qt5_qtquick2plugin.mk new file mode 100644 index 0000000000..3a26dc16a5 --- /dev/null +++ b/libports/lib/import/import-qt5_qtquick2plugin.mk @@ -0,0 +1,7 @@ +IMPORT_QT5_INC=$(call select_from_repositories,lib/import/import-qt5.inc) + +include $(IMPORT_QT5_INC) + +#QT5_INC_DIR += $(QT5_REP_DIR)/contrib/$(QT5)/qtdeclarative/include +#QT5_INC_DIR += $(QT5_REP_DIR)/contrib/$(QT5)/qtdeclarative/include/QtQuick + diff --git a/libports/lib/import/import-qt5_quick.mk b/libports/lib/import/import-qt5_quick.mk new file mode 100644 index 0000000000..0f8d0d4348 --- /dev/null +++ b/libports/lib/import/import-qt5_quick.mk @@ -0,0 +1,7 @@ +IMPORT_QT5_INC=$(call select_from_repositories,lib/import/import-qt5.inc) + +include $(IMPORT_QT5_INC) + +QT5_INC_DIR += $(QT5_REP_DIR)/contrib/$(QT5)/qtdeclarative/include +QT5_INC_DIR += $(QT5_REP_DIR)/contrib/$(QT5)/qtdeclarative/include/QtQuick + diff --git a/libports/lib/import/import-qt5_v8.mk b/libports/lib/import/import-qt5_v8.mk new file mode 100644 index 0000000000..b98da501ef --- /dev/null +++ b/libports/lib/import/import-qt5_v8.mk @@ -0,0 +1,5 @@ +IMPORT_QT5_INC=$(call select_from_repositories,lib/import/import-qt5.inc) + +include $(IMPORT_QT5_INC) + +QT5_INC_DIR += $(QT5_REP_DIR)/contrib/$(QT5)/qtjsbackend/include/QtV8 diff --git a/libports/lib/mk/qt5_qml.mk b/libports/lib/mk/qt5_qml.mk new file mode 100644 index 0000000000..e7c42aa1a5 --- /dev/null +++ b/libports/lib/mk/qt5_qml.mk @@ -0,0 +1,12 @@ +include $(REP_DIR)/lib/import/import-qt5_qml.mk + +SHARED_LIB = yes + +include $(REP_DIR)/lib/mk/qt5_qml_generated.inc + +include $(REP_DIR)/lib/mk/qt5.inc + +#INC_DIR += $(REP_DIR)/include/qt5/qtbase/QtXml/private \ +# $(REP_DIR)/contrib/$(QT5)/qtbase/include/QtCore/$(QT_VERSION)/QtCore \ + +LIBS += qt5_v8 qt5_core libc diff --git a/libports/lib/mk/qt5_qml_generated.inc b/libports/lib/mk/qt5_qml_generated.inc new file mode 100644 index 0000000000..34b03928ed --- /dev/null +++ b/libports/lib/mk/qt5_qml_generated.inc @@ -0,0 +1,239 @@ +QT_DEFINES += -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_INTEGER_EVENT_COORDINATES -DQT_BUILD_QML_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 -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_V8_LIB -DV8_SHARED -DUSING_V8_SHARED + +QT_INCPATH += \ + qtbase/include \ + qtbase/include/QtCore \ + qtbase/include/QtCore/5.1.0 \ + qtbase/include/QtCore/5.1.0/QtCore \ + qtbase/include/QtNetwork \ + qtbase/mkspecs/genode-g++ \ + qtdeclarative/include \ + qtdeclarative/include/QtQml \ + qtdeclarative/include/QtQml/5.1.0 \ + qtdeclarative/include/QtQml/5.1.0/QtQml \ + qtdeclarative/src/qml \ + qtdeclarative/src/qml/animations \ + qtjsbackend/include \ + qtjsbackend/include/QtV8 \ + qtjsbackend/include/QtV8/5.1.0 \ + qtjsbackend/include/QtV8/5.1.0/QtV8 \ + +QT_SOURCES += \ + qqmlchangeset.cpp \ + qqmllistaccessor.cpp \ + qqmllistcompositor.cpp \ + qqmladaptormodel.cpp \ + qqmlpropertymap.cpp \ + qqmlinstruction.cpp \ + qqmlopenmetaobject.cpp \ + qqmlvmemetaobject.cpp \ + qqmlengine.cpp \ + qqmlexpression.cpp \ + qqmlproperty.cpp \ + qqmlcomponent.cpp \ + qqmlincubator.cpp \ + qqmlcontext.cpp \ + qqmlcustomparser.cpp \ + qqmlpropertyvaluesource.cpp \ + qqmlpropertyvalueinterceptor.cpp \ + qqmlproxymetaobject.cpp \ + qqmlvme.cpp \ + qqmlcompiler.cpp \ + qqmlcompileddata.cpp \ + qqmlboundsignal.cpp \ + qqmlmetatype.cpp \ + qqmlstringconverters.cpp \ + qqmlparserstatus.cpp \ + qqmltypeloader.cpp \ + qqmlinfo.cpp \ + qqmlerror.cpp \ + qqmlscript.cpp \ + qqmlrewrite.cpp \ + qqmlvaluetype.cpp \ + qqmlaccessors.cpp \ + qqmlxmlhttprequest.cpp \ + qqmlwatcher.cpp \ + qqmlcleanup.cpp \ + qqmlpropertycache.cpp \ + qqmlnotifier.cpp \ + qqmlintegercache.cpp \ + qqmltypenotavailable.cpp \ + qqmltypenamecache.cpp \ + qqmlscriptstring.cpp \ + qqmlnetworkaccessmanagerfactory.cpp \ + qqmldirparser.cpp \ + qqmlextensionplugin.cpp \ + qqmlimport.cpp \ + qqmllist.cpp \ + qqmllocale.cpp \ + qqmlabstractexpression.cpp \ + qqmljavascriptexpression.cpp \ + qqmlabstractbinding.cpp \ + qqmlvaluetypeproxybinding.cpp \ + qqmlglobal.cpp \ + qqmlfile.cpp \ + qqmlbundle.cpp \ + qqmlmemoryprofiler.cpp \ + qqmlplatform.cpp \ + qqmlbinding.cpp \ + qqmlabstracturlinterceptor.cpp \ + qqmlapplicationengine.cpp \ + qqmljsast.cpp \ + qqmljsastvisitor.cpp \ + qqmljsengine_p.cpp \ + qqmljsgrammar.cpp \ + qqmljslexer.cpp \ + qqmljsparser.cpp \ + textwriter.cpp \ + qintrusivelist.cpp \ + qhashedstring.cpp \ + qqmlpool.cpp \ + qqmlthread.cpp \ + qqmltrace.cpp \ + qv4compiler.cpp \ + qv4ir.cpp \ + qv4irbuilder.cpp \ + qv4instruction.cpp \ + qv4bindings.cpp \ + qjsengine.cpp \ + qjsvalue.cpp \ + qjsvalueiterator.cpp \ + qv8stringwrapper.cpp \ + qv8engine.cpp \ + qv8sequencewrapper.cpp \ + qv8contextwrapper.cpp \ + qv8qobjectwrapper.cpp \ + qv8typewrapper.cpp \ + qv8listwrapper.cpp \ + qv8variantwrapper.cpp \ + qv8valuetypewrapper.cpp \ + qv8jsonwrapper.cpp \ + qv8include.cpp \ + qv8worker.cpp \ + qv8bindings.cpp \ + qv8domerrors.cpp \ + qv8sqlerrors.cpp \ + qqmlbuiltinfunctions.cpp \ + qqmldebugservice.cpp \ + qqmlprofilerservice.cpp \ + qqmldebugserver.cpp \ + qqmlinspectorservice.cpp \ + qv8debugservice.cpp \ + qv8profilerservice.cpp \ + qqmlenginedebugservice.cpp \ + qdebugmessageservice.cpp \ + qabstractanimationjob.cpp \ + qanimationgroupjob.cpp \ + qsequentialanimationgroupjob.cpp \ + qparallelanimationgroupjob.cpp \ + qpauseanimationjob.cpp \ + qqmlbind.cpp \ + qqmlconnections.cpp \ + qqmldelegatemodel.cpp \ + qqmllistmodel.cpp \ + qqmllistmodelworkeragent.cpp \ + qqmlmodelsmodule.cpp \ + qqmlobjectmodel.cpp \ + qqmltimer.cpp \ + qquickpackage.cpp \ + qquickworkerscript.cpp \ + qqmlinstantiator.cpp \ + moc_qqmlpropertymap.cpp \ + moc_qqmlglobal_p.cpp \ + moc_qqmlcomponent.cpp \ + moc_qqmlengine.cpp \ + moc_qqmlcontext.cpp \ + moc_qqmlvaluetype_p.cpp \ + moc_qqmlwatcher_p.cpp \ + moc_qqmltypenotavailable_p.cpp \ + moc_qqmlextensionplugin.cpp \ + moc_qqmllocale_p.cpp \ + moc_qqmlcomponentattached_p.cpp \ + moc_qqmlplatform_p.cpp \ + moc_qv8include_p.cpp \ + moc_qqmldebugservice_p.cpp \ + moc_qqmlinspectorservice_p.cpp \ + moc_qv8debugservice_p.cpp \ + moc_qv8profilerservice_p.cpp \ + moc_qqmlenginedebugservice_p.cpp \ + moc_qdebugmessageservice_p.cpp \ + moc_qabstractanimationjob_p.cpp \ + moc_qqmlbind_p.cpp \ + moc_qqmlconnections_p.cpp \ + moc_qqmldelegatemodel_p.cpp \ + moc_qqmldelegatemodel_p_p.cpp \ + moc_qqmllistmodel_p.cpp \ + moc_qqmllistmodel_p_p.cpp \ + moc_qqmllistmodelworkeragent_p.cpp \ + moc_qqmlobjectmodel_p.cpp \ + moc_qqmltimer_p.cpp \ + moc_qquickpackage_p.cpp \ + moc_qquickworkerscript_p.cpp + +QT_VPATH += \ + qtdeclarative/src/qml/animations \ + qtdeclarative/src/qml/debugger \ + qtdeclarative/src/qml/qml \ + qtdeclarative/src/qml/qml/ftw \ + qtdeclarative/src/qml/qml/parser \ + qtdeclarative/src/qml/qml/rewriter \ + qtdeclarative/src/qml/qml/v4 \ + qtdeclarative/src/qml/qml/v8 \ + qtdeclarative/src/qml/types \ + qtdeclarative/src/qml/util \ + +# 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_qqmlpropertymap.cpp \ + moc_qqmlglobal_p.cpp \ + moc_qqmlcomponent.cpp \ + moc_qqmlengine.cpp \ + moc_qqmlcontext.cpp \ + moc_qqmlexpression.cpp \ + moc_qqmlvaluetype_p.cpp \ + moc_qqmlwatcher_p.cpp \ + moc_qqmltypenotavailable_p.cpp \ + moc_qqmlextensionplugin.cpp \ + moc_qqmllocale_p.cpp \ + moc_qqmlcomponentattached_p.cpp \ + moc_qqmlplatform_p.cpp \ + moc_qqmlapplicationengine.cpp \ + moc_qjsengine.cpp \ + moc_qv8include_p.cpp \ + moc_qqmldebugservice_p.cpp \ + moc_qqmldebugserver_p.cpp \ + moc_qqmlinspectorservice_p.cpp \ + moc_qv8debugservice_p.cpp \ + moc_qv8profilerservice_p.cpp \ + moc_qqmlenginedebugservice_p.cpp \ + moc_qdebugmessageservice_p.cpp \ + moc_qabstractanimationjob_p.cpp \ + moc_qqmlbind_p.cpp \ + moc_qqmlconnections_p.cpp \ + moc_qqmldelegatemodel_p.cpp \ + moc_qqmldelegatemodel_p_p.cpp \ + moc_qqmllistmodel_p.cpp \ + moc_qqmllistmodel_p_p.cpp \ + moc_qqmllistmodelworkeragent_p.cpp \ + moc_qqmlobjectmodel_p.cpp \ + moc_qqmltimer_p.cpp \ + moc_qquickpackage_p.cpp \ + moc_qquickworkerscript_p.cpp \ + moc_qqmlinstantiator_p.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 = \ + qqmladaptormodel.moc \ + qqmltypeloader.moc \ + qqmlxmlhttprequest.moc \ + qqmlwatcher.moc \ + qqmlfile.moc \ + qquickworkerscript.moc + diff --git a/libports/lib/mk/qt5_qtquick2plugin.mk b/libports/lib/mk/qt5_qtquick2plugin.mk new file mode 100644 index 0000000000..95d5ea083b --- /dev/null +++ b/libports/lib/mk/qt5_qtquick2plugin.mk @@ -0,0 +1,39 @@ +include $(REP_DIR)/lib/import/import-qt5_qtquick2plugin.mk + +SHARED_LIB = yes + +include $(REP_DIR)/lib/mk/qt5_qtquick2plugin_generated.inc + +QT_DEFINES += -UQT_STATICPLUGIN + +include $(REP_DIR)/lib/mk/qt5.inc + +LIBS += qt5_qml + +# install the QtQuick QML plugin + +QTQUICK_INSTALL_DIR := $(BUILD_BASE_DIR)/bin/qt5_fs/qt5/qml/QtQuick.2 +QTQUICK_QMLDIR := $(QTQUICK_INSTALL_DIR)/qmldir +QTQUICK_PLUGIN_NAME := qt5_qtquick2plugin.lib.so +QTQUICK_PLUGIN := $(QTQUICK_INSTALL_DIR)/$(QTQUICK_PLUGIN_NAME) + +$(QTQUICK_INSTALL_DIR): + $(VERBOSE)mkdir -p $@ + +$(QTQUICK_QMLDIR): $(QTQUICK_INSTALL_DIR) + $(VERBOSE)cp $(REP_DIR)/contrib/$(QT5)/qtdeclarative/src/imports/qtquick2/qmldir $(QTQUICK_INSTALL_DIR) + +$(QTQUICK_PLUGIN): $(QTQUICK_INSTALL_DIR) + $(VERBOSE)ln -sf $(BUILD_BASE_DIR)/bin/$(QTQUICK_PLUGIN_NAME) $(QTQUICK_INSTALL_DIR)/$(QTQUICK_PLUGIN_NAME) + +all: $(QTQUICK_QMLDIR) $(QTQUICK_PLUGIN) + +# +# unfortunately, these clean rules don't trigger +# + +clean-qtquick_install_dir: + rm -rf $(QTQUICK_INSTALL_DIR) + +clean: clean-qtquick_install_dir + diff --git a/libports/lib/mk/qt5_qtquick2plugin_generated.inc b/libports/lib/mk/qt5_qtquick2plugin_generated.inc new file mode 100644 index 0000000000..828baa9745 --- /dev/null +++ b/libports/lib/mk/qt5_qtquick2plugin_generated.inc @@ -0,0 +1,38 @@ +QT_DEFINES += -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB + +QT_INCPATH += \ + qtbase/include \ + qtbase/include/QtCore \ + qtbase/include/QtGui \ + qtbase/include/QtNetwork \ + qtbase/mkspecs/genode-g++ \ + qtdeclarative/include \ + qtdeclarative/include/QtQml \ + qtdeclarative/include/QtQml/5.1.0 \ + qtdeclarative/include/QtQml/5.1.0/QtQml \ + qtdeclarative/include/QtQuick \ + qtdeclarative/include/QtQuick/5.1.0 \ + qtdeclarative/include/QtQuick/5.1.0/QtQuick \ + qtdeclarative/src/imports/qtquick2 \ + +QT_SOURCES += \ + plugin.cpp + +QT_VPATH += \ + qtdeclarative/src/imports/qtquick2 \ + +# 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 = \ + + +# 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 = \ + plugin.moc + diff --git a/libports/lib/mk/qt5_quick.mk b/libports/lib/mk/qt5_quick.mk new file mode 100644 index 0000000000..ec180d95e1 --- /dev/null +++ b/libports/lib/mk/qt5_quick.mk @@ -0,0 +1,11 @@ +include $(REP_DIR)/lib/import/import-qt5_quick.mk + +SHARED_LIB = yes + +include $(REP_DIR)/lib/mk/qt5_quick_generated.inc + +QT_INCPATH += qtdeclarative/src/quick/items + +include $(REP_DIR)/lib/mk/qt5.inc + +LIBS += qt5_qml diff --git a/libports/lib/mk/qt5_quick_generated.inc b/libports/lib/mk/qt5_quick_generated.inc new file mode 100644 index 0000000000..1f59c2c2fc --- /dev/null +++ b/libports/lib/mk/qt5_quick_generated.inc @@ -0,0 +1,344 @@ +QT_DEFINES += -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_INTEGER_EVENT_COORDINATES -DQT_BUILD_QUICK_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 -DQT_NO_DEBUG -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_V8_LIB -DV8_SHARED -DUSING_V8_SHARED + +QT_INCPATH += \ + qtbase/include \ + qtbase/include/QtCore \ + qtbase/include/QtCore/5.1.0 \ + qtbase/include/QtCore/5.1.0/QtCore \ + qtbase/include/QtGui \ + qtbase/include/QtGui/5.1.0 \ + qtbase/include/QtGui/5.1.0/QtGui \ + qtbase/include/QtNetwork \ + qtbase/mkspecs/genode-g++ \ + qtdeclarative/include \ + qtdeclarative/include/QtQml \ + qtdeclarative/include/QtQml/5.1.0 \ + qtdeclarative/include/QtQml/5.1.0/QtQml \ + qtdeclarative/include/QtQuick \ + qtdeclarative/include/QtQuick/5.1.0 \ + qtdeclarative/include/QtQuick/5.1.0/QtQuick \ + qtdeclarative/src/quick \ + qtjsbackend/include \ + qtjsbackend/include/QtV8 \ + qtjsbackend/include/QtV8/5.1.0 \ + qtjsbackend/include/QtV8/5.1.0/QtV8 \ + +QT_SOURCES += \ + qquickapplication.cpp \ + qquickutilmodule.cpp \ + qquickanimation.cpp \ + qquicksystempalette.cpp \ + qquickspringanimation.cpp \ + qquicksmoothedanimation.cpp \ + qquickanimationcontroller.cpp \ + qquickstate.cpp \ + qquicktransitionmanager.cpp \ + qquickstatechangescript.cpp \ + qquickpropertychanges.cpp \ + qquickstategroup.cpp \ + qquicktransition.cpp \ + qquicktimeline.cpp \ + qquickpixmapcache.cpp \ + qquickbehavior.cpp \ + qquickfontloader.cpp \ + qquickstyledtext.cpp \ + qquickpath.cpp \ + qquickpathinterpolator.cpp \ + qquickimageprovider.cpp \ + qquicksvgparser.cpp \ + qquickvaluetypes.cpp \ + qquickglobal.cpp \ + qsgdefaultrenderer.cpp \ + qsggeometry.cpp \ + qsgmaterial.cpp \ + qsgnode.cpp \ + qsgnodeupdater.cpp \ + qsgrenderer.cpp \ + qsgrendernode.cpp \ + qsgsimplematerial.cpp \ + qsgareaallocator.cpp \ + qsgdepthstencilbuffer.cpp \ + qsgflatcolormaterial.cpp \ + qsgsimplerectnode.cpp \ + qsgsimpletexturenode.cpp \ + qsgtexturematerial.cpp \ + qsgvertexcolormaterial.cpp \ + qsgtexture.cpp \ + qsgtextureprovider.cpp \ + qsgpainternode.cpp \ + qsgdistancefieldutil.cpp \ + qsgadaptationlayer.cpp \ + qsgcontext.cpp \ + qsgcontextplugin.cpp \ + qsgdefaultglyphnode.cpp \ + qsgdefaultglyphnode_p.cpp \ + qsgdefaultdistancefieldglyphcache.cpp \ + qsgdistancefieldglyphnode.cpp \ + qsgdistancefieldglyphnode_p.cpp \ + qsgdefaultimagenode.cpp \ + qsgdefaultrectanglenode.cpp \ + qsgflashnode.cpp \ + qsgshareddistancefieldglyphcache.cpp \ + qsgrenderloop.cpp \ + qsgthreadedrenderloop.cpp \ + qsgwindowsrenderloop.cpp \ + qquickevents.cpp \ + qquickanchors.cpp \ + qquickitem.cpp \ + qquickrectangle.cpp \ + qquickwindow.cpp \ + qquickfocusscope.cpp \ + qquickitemsmodule.cpp \ + qquickpainteditem.cpp \ + qquicktext.cpp \ + qquicktextnode.cpp \ + qquicktextnodeengine.cpp \ + qquicktextinput.cpp \ + qquicktextcontrol.cpp \ + qquicktextdocument.cpp \ + qquicktextedit.cpp \ + qquicktextutil.cpp \ + qquickimagebase.cpp \ + qquickimage.cpp \ + qquickborderimage.cpp \ + qquickscalegrid.cpp \ + qquickmousearea.cpp \ + qquickpincharea.cpp \ + qquickflickable.cpp \ + qquicklistview.cpp \ + qquickrepeater.cpp \ + qquickgridview.cpp \ + qquickpathview.cpp \ + qquickpositioners.cpp \ + qquickloader.cpp \ + qquickanimatedimage.cpp \ + qquickflipable.cpp \ + qquicktranslate.cpp \ + qquickclipnode.cpp \ + qquickview.cpp \ + qquickitemanimation.cpp \ + qquickstateoperations.cpp \ + qquickimplicitsizeitem.cpp \ + qquickspriteengine.cpp \ + qquicksprite.cpp \ + qquickspritesequence.cpp \ + qquickanimatedsprite.cpp \ + qquickaccessibleattached.cpp \ + qquickdrag.cpp \ + qquickdroparea.cpp \ + qquickmultipointtoucharea.cpp \ + qquickitemview.cpp \ + qquickitemviewtransition.cpp \ + qquickwindowmodule.cpp \ + qquickscreen.cpp \ + qquickshadereffect.cpp \ + qquickshadereffectmesh.cpp \ + qquickshadereffectnode.cpp \ + qquickshadereffectsource.cpp \ + qquickcanvasitem.cpp \ + qquickcanvascontext.cpp \ + qquickcontext2d.cpp \ + qquickcontext2dtile.cpp \ + qquickcontext2dtexture.cpp \ + qquickcontext2dcommandbuffer.cpp \ + designersupport.cpp \ + designerwindowmanager.cpp \ + qtquick2.cpp \ + moc_qquickapplication_p.cpp \ + moc_qquickanimation_p.cpp \ + moc_qquicksystempalette_p.cpp \ + moc_qquickspringanimation_p.cpp \ + moc_qquickanimationcontroller_p.cpp \ + moc_qquicksmoothedanimation_p.cpp \ + moc_qquicksmoothedanimation_p_p.cpp \ + moc_qquickstate_p.cpp \ + moc_qquickpropertychanges_p.cpp \ + moc_qquickstategroup_p.cpp \ + moc_qquicktransition_p.cpp \ + moc_qquicktimeline_p_p.cpp \ + moc_qquickpixmapcache_p.cpp \ + moc_qquickbehavior_p.cpp \ + moc_qquickfontloader_p.cpp \ + moc_qquickpath_p.cpp \ + moc_qquickpathinterpolator_p.cpp \ + moc_qquickvaluetypes_p.cpp \ + moc_qsgdefaultrenderer_p.cpp \ + moc_qsgrenderer_p.cpp \ + moc_qsgtexture.cpp \ + moc_qsgtexture_p.cpp \ + moc_qsgtextureprovider.cpp \ + moc_qsgcontext_p.cpp \ + moc_qsgcontextplugin_p.cpp \ + moc_qsgshareddistancefieldglyphcache_p.cpp \ + moc_qsgrenderloop_p.cpp \ + moc_qsgthreadedrenderloop_p.cpp \ + moc_qsgwindowsrenderloop_p.cpp \ + moc_qquickevents_p_p.cpp \ + moc_qquickaccessibleattached_p.cpp \ + moc_qquickitem_p.cpp \ + moc_qquickrectangle_p.cpp \ + moc_qquickwindow_p.cpp \ + moc_qquickfocusscope_p.cpp \ + moc_qquickpainteditem.cpp \ + moc_qquicktext_p.cpp \ + moc_qquicktext_p_p.cpp \ + moc_qquicktextinput_p.cpp \ + moc_qquicktextdocument.cpp \ + moc_qquicktextedit_p.cpp \ + moc_qquicktextutil_p.cpp \ + moc_qquickimagebase_p.cpp \ + moc_qquickimage_p.cpp \ + moc_qquickborderimage_p.cpp \ + moc_qquickscalegrid_p_p.cpp \ + moc_qquickmousearea_p.cpp \ + moc_qquickpincharea_p.cpp \ + moc_qquickflickable_p.cpp \ + moc_qquickflickable_p_p.cpp \ + moc_qquicklistview_p.cpp \ + moc_qquickrepeater_p.cpp \ + moc_qquickgridview_p.cpp \ + moc_qquickpathview_p.cpp \ + moc_qquickpositioners_p.cpp \ + moc_qquickanimatedimage_p.cpp \ + moc_qquickflipable_p.cpp \ + moc_qquicktranslate_p.cpp \ + moc_qquickview.cpp \ + moc_qquickitemanimation_p.cpp \ + moc_qquickimplicitsizeitem_p.cpp \ + moc_qquickspriteengine_p.cpp \ + moc_qquicksprite_p.cpp \ + moc_qquickspritesequence_p.cpp \ + moc_qquickanimatedsprite_p.cpp \ + moc_qquickdrag_p.cpp \ + moc_qquickdroparea_p.cpp \ + moc_qquickmultipointtoucharea_p.cpp \ + moc_qquickitemview_p.cpp \ + moc_qquickitemviewtransition_p.cpp \ + moc_qquickscreen_p.cpp \ + moc_qquickshadereffect_p.cpp \ + moc_qquickshadereffectmesh_p.cpp \ + moc_qquickshadereffectnode_p.cpp \ + moc_qquickshadereffectsource_p.cpp \ + moc_qquickcanvasitem_p.cpp \ + moc_qquickcanvascontext_p.cpp \ + moc_qquickcontext2dtexture_p.cpp \ + moc_designerwindowmanager_p.cpp + +QT_VPATH += \ + qtdeclarative/src/quick \ + qtdeclarative/src/quick/designer \ + qtdeclarative/src/quick/items \ + qtdeclarative/src/quick/items/context2d \ + qtdeclarative/src/quick/scenegraph \ + qtdeclarative/src/quick/scenegraph/coreapi \ + qtdeclarative/src/quick/scenegraph/util \ + qtdeclarative/src/quick/util \ + +# 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_qquickapplication_p.cpp \ + moc_qquickanimation_p.cpp \ + moc_qquicksystempalette_p.cpp \ + moc_qquickspringanimation_p.cpp \ + moc_qquickanimationcontroller_p.cpp \ + moc_qquicksmoothedanimation_p.cpp \ + moc_qquicksmoothedanimation_p_p.cpp \ + moc_qquickstate_p.cpp \ + moc_qquickstatechangescript_p.cpp \ + moc_qquickpropertychanges_p.cpp \ + moc_qquickstategroup_p.cpp \ + moc_qquicktransition_p.cpp \ + moc_qquicktimeline_p_p.cpp \ + moc_qquickpixmapcache_p.cpp \ + moc_qquickbehavior_p.cpp \ + moc_qquickfontloader_p.cpp \ + moc_qquickpath_p.cpp \ + moc_qquickpathinterpolator_p.cpp \ + moc_qquickvaluetypes_p.cpp \ + moc_qsgdefaultrenderer_p.cpp \ + moc_qsgrenderer_p.cpp \ + moc_qsgtexture.cpp \ + moc_qsgtexture_p.cpp \ + moc_qsgtextureprovider.cpp \ + moc_qsgcontext_p.cpp \ + moc_qsgcontextplugin_p.cpp \ + moc_qsgshareddistancefieldglyphcache_p.cpp \ + moc_qsgrenderloop_p.cpp \ + moc_qsgthreadedrenderloop_p.cpp \ + moc_qsgwindowsrenderloop_p.cpp \ + moc_qquickevents_p_p.cpp \ + moc_qquickanchors_p.cpp \ + moc_qquickaccessibleattached_p.cpp \ + moc_qquickitem.cpp \ + moc_qquickitem_p.cpp \ + moc_qquickrectangle_p.cpp \ + moc_qquickwindow.cpp \ + moc_qquickwindow_p.cpp \ + moc_qquickfocusscope_p.cpp \ + moc_qquickpainteditem.cpp \ + moc_qquicktext_p.cpp \ + moc_qquicktext_p_p.cpp \ + moc_qquicktextinput_p.cpp \ + moc_qquicktextcontrol_p.cpp \ + moc_qquicktextdocument.cpp \ + moc_qquicktextedit_p.cpp \ + moc_qquicktextutil_p.cpp \ + moc_qquickimagebase_p.cpp \ + moc_qquickimage_p.cpp \ + moc_qquickborderimage_p.cpp \ + moc_qquickscalegrid_p_p.cpp \ + moc_qquickmousearea_p.cpp \ + moc_qquickpincharea_p.cpp \ + moc_qquickflickable_p.cpp \ + moc_qquickflickable_p_p.cpp \ + moc_qquicklistview_p.cpp \ + moc_qquickrepeater_p.cpp \ + moc_qquickgridview_p.cpp \ + moc_qquickpathview_p.cpp \ + moc_qquickpositioners_p.cpp \ + moc_qquickloader_p.cpp \ + moc_qquickanimatedimage_p.cpp \ + moc_qquickflipable_p.cpp \ + moc_qquicktranslate_p.cpp \ + moc_qquickview.cpp \ + moc_qquickitemanimation_p.cpp \ + moc_qquickstateoperations_p.cpp \ + moc_qquickimplicitsizeitem_p.cpp \ + moc_qquickspriteengine_p.cpp \ + moc_qquicksprite_p.cpp \ + moc_qquickspritesequence_p.cpp \ + moc_qquickanimatedsprite_p.cpp \ + moc_qquickdrag_p.cpp \ + moc_qquickdroparea_p.cpp \ + moc_qquickmultipointtoucharea_p.cpp \ + moc_qquickitemview_p.cpp \ + moc_qquickitemviewtransition_p.cpp \ + moc_qquickscreen_p.cpp \ + moc_qquickshadereffect_p.cpp \ + moc_qquickshadereffectmesh_p.cpp \ + moc_qquickshadereffectnode_p.cpp \ + moc_qquickshadereffectsource_p.cpp \ + moc_qquickcanvasitem_p.cpp \ + moc_qquickcanvascontext_p.cpp \ + moc_qquickcontext2dtexture_p.cpp \ + moc_designerwindowmanager_p.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 = \ + qquickpixmapcache.moc \ + qquickfontloader.moc \ + qsgrenderloop.moc \ + qsgthreadedrenderloop.moc \ + qquickwindow.moc \ + qquickimage.moc \ + qquickflipable.moc \ + qquickwindowmodule.moc \ + qquickshadereffectsource.moc + diff --git a/libports/lib/mk/qt5_v8.mk b/libports/lib/mk/qt5_v8.mk new file mode 100644 index 0000000000..67dc909d14 --- /dev/null +++ b/libports/lib/mk/qt5_v8.mk @@ -0,0 +1,83 @@ +include $(REP_DIR)/lib/import/import-qt5_v8.mk + +SHARED_LIB = yes + +include $(REP_DIR)/lib/mk/qt5_v8_generated.inc + +# +# Qt was configured for x86_64. +# If the Genode target architecture differs, the x86_64-files need to get removed first. +# +ifneq ($(filter-out $(SPECS),x86_64),) +QT_DEFINES += -UV8_TARGET_ARCH_X64 +QT_SOURCES_FILTER_OUT = \ + assembler-x64.cc \ + builtins-x64.cc \ + code-stubs-x64.cc \ + codegen-x64.cc \ + cpu-x64.cc \ + debug-x64.cc \ + deoptimizer-x64.cc \ + disasm-x64.cc \ + frames-x64.cc \ + full-codegen-x64.cc \ + ic-x64.cc \ + lithium-codegen-x64.cc \ + lithium-gap-resolver-x64.cc \ + lithium-x64.cc \ + macro-assembler-x64.cc \ + regexp-macro-assembler-x64.cc \ + stub-cache-x64.cc +ifeq ($(filter-out $(SPECS),x86_32),) +QT_DEFINES += -DV8_TARGET_ARCH_IA32 +QT_SOURCES += \ + assembler-ia32.cc \ + builtins-ia32.cc \ + code-stubs-ia32.cc \ + codegen-ia32.cc \ + cpu-ia32.cc \ + debug-ia32.cc \ + deoptimizer-ia32.cc \ + disasm-ia32.cc \ + frames-ia32.cc \ + full-codegen-ia32.cc \ + ic-ia32.cc \ + lithium-codegen-ia32.cc \ + lithium-gap-resolver-ia32.cc \ + lithium-ia32.cc \ + macro-assembler-ia32.cc \ + regexp-macro-assembler-ia32.cc \ + stub-cache-ia32.cc +QT_VPATH += qtjsbackend/src/3rdparty/v8/src/ia32 +else +ifeq ($(filter-out $(SPECS),arm),) +QT_DEFINES += -DV8_TARGET_ARCH_ARM +QT_SOURCES += \ + assembler-arm.cc \ + builtins-arm.cc \ + code-stubs-arm.cc \ + codegen-arm.cc \ + cpu-arm.cc \ + debug-arm.cc \ + deoptimizer-arm.cc \ + disasm-arm.cc \ + frames-arm.cc \ + full-codegen-arm.cc \ + ic-arm.cc \ + lithium-codegen-arm.cc \ + lithium-gap-resolver-arm.cc \ + lithium-arm.cc \ + macro-assembler-arm.cc \ + regexp-macro-assembler-arm.cc \ + stub-cache-arm.cc +QT_VPATH += qtjsbackend/src/3rdparty/v8/src/arm +endif +endif +endif + +QT_VPATH += qtjsbackend/generated + +include $(REP_DIR)/lib/mk/qt5.inc + +LIBS += qt5_network + diff --git a/libports/lib/mk/qt5_v8_generated.inc b/libports/lib/mk/qt5_v8_generated.inc new file mode 100644 index 0000000000..14fdc5df23 --- /dev/null +++ b/libports/lib/mk/qt5_v8_generated.inc @@ -0,0 +1,161 @@ +QT_DEFINES += -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_BUILD_V8_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 -DV8_SHARED -DBUILDING_V8_SHARED -DENABLE_DEBUGGER_SUPPORT -DENABLE_VMSTATE_TRACKING -DENABLE_LOGGING_AND_PROFILING -DNDEBUG -DV8_TARGET_ARCH_X64 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG + +QT_INCPATH += \ + qtbase/mkspecs/genode-g++ \ + qtjsbackend/include \ + qtjsbackend/include/QtV8 \ + qtjsbackend/include/QtV8/5.1.0 \ + qtjsbackend/include/QtV8/5.1.0/QtV8 \ + qtjsbackend/src/3rdparty/v8/src \ + qtjsbackend/src/v8 \ + +QT_SOURCES += \ + accessors.cc \ + allocation.cc \ + api.cc \ + assembler.cc \ + ast.cc \ + atomicops_internals_x86_gcc.cc \ + bignum.cc \ + bignum-dtoa.cc \ + bootstrapper.cc \ + builtins.cc \ + cached-powers.cc \ + checks.cc \ + circular-queue.cc \ + code-stubs.cc \ + codegen.cc \ + compilation-cache.cc \ + compiler.cc \ + contexts.cc \ + conversions.cc \ + counters.cc \ + cpu-profiler.cc \ + data-flow.cc \ + date.cc \ + dateparser.cc \ + debug-agent.cc \ + debug.cc \ + deoptimizer.cc \ + disassembler.cc \ + diy-fp.cc \ + dtoa.cc \ + elements.cc \ + elements-kind.cc \ + execution.cc \ + factory.cc \ + flags.cc \ + frames.cc \ + full-codegen.cc \ + func-name-inferrer.cc \ + gdb-jit.cc \ + global-handles.cc \ + fast-dtoa.cc \ + fixed-dtoa.cc \ + handles.cc \ + heap-profiler.cc \ + heap.cc \ + hydrogen.cc \ + hydrogen-instructions.cc \ + ic.cc \ + incremental-marking.cc \ + inspector.cc \ + interface.cc \ + interpreter-irregexp.cc \ + isolate.cc \ + jsregexp.cc \ + lithium-allocator.cc \ + lithium.cc \ + liveedit.cc \ + liveobjectlist.cc \ + log-utils.cc \ + log.cc \ + mark-compact.cc \ + messages.cc \ + objects.cc \ + objects-printer.cc \ + objects-visiting.cc \ + once.cc \ + optimizing-compiler-thread.cc \ + parser.cc \ + preparser.cc \ + preparse-data.cc \ + profile-generator.cc \ + property.cc \ + regexp-macro-assembler-irregexp.cc \ + regexp-macro-assembler.cc \ + regexp-stack.cc \ + rewriter.cc \ + runtime.cc \ + runtime-profiler.cc \ + safepoint-table.cc \ + scanner.cc \ + scanner-character-streams.cc \ + scopeinfo.cc \ + scopes.cc \ + serialize.cc \ + snapshot-common.cc \ + spaces.cc \ + string-search.cc \ + string-stream.cc \ + strtod.cc \ + stub-cache.cc \ + token.cc \ + transitions.cc \ + type-info.cc \ + unicode.cc \ + utils.cc \ + v8-counters.cc \ + v8.cc \ + v8conversions.cc \ + v8threads.cc \ + v8utils.cc \ + variables.cc \ + version.cc \ + store-buffer.cc \ + zone.cc \ + externalize-string-extension.cc \ + gc-extension.cc \ + statistics-extension.cc \ + assembler-x64.cc \ + builtins-x64.cc \ + code-stubs-x64.cc \ + codegen-x64.cc \ + cpu-x64.cc \ + debug-x64.cc \ + deoptimizer-x64.cc \ + disasm-x64.cc \ + frames-x64.cc \ + full-codegen-x64.cc \ + ic-x64.cc \ + lithium-codegen-x64.cc \ + lithium-gap-resolver-x64.cc \ + lithium-x64.cc \ + macro-assembler-x64.cc \ + regexp-macro-assembler-x64.cc \ + stub-cache-x64.cc \ + platform-genode.cc \ + platform-posix.cc \ + objects-debug.cc \ + prettyprinter.cc \ + regexp-macro-assembler-tracer.cc \ + snapshot-empty.cc \ + libraries.cpp \ + experimental-libraries.cpp + +QT_VPATH += \ + qtjsbackend/src/3rdparty/v8/src \ + qtjsbackend/src/3rdparty/v8/src/extensions \ + qtjsbackend/src/3rdparty/v8/src/x64 \ + +# 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 + + +# source files generated from existing source files ('%.moc: %.cpp' rule in import-qt5.inc) +# extracted from 'compiler_moc_source_make_all' rule + + diff --git a/libports/ports/qt5.mk b/libports/ports/qt5.mk index e9a894ce9e..3d5dd4cff5 100644 --- a/libports/ports/qt5.mk +++ b/libports/ports/qt5.mk @@ -25,6 +25,7 @@ PORTS += qt5 prepare-qt5: $(CONTRIB_DIR)/$(QT5) \ $(CONTRIB_DIR)/$(QTSCRIPTCLASSIC) \ tools \ + $(REP_DIR)/src/lib/qt5/qtjsbackend/generated/generated.tag \ $(REP_DIR)/src/lib/qt5/qtwebkit/Source/JavaScriptCore/generated/generated.tag \ $(REP_DIR)/src/lib/qt5/qtwebkit/Source/WebCore/generated/generated.tag @@ -74,6 +75,17 @@ $(CONTRIB_DIR)/$(QTSCRIPTCLASSIC): $(DOWNLOAD_DIR)/$(QTSCRIPTCLASSIC_TGZ).verifi # some of the following lines have been extracted from Makefiles (and modified afterwards), that's why they can be quite long # +V8_DIR = $(CONTRIB_DIR)/$(QT5)/qtjsbackend/src/v8/../3rdparty/v8 + +$(REP_DIR)/src/lib/qt5/qtjsbackend/generated/generated.tag: + + $(VERBOSE)mkdir -p $(dir $@) + + $(VERBOSE)python $(V8_DIR)/tools/js2c.py $(dir $@)/experimental-libraries.cpp EXPERIMENTAL off $(V8_DIR)/src/macros.py $(V8_DIR)/src/proxy.js + + $(VERBOSE)python $(V8_DIR)/tools/js2c.py $(dir $@)/libraries.cpp CORE off $(V8_DIR)/src/macros.py $(V8_DIR)/src/runtime.js $(V8_DIR)/src/v8natives.js $(V8_DIR)/src/array.js $(V8_DIR)/src/string.js $(V8_DIR)/src/uri.js $(V8_DIR)/src/math.js $(V8_DIR)/src/messages.js $(V8_DIR)/src/apinatives.js $(V8_DIR)/src/date.js $(V8_DIR)/src/regexp.js $(V8_DIR)/src/json.js $(V8_DIR)/src/liveedit-debugger.js $(V8_DIR)/src/mirror-debugger.js $(V8_DIR)/src/debug-debugger.js + + JAVASCRIPTCORE_DIR = $(CONTRIB_DIR)/$(QT5)/qtwebkit/Source/JavaScriptCore $(REP_DIR)/src/lib/qt5/qtwebkit/Source/JavaScriptCore/generated/generated.tag: diff --git a/libports/run/qt5_quicktest.run b/libports/run/qt5_quicktest.run new file mode 100644 index 0000000000..c80204f9ed --- /dev/null +++ b/libports/run/qt5_quicktest.run @@ -0,0 +1,158 @@ +# +# Build +# + +build { + core + init + drivers/input/ps2 + drivers/pci + drivers/framebuffer + drivers/timer + server/nitpicker + server/liquid_framebuffer + server/tar_fs + app/qt5/qt_quicktest + lib/qt5/qtdeclarative/src/imports/qtquick2 +} + +create_boot_directory + +# +# Create Qt tar archive +# + +exec tar chf bin/qt5_fs.tar -C bin/qt5_fs . + +# +# Generate config +# + +set config { + + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec framebuffer] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + + + + + + + + + +} + +install_config $config + +# +# Boot modules +# + +# generic modules + +# The QtQuick plugin currently needs to be provided both in the file system +# (for Qt) and as ROM module (for 'dlopen()'). + +set boot_modules { + core + init + timer + nitpicker + liquid_fb + tar_fs + qt_quicktest + freetype.lib.so + gallium.lib.so + icu.lib.so + ld.lib.so + libc.lib.so + libc_fs.lib.so + libc_log.lib.so + libc_lock_pipe.lib.so + libcrypto.lib.so + libm.lib.so + libpng.lib.so + libssl.lib.so + jpeg.lib.so + pthread.lib.so + qt5_core.lib.so + qt5_dejavusans.lib.so + qt5_network.lib.so + qt5_qml.lib.so + qt5_gui.lib.so + qt5_quick.lib.so + qt5_v8.lib.so + qt5_widgets.lib.so + qt5_xml.lib.so + zlib.lib.so + stdcxx.lib.so + qt5_fs.tar + qt5_qtquick2plugin.lib.so +} + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec framebuffer] boot_modules fb_drv +lappend_if [have_spec ps2] boot_modules ps2_drv + +build_boot_image $boot_modules + +append qemu_args " -m 256" + +run_genode_until forever diff --git a/libports/run/qt5_samegame.run b/libports/run/qt5_samegame.run new file mode 100644 index 0000000000..ba4d3647e6 --- /dev/null +++ b/libports/run/qt5_samegame.run @@ -0,0 +1,158 @@ +# +# Build +# + +build { + core + init + drivers/input/ps2 + drivers/pci + drivers/framebuffer + drivers/timer + server/nitpicker + server/liquid_framebuffer + server/tar_fs + app/qt5/examples/samegame + lib/qt5/qtdeclarative/src/imports/qtquick2 +} + +create_boot_directory + +# +# Create Qt tar archive +# + +exec tar chf bin/qt5_fs.tar -C bin/qt5_fs . + +# +# Generate config +# + +set config { + + + + + + + + + + + + + + + + + } + +append_if [have_spec sdl] config { + + + + + + + } + +append_if [have_spec pci] config { + + + + } + +append_if [have_spec framebuffer] config { + + + + } + +append_if [have_spec ps2] config { + + + + } + +append config { + + + + + + + + + + + + + + + + + + + + +} + +install_config $config + +# +# Boot modules +# + +# generic modules + +# The QtQuick plugin currently needs to be provided both in the file system +# (for Qt) and as ROM module (for 'dlopen()'). + +set boot_modules { + core + init + timer + nitpicker + liquid_fb + tar_fs + samegame + freetype.lib.so + gallium.lib.so + icu.lib.so + ld.lib.so + libc.lib.so + libc_fs.lib.so + libc_log.lib.so + libc_lock_pipe.lib.so + libcrypto.lib.so + libm.lib.so + libpng.lib.so + libssl.lib.so + jpeg.lib.so + pthread.lib.so + qt5_core.lib.so + qt5_dejavusans.lib.so + qt5_network.lib.so + qt5_qml.lib.so + qt5_gui.lib.so + qt5_quick.lib.so + qt5_v8.lib.so + qt5_widgets.lib.so + qt5_xml.lib.so + zlib.lib.so + stdcxx.lib.so + qt5_fs.tar + qt5_qtquick2plugin.lib.so +} + +# platform-specific modules +lappend_if [have_spec linux] boot_modules fb_sdl +lappend_if [have_spec pci] boot_modules pci_drv +lappend_if [have_spec framebuffer] boot_modules fb_drv +lappend_if [have_spec ps2] boot_modules ps2_drv + +build_boot_image $boot_modules + +append qemu_args " -m 256" + +run_genode_until forever diff --git a/libports/src/app/qt5/examples/samegame/main.cpp b/libports/src/app/qt5/examples/samegame/main.cpp new file mode 100644 index 0000000000..8ef3bdee83 --- /dev/null +++ b/libports/src/app/qt5/examples/samegame/main.cpp @@ -0,0 +1,19 @@ +/* + * \brief QtQuick 'samegame' example + * \author Christian Prochaska + * \date 2013-11-26 + */ + +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQuickView view; + view.setSource(QUrl("qrc:/samegame.qml")); + view.show(); + + return app.exec(); +} diff --git a/libports/src/app/qt5/examples/samegame/samegame.pro b/libports/src/app/qt5/examples/samegame/samegame.pro new file mode 100644 index 0000000000..2fe8dfc33a --- /dev/null +++ b/libports/src/app/qt5/examples/samegame/samegame.pro @@ -0,0 +1,3 @@ +QT += quick +SOURCES += main.cpp +RESOURCES += samegame.qrc diff --git a/libports/src/app/qt5/examples/samegame/samegame.qrc b/libports/src/app/qt5/examples/samegame/samegame.qrc new file mode 100644 index 0000000000..21db4aa74b --- /dev/null +++ b/libports/src/app/qt5/examples/samegame/samegame.qrc @@ -0,0 +1,17 @@ + + + +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/samegame3/samegame.qml +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/samegame3/Dialog.qml +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/samegame3/Button.qml +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/samegame3/Block.qml +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/samegame3/samegame.js + + +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/shared/pics/background.jpg +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/shared/pics/blueStone.png +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/shared/pics/greenStone.png +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/shared/pics/redStone.png +../../../../../contrib/qt-everywhere-opensource-src-5.1.0/qtdeclarative/examples/quick/tutorials/samegame/shared/pics/yellowStone.png + + diff --git a/libports/src/app/qt5/examples/samegame/target.mk b/libports/src/app/qt5/examples/samegame/target.mk new file mode 100644 index 0000000000..ad944a423d --- /dev/null +++ b/libports/src/app/qt5/examples/samegame/target.mk @@ -0,0 +1,10 @@ +# identify the qt5 repository by searching for a file that is unique for qt5 +QT5_REP_DIR := $(call select_from_repositories,lib/import/import-qt5.inc) +QT5_REP_DIR := $(realpath $(dir $(QT5_REP_DIR))../..) + +include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_defaults.inc + +include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_final.inc + +LIBS += libc_fs + diff --git a/libports/src/app/qt5/qt_quicktest/main.cpp b/libports/src/app/qt5/qt_quicktest/main.cpp new file mode 100644 index 0000000000..348cd20a78 --- /dev/null +++ b/libports/src/app/qt5/qt_quicktest/main.cpp @@ -0,0 +1,19 @@ +/* + * \brief QtQuick test + * \author Christian Prochaska + * \date 2013-11-26 + */ + +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQuickView view; + view.setSource(QUrl("qrc:/qt_quicktest.qml")); + view.show(); + + return app.exec(); +} diff --git a/libports/src/app/qt5/qt_quicktest/qt_quicktest.pro b/libports/src/app/qt5/qt_quicktest/qt_quicktest.pro new file mode 100644 index 0000000000..558b7b13eb --- /dev/null +++ b/libports/src/app/qt5/qt_quicktest/qt_quicktest.pro @@ -0,0 +1,5 @@ +TEMPLATE += app +QT += quick +SOURCES += main.cpp +RESOURCES += qt_quicktest.qrc +CONFIG += debug diff --git a/libports/src/app/qt5/qt_quicktest/qt_quicktest.qml b/libports/src/app/qt5/qt_quicktest/qt_quicktest.qml new file mode 100644 index 0000000000..8ad179ad50 --- /dev/null +++ b/libports/src/app/qt5/qt_quicktest/qt_quicktest.qml @@ -0,0 +1,32 @@ +/* + * QML example from the Qt5 Quick Start Guide + * + * http://qt-project.org/doc/qt-5.0/qtquick/qtquick-quickstart-essentials.html + */ + +import QtQuick 2.0 + +Rectangle { + width: 200 + height: 100 + color: "red" + + Text { + anchors.centerIn: parent + text: "Hello, World!" + } + + MouseArea { + anchors.fill: parent + onClicked: parent.color = "blue" + } + + focus: true + Keys.onPressed: { + if (event.key == Qt.Key_Return) { + color = "green"; + event.accepted = true; + } + } +} + diff --git a/libports/src/app/qt5/qt_quicktest/qt_quicktest.qrc b/libports/src/app/qt5/qt_quicktest/qt_quicktest.qrc new file mode 100644 index 0000000000..d5ed5e1cba --- /dev/null +++ b/libports/src/app/qt5/qt_quicktest/qt_quicktest.qrc @@ -0,0 +1,6 @@ + + + +qt_quicktest.qml + + diff --git a/libports/src/app/qt5/qt_quicktest/target.mk b/libports/src/app/qt5/qt_quicktest/target.mk new file mode 100644 index 0000000000..ad944a423d --- /dev/null +++ b/libports/src/app/qt5/qt_quicktest/target.mk @@ -0,0 +1,10 @@ +# identify the qt5 repository by searching for a file that is unique for qt5 +QT5_REP_DIR := $(call select_from_repositories,lib/import/import-qt5.inc) +QT5_REP_DIR := $(realpath $(dir $(QT5_REP_DIR))../..) + +include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_defaults.inc + +include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_final.inc + +LIBS += libc_fs + diff --git a/libports/src/app/qt5/tmpl/target_final.inc b/libports/src/app/qt5/tmpl/target_final.inc index 756efaf40b..4c3a118b65 100644 --- a/libports/src/app/qt5/tmpl/target_final.inc +++ b/libports/src/app/qt5/tmpl/target_final.inc @@ -30,6 +30,11 @@ ifeq ($(findstring network, $(QT)), network) LIBS += qt5_network endif +# QtQuick +ifeq ($(findstring quick, $(QT)), quick) +LIBS += qt5_quick +endif + # QtScript ifeq ($(findstring scriptclassic, $(QT)), scriptclassic) LIBS += qt5_scriptclassic diff --git a/libports/src/lib/qt5/patches/qt5_configuration.patch b/libports/src/lib/qt5/patches/qt5_configuration.patch index 7fece002c6..85ca3ab131 100644 --- a/libports/src/lib/qt5/patches/qt5_configuration.patch +++ b/libports/src/lib/qt5/patches/qt5_configuration.patch @@ -6,7 +6,7 @@ From: Christian Prochaska --- configure | 2 - qt.pro | 42 ++++++++++---------- - qtbase/configure | 6 +-- + qtbase/configure | 8 ++-- qtbase/mkspecs/genode-g++/qmake.conf | 1 qtbase/mkspecs/genode-g++/qplatformdefs.h | 1 qtbase/src/corelib/global/qconfig-genode.h | 1 @@ -15,7 +15,7 @@ From: Christian Prochaska qtdeclarative/tests/tests.pro | 4 +- qtquick1/examples/declarative/declarative.pro | 1 qtwebkit/Tools/qmake/mkspecs/features/features.prf | 6 +-- - 11 files changed, 39 insertions(+), 33 deletions(-) + 11 files changed, 40 insertions(+), 34 deletions(-) create mode 120000 qtbase/mkspecs/genode-g++/qmake.conf create mode 120000 qtbase/mkspecs/genode-g++/qplatformdefs.h create mode 120000 qtbase/src/corelib/global/qconfig-genode.h @@ -90,7 +90,7 @@ index 218701a..bb4c037 100644 +#addModule(qtdoc, qtdeclarative) +#addModule(qtqa, qtbase) diff --git a/qtbase/configure b/qtbase/configure -index d7c9674..f4198b8 100755 +index d7c9674..956c3e1 100755 --- a/qtbase/configure +++ b/qtbase/configure @@ -857,10 +857,10 @@ CFG_XINERAMA=runtime @@ -106,6 +106,15 @@ index d7c9674..f4198b8 100755 CFG_LIBJPEG=auto CFG_XCURSOR=runtime CFG_XRANDR=runtime +@@ -883,7 +883,7 @@ CFG_SKIP_MODULES="" + CFG_COMPILE_EXAMPLES=auto + CFG_RELEASE_QMAKE=no + CFG_AUDIO_BACKEND=auto +-CFG_V8SNAPSHOT=auto ++CFG_V8SNAPSHOT=no + CFG_QML_DEBUG=yes + CFG_JAVASCRIPTCORE_JIT=auto + CFG_PKGCONFIG=auto @@ -949,7 +949,7 @@ CFG_GETADDRINFO=auto CFG_IPV6IFNAME=auto CFG_GETIFADDRS=auto diff --git a/libports/src/lib/qt5/patches/qt5_qml.patch b/libports/src/lib/qt5/patches/qt5_qml.patch new file mode 100644 index 0000000000..8da5cd6465 --- /dev/null +++ b/libports/src/lib/qt5/patches/qt5_qml.patch @@ -0,0 +1,796 @@ +qt5_qml.patch + +From: Christian Prochaska + + +--- + qtdeclarative/src/qml/qml/qqmlimport.cpp | 9 + qtdeclarative/src/qml/qml/v8/qv8qobjectwrapper.cpp | 4 + qtdeclarative/src/qml/types/qqmldelegatemodel_p.h | 2 + qtjsbackend/src/3rdparty/v8/src/platform-genode.cc | 701 ++++++++++++++++++++ + qtjsbackend/src/v8/v8.pri | 2 + 5 files changed, 716 insertions(+), 2 deletions(-) + create mode 100644 qtjsbackend/src/3rdparty/v8/src/platform-genode.cc + +diff --git a/qtdeclarative/src/qml/qml/qqmlimport.cpp b/qtdeclarative/src/qml/qml/qqmlimport.cpp +index 2fbb614..5816e9a 100644 +--- a/qtdeclarative/src/qml/qml/qqmlimport.cpp ++++ b/qtdeclarative/src/qml/qml/qqmlimport.cpp +@@ -1463,6 +1463,14 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, + const QString &qmldirPath, const QString &qmldirPluginPath, + const QString &baseName) + { ++#if defined(Q_OS_GENODE) ++ ++ return resolvePlugin(typeLoader, qmldirPath, qmldirPluginPath, baseName, ++ QStringList() << QLatin1String(".lib.so"), ++ QLatin1String("qt5_")); ++ ++#else ++ + #if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) + return resolvePlugin(typeLoader, qmldirPath, qmldirPluginPath, baseName, + QStringList() +@@ -1512,6 +1520,7 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, + # endif + + #endif ++#endif + } + + /*! +diff --git a/qtdeclarative/src/qml/qml/v8/qv8qobjectwrapper.cpp b/qtdeclarative/src/qml/qml/v8/qv8qobjectwrapper.cpp +index 53f70ad..0b31aa6 100644 +--- a/qtdeclarative/src/qml/qml/v8/qv8qobjectwrapper.cpp ++++ b/qtdeclarative/src/qml/qml/v8/qv8qobjectwrapper.cpp +@@ -973,6 +973,8 @@ v8::Local QQmlPropertyCache::newQObject(QObject *object, QV8Engine * + if (checkForDuplicates) + uniqueHash.reserve(stringCache.count()); + ++/* disabling this code seems to avoid crashes on 32-bit Linux and NOVA */ ++#if 0 + // XXX TODO: Enables fast property accessors. These more than double the property access + // performance, but the cost of setting up this structure hasn't been measured so + // its not guaranteed that this is a win overall. We need to try and measure the cost. +@@ -1032,7 +1034,7 @@ v8::Local QQmlPropertyCache::newQObject(QObject *object, QV8Engine * + v8::External::New(property)); + } + } +- ++#endif + if (ft.IsEmpty()) { + constructor = qPersistentNew(engine->qobjectWrapper()->m_constructor); + } else { +diff --git a/qtdeclarative/src/qml/types/qqmldelegatemodel_p.h b/qtdeclarative/src/qml/types/qqmldelegatemodel_p.h +index 5702c59..3d616b5 100644 +--- a/qtdeclarative/src/qml/types/qqmldelegatemodel_p.h ++++ b/qtdeclarative/src/qml/types/qqmldelegatemodel_p.h +@@ -52,6 +52,8 @@ + #include + #include + ++#include ++ + Q_DECLARE_METATYPE(QModelIndex) + + QT_BEGIN_NAMESPACE +diff --git a/qtjsbackend/src/3rdparty/v8/src/platform-genode.cc b/qtjsbackend/src/3rdparty/v8/src/platform-genode.cc +new file mode 100644 +index 0000000..3a8cf90 +--- /dev/null ++++ b/qtjsbackend/src/3rdparty/v8/src/platform-genode.cc +@@ -0,0 +1,701 @@ ++// Copyright 2012 the V8 project authors. All rights reserved. ++// 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 Google Inc. 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. ++ ++// Platform specific code for Genode goes here ++ ++// Minimal include to get access to abort, fprintf and friends for bootstrapping ++// messages. ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "v8.h" ++ ++#include "platform-posix.h" ++#include "platform.h" ++#include "vm-state-inl.h" ++ ++ ++namespace v8 { ++namespace internal { ++ ++static const bool verbose = false; ++ ++static const pthread_t kNoThread = (pthread_t) 0; ++ ++#undef UNIMPLEMENTED ++#define UNIMPLEMENTED(...) PDBG("UNIMPLEMENTED") ++ ++ ++double ceiling(double x) { ++ return ceil(x); ++} ++ ++ ++// Initialize OS class early in the V8 startup. ++void OS::SetUp() { ++ // Seed the random number generator. ++ UNIMPLEMENTED(); ++} ++ ++ ++void OS::PostSetUp() { ++ POSIXPostSetUp(); ++} ++ ++ ++void OS::TearDown() { ++ UNIMPLEMENTED(); ++} ++ ++int OS::ActivationFrameAlignment() { ++#ifdef V8_TARGET_ARCH_ARM ++ // On EABI ARM targets this is required for fp correctness in the ++ // runtime system. ++ return 8; ++#elif V8_TARGET_ARCH_MIPS ++ return 8; ++#endif ++ // With gcc 4.4 the tree vectorization optimizer can generate code ++ // that requires 16 byte alignment such as movdqa on x86. ++ return 16; ++} ++ ++ ++void OS::ReleaseStore(volatile AtomicWord* ptr, AtomicWord value) { ++#if (defined(V8_TARGET_ARCH_ARM) && defined(__arm__)) || \ ++ (defined(V8_TARGET_ARCH_MIPS) && defined(__mips__)) ++ // Only use on ARM or MIPS hardware. ++ MemoryBarrier(); ++#else ++ __asm__ __volatile__("" : : : "memory"); ++ // An x86 store acts as a release barrier. ++#endif ++ *ptr = value; ++} ++ ++ ++// Returns a string identifying the current timezone taking into ++// account daylight saving. ++const char* OS::LocalTimezone(double time) { ++ UNIMPLEMENTED(); ++ return ""; ++} ++ ++ ++// Returns the local time offset in milliseconds east of UTC without ++// taking daylight savings time into account. ++double OS::LocalTimeOffset() { ++ UNIMPLEMENTED(); ++ return 0; ++} ++ ++ ++uint64_t OS::CpuFeaturesImpliedByPlatform() { ++ return 0; ++} ++ ++#if 0 ++CpuImplementer OS::GetCpuImplementer() { ++ UNIMPLEMENTED(); ++} ++ ++ ++bool OS::ArmCpuHasFeature(CpuFeature feature) { ++ UNIMPLEMENTED(); ++} ++ ++ ++bool OS::ArmUsingHardFloat() { ++ UNIMPLEMENTED(); ++} ++#endif ++ ++bool OS::IsOutsideAllocatedSpace(void* address) { ++ UNIMPLEMENTED(); ++ return false; ++} ++ ++#if 0 ++size_t OS::AllocateAlignment() { ++ UNIMPLEMENTED(); ++ return 0; ++} ++#endif ++ ++void* OS::Allocate(const size_t requested, ++ size_t* allocated, ++ bool executable) { ++ //UNIMPLEMENTED(); ++ *allocated = requested; ++ return malloc(requested); ++} ++ ++#if 0 ++void OS::Free(void* buf, const size_t length) { ++ // TODO(1240712): potential system call return value which is ignored here. ++ UNIMPLEMENTED(); ++} ++ ++ ++void OS::Guard(void* address, const size_t size) { ++ UNIMPLEMENTED(); ++} ++#endif ++ ++void OS::Sleep(int milliseconds) { ++ UNIMPLEMENTED(); ++} ++ ++ ++void OS::Abort() { ++ // Minimalistic implementation for bootstrapping. ++ abort(); ++} ++ ++#if 0 ++void OS::DebugBreak() { ++ UNIMPLEMENTED(); ++} ++#endif ++ ++OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) { ++ UNIMPLEMENTED(); ++ return NULL; ++} ++ ++#if 0 ++OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size, ++ void* initial) { ++ UNIMPLEMENTED(); ++ return NULL; ++} ++#endif ++ ++void OS::LogSharedLibraryAddresses() { ++ UNIMPLEMENTED(); ++} ++ ++ ++void OS::SignalCodeMovingGC() { ++ UNIMPLEMENTED(); ++} ++ ++#if 0 ++int OS::StackWalk(Vector frames) { ++ UNIMPLEMENTED(); ++ return 0; ++} ++#endif ++ ++/* --- */ ++ ++class Attached_rm_connection : public Genode::Rm_connection, ++ public Genode::Avl_node ++{ ++ ++ private: ++ ++ Genode::Dataspace_capability _ds_cap; ++ ++ size_t _size; ++ Genode::addr_t _base_addr; ++ ++ public: ++ ++ Attached_rm_connection(size_t size, size_t alignment = 0) ++ : Genode::Rm_connection(0, size), ++ _ds_cap(dataspace()), ++ _size(size) ++ { ++ if (alignment == 0) { ++ _base_addr = Genode::env()->rm_session()->attach(_ds_cap); ++ } else { ++ for (_base_addr = alignment; ++ _base_addr != 0; /* wrap-around */ ++ _base_addr += alignment) { ++ try { ++ Genode::env()->rm_session()->attach_at(_ds_cap, _base_addr); ++ return; ++ } catch (Genode::Rm_connection::Region_conflict) { ++ if (verbose) ++ PDBG("could not attach at address 0x%lx", _base_addr); ++ } ++ } ++ throw Rm_connection::Region_conflict(); ++ } ++ } ++ ++ ~Attached_rm_connection() ++ { ++ Genode::env()->rm_session()->detach(_base_addr); ++ } ++ ++ size_t size() const { return _size; } ++ ++ void *base_addr() const { return (void*)_base_addr; } ++ ++ void attach(Genode::Dataspace_capability ds_cap, Genode::addr_t addr, ++ bool executable) ++ { ++ Genode::Rm_connection::attach(ds_cap, 0, 0, true, ++ (void*)(addr - _base_addr), ++ executable); ++ } ++ ++ Attached_rm_connection *find_by_addr(Genode::addr_t addr) ++ { ++ if (verbose) ++ PDBG("addr = 0x%lx, _base_addr = 0x%lx, _end_addr = 0x%lx", ++ addr, _base_addr, _base_addr + _size); ++ if ((addr >= _base_addr) && (addr < _base_addr + _size)) ++ return this; ++ ++ Attached_rm_connection *next = child(addr > _base_addr); ++ return next ? next->find_by_addr(addr) : 0; ++ } ++ ++ /** ++ * Avl_node interface ++ */ ++ bool higher(Attached_rm_connection *other) ++ { ++ return ((Genode::addr_t)other->base_addr() > _base_addr); ++ } ++}; ++ ++ ++static Genode::Avl_tree &vm_registry() ++{ ++ static Genode::Avl_tree _vm_registry; ++ return _vm_registry; ++} ++ ++ ++static void *reserve_region(size_t size, size_t alignment = 0) ++{ ++ Attached_rm_connection *rm; ++ try { ++ rm = new Attached_rm_connection(size, alignment); ++ } catch (Attached_rm_connection::Region_conflict) { ++ PDBG("could not reserve region"); ++ return 0; ++ } ++ vm_registry().insert(rm); ++ if (verbose) ++ PDBG("base_addr = 0x%p", rm->base_addr()); ++ return rm->base_addr(); ++} ++ ++/* --- */ ++ ++VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } ++ ++ ++VirtualMemory::VirtualMemory(size_t size) { ++ if (verbose) ++ PDBG("size = 0x%zx", size); ++ address_ = ReserveRegion(size); ++ size_ = size; ++} ++ ++ ++VirtualMemory::VirtualMemory(size_t size, size_t alignment) { ++ if (verbose) ++ PDBG("size = 0x%zx, alignment = 0x%zx", size, alignment); ++ address_ = reserve_region(size, alignment); ++ size_ = size; ++} ++ ++ ++VirtualMemory::~VirtualMemory() { ++ if (IsReserved()) { ++ bool result = ReleaseRegion(address(), size()); ++ ASSERT(result); ++ USE(result); ++ } ++} ++ ++ ++bool VirtualMemory::IsReserved() { ++ return address_ != NULL; ++} ++ ++ ++void VirtualMemory::Reset() { ++ address_ = NULL; ++ size_ = 0; ++} ++ ++ ++bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { ++ return CommitRegion(address, size, is_executable); ++} ++ ++ ++ ++bool VirtualMemory::Uncommit(void* address, size_t size) { ++ return UncommitRegion(address, size); ++} ++ ++ ++bool VirtualMemory::Guard(void* address) { ++ UNIMPLEMENTED(); ++ return true; ++} ++ ++ ++void* VirtualMemory::ReserveRegion(size_t size) { ++ return reserve_region(size); ++} ++ ++ ++bool VirtualMemory::CommitRegion(void* base, size_t size, bool is_executable) { ++ if (verbose) ++ PDBG("base = 0x%p, size = 0x%zx", base, size); ++ Attached_rm_connection *rm = vm_registry().first(); ++ rm = rm->find_by_addr((Genode::addr_t)base); ++ if (!rm) { ++ if (verbose) ++ PDBG("could not find RM connection"); ++ return false; ++ } ++ ++ Genode::Ram_dataspace_capability ds_cap = ++ Genode::env()->ram_session()->alloc(size); ++ ++ try { ++ rm->attach(ds_cap, (Genode::addr_t)base, is_executable); ++ } catch (Genode::Rm_session::Region_conflict) { ++ return false; ++ } ++ ++ return true; ++} ++ ++ ++bool VirtualMemory::UncommitRegion(void* base, size_t size) { ++ UNIMPLEMENTED(); ++ if (verbose) ++ PDBG("base = 0x%p, size = 0x%zx", base, size); ++ return false; ++} ++ ++ ++bool VirtualMemory::ReleaseRegion(void* base, size_t size) { ++ ++ UNIMPLEMENTED(); ++ ++#if 0 ++ /* ++ * FIXME ++ * ++ * Unmapping of managed dataspaces is not supported on all platforms. ++ * To make it still work, all dataspaces attached to the sub RM session must ++ * be detached before detaching the sub RM session. ++ */ ++ ++ if (verbose) ++ PDBG("base = 0x%p, size = 0x%zx", base, size); ++ Attached_rm_connection *rm = vm_registry().first(); ++ /* XXX: also pass the size for checking? */ ++ rm = rm->find_by_addr((Genode::addr_t)base); ++ if (!rm) ++ return false; ++ ++ vm_registry().remove(rm); ++ ++ delete rm; ++#endif ++ ++ return true; ++} ++ ++ ++bool VirtualMemory::HasLazyCommits() { ++ // TODO(alph): implement for the platform. ++ return false; ++} ++ ++ ++class Thread::PlatformData : public Malloced { ++ public: ++ PlatformData() : thread_(kNoThread) {} ++ ++ pthread_t thread_; // Thread handle for pthread. ++}; ++ ++ ++Thread::Thread(const Options& options) ++ : data_(new PlatformData()), ++ stack_size_(options.stack_size()) { ++ set_name(options.name()); ++} ++ ++ ++Thread::~Thread() { ++ delete data_; ++} ++ ++ ++static void* ThreadEntry(void* arg) { ++ Thread* thread = reinterpret_cast(arg); ++ // This is also initialized by the first argument to pthread_create() but we ++ // don't know which thread will run first (the original thread or the new ++ // one) so we initialize it here too. ++#ifdef PR_SET_NAME ++ prctl(PR_SET_NAME, ++ reinterpret_cast(thread->name()), // NOLINT ++ 0, 0, 0); ++#endif ++ thread->data()->thread_ = pthread_self(); ++ ASSERT(thread->data()->thread_ != kNoThread); ++ thread->Run(); ++ return NULL; ++} ++ ++ ++void Thread::set_name(const char* name) { ++ strncpy(name_, name, sizeof(name_)); ++ name_[sizeof(name_) - 1] = '\0'; ++} ++ ++ ++void Thread::Start() { ++ pthread_attr_t* attr_ptr = NULL; ++ pthread_attr_t attr; ++ if (stack_size_ > 0) { ++ pthread_attr_init(&attr); ++ pthread_attr_setstacksize(&attr, static_cast(stack_size_)); ++ attr_ptr = &attr; ++ } ++ int result = pthread_create(&data_->thread_, attr_ptr, ThreadEntry, this); ++ CHECK_EQ(0, result); ++ ASSERT(data_->thread_ != kNoThread); ++} ++ ++ ++void Thread::Join() { ++ pthread_join(data_->thread_, NULL); ++} ++ ++ ++Thread::LocalStorageKey Thread::CreateThreadLocalKey() { ++ pthread_key_t key; ++ int result = pthread_key_create(&key, NULL); ++ USE(result); ++ ASSERT(result == 0); ++ return static_cast(key); ++} ++ ++ ++void Thread::DeleteThreadLocalKey(LocalStorageKey key) { ++ pthread_key_t pthread_key = static_cast(key); ++ int result = pthread_key_delete(pthread_key); ++ USE(result); ++ ASSERT(result == 0); ++} ++ ++ ++void* Thread::GetThreadLocal(LocalStorageKey key) { ++ pthread_key_t pthread_key = static_cast(key); ++ return pthread_getspecific(pthread_key); ++} ++ ++ ++void Thread::SetThreadLocal(LocalStorageKey key, void* value) { ++ pthread_key_t pthread_key = static_cast(key); ++ pthread_setspecific(pthread_key, value); ++} ++ ++ ++void Thread::YieldCPU() { ++ UNIMPLEMENTED(); ++} ++ ++ ++class GenodeMutex : public Mutex { ++ public: ++ GenodeMutex() { ++ pthread_mutexattr_t attrs; ++ int result = pthread_mutexattr_init(&attrs); ++ ASSERT(result == 0); ++ result = pthread_mutexattr_settype(&attrs, PTHREAD_MUTEX_RECURSIVE); ++ ASSERT(result == 0); ++ result = pthread_mutex_init(&mutex_, &attrs); ++ ASSERT(result == 0); ++ USE(result); ++ } ++ ++ virtual ~GenodeMutex() { pthread_mutex_destroy(&mutex_); } ++ ++ virtual int Lock() { ++ int result = pthread_mutex_lock(&mutex_); ++ return result; ++ } ++ ++ virtual int Unlock() { ++ int result = pthread_mutex_unlock(&mutex_); ++ return result; ++ } ++ ++ virtual bool TryLock() { ++ int result = pthread_mutex_trylock(&mutex_); ++ // Return false if the lock is busy and locking failed. ++ if (result == EBUSY) { ++ return false; ++ } ++ ASSERT(result == 0); // Verify no other errors. ++ return true; ++ } ++ ++ private: ++ pthread_mutex_t mutex_; // Pthread mutex for POSIX platforms. ++}; ++ ++ ++Mutex* OS::CreateMutex() { ++ return new GenodeMutex(); ++} ++ ++ ++class GenodeSemaphore : public Semaphore { ++ public: ++ explicit GenodeSemaphore(int count) { sem_init(&sem_, 0, count); } ++ virtual ~GenodeSemaphore() { sem_destroy(&sem_); } ++ ++ virtual void Wait(); ++ virtual bool Wait(int timeout); ++ virtual void Signal() { sem_post(&sem_); } ++ private: ++ sem_t sem_; ++}; ++ ++ ++void GenodeSemaphore::Wait() { ++ while (true) { ++ int result = sem_wait(&sem_); ++ if (result == 0) return; // Successfully got semaphore. ++ CHECK(result == -1 && errno == EINTR); // Signal caused spurious wakeup. ++ } ++} ++ ++ ++#ifndef TIMEVAL_TO_TIMESPEC ++#define TIMEVAL_TO_TIMESPEC(tv, ts) do { \ ++ (ts)->tv_sec = (tv)->tv_sec; \ ++ (ts)->tv_nsec = (tv)->tv_usec * 1000; \ ++} while (false) ++#endif ++ ++ ++bool GenodeSemaphore::Wait(int timeout) { ++ const long kOneSecondMicros = 1000000; // NOLINT ++ ++ // Split timeout into second and nanosecond parts. ++ struct timeval delta; ++ delta.tv_usec = timeout % kOneSecondMicros; ++ delta.tv_sec = timeout / kOneSecondMicros; ++ ++ struct timeval current_time; ++ // Get the current time. ++ if (gettimeofday(¤t_time, NULL) == -1) { ++ return false; ++ } ++ ++ // Calculate time for end of timeout. ++ struct timeval end_time; ++ timeradd(¤t_time, &delta, &end_time); ++ ++ struct timespec ts; ++ TIMEVAL_TO_TIMESPEC(&end_time, &ts); ++ // Wait for semaphore signalled or timeout. ++ while (true) { ++ int result = sem_timedwait(&sem_, &ts); ++ if (result == 0) return true; // Successfully got semaphore. ++ if (result > 0) { ++ // For glibc prior to 2.3.4 sem_timedwait returns the error instead of -1. ++ errno = result; ++ result = -1; ++ } ++ if (result == -1 && errno == ETIMEDOUT) return false; // Timeout. ++ CHECK(result == -1 && errno == EINTR); // Signal caused spurious wakeup. ++ } ++} ++ ++ ++Semaphore* OS::CreateSemaphore(int count) { ++ return new GenodeSemaphore(count); ++} ++ ++ ++class Sampler::PlatformData : public Malloced { ++ public: ++ PlatformData() { ++ UNIMPLEMENTED(); ++ } ++}; ++ ++ ++Sampler::Sampler(Isolate *isolate, int interval) ++ : isolate_(isolate), ++ interval_(interval), ++ profiling_(false), ++ active_(false), ++ samples_taken_(0) { ++ UNIMPLEMENTED(); ++ // Shared setup follows. ++ data_ = new PlatformData; ++} ++ ++ ++Sampler::~Sampler() { ++ UNIMPLEMENTED(); ++ // Shared tear down follows. ++ delete data_; ++} ++ ++ ++void Sampler::Start() { ++ UNIMPLEMENTED(); ++} ++ ++ ++void Sampler::Stop() { ++ UNIMPLEMENTED(); ++} ++ ++ ++} } // namespace v8::internal +diff --git a/qtjsbackend/src/v8/v8.pri b/qtjsbackend/src/v8/v8.pri +index 3a563ff..6a83034 100644 +--- a/qtjsbackend/src/v8/v8.pri ++++ b/qtjsbackend/src/v8/v8.pri +@@ -265,7 +265,7 @@ SOURCES += \ + LIBS += -lexecinfo + } else:unix:!qnx { + SOURCES += \ +- $$V8SRC/platform-linux.cc \ ++ $$V8SRC/platform-genode.cc \ + $$V8SRC/platform-posix.cc + } + diff --git a/libports/src/lib/qt5/patches/series b/libports/src/lib/qt5/patches/series index 9f4c00f481..57ac762278 100644 --- a/libports/src/lib/qt5/patches/series +++ b/libports/src/lib/qt5/patches/series @@ -12,4 +12,5 @@ qt5_qtnetwork.patch qt5_qtwebkit.patch qt5_textedit_example.patch qt5_openglwindow_example.patch +qt5_qml.patch qt5_tools.patch diff --git a/libports/src/lib/qt5/qtbase/src/corelib/global/qconfig.cpp b/libports/src/lib/qt5/qtbase/src/corelib/global/qconfig.cpp index 89d4e0fd58..f977d58c9d 100644 --- a/libports/src/lib/qt5/qtbase/src/corelib/global/qconfig.cpp +++ b/libports/src/lib/qt5/qtbase/src/corelib/global/qconfig.cpp @@ -15,7 +15,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = { "qt_binspath=:/qt/bin", "qt_plugpath=:/qt/plugins", "qt_impspath=:/qt/imports", - "qt_qml2path=:/qt/qml", + "qt_qml2path=/qt5/qml", "qt_adatpath=:/qt", "qt_datapath=:/qt", "qt_trnspath=:/qt/translations", diff --git a/libports/src/lib/qt5/qtdeclarative/src/imports/qtquick2/target.mk b/libports/src/lib/qt5/qtdeclarative/src/imports/qtquick2/target.mk new file mode 100644 index 0000000000..f6c0485d43 --- /dev/null +++ b/libports/src/lib/qt5/qtdeclarative/src/imports/qtquick2/target.mk @@ -0,0 +1,3 @@ +# the plugin gets loaded via 'dlopen()', therefore it is built separately + +LIBS = qt5_qtquick2plugin diff --git a/libports/tool/qt5/lib_mk_file_generator/create_generated_incs b/libports/tool/qt5/lib_mk_file_generator/create_generated_incs index 07b74af2c4..0d84de5d87 100755 --- a/libports/tool/qt5/lib_mk_file_generator/create_generated_incs +++ b/libports/tool/qt5/lib_mk_file_generator/create_generated_incs @@ -16,6 +16,12 @@ cd qtscript/src/script && ../../../create_generated_inc qt cd qttools/src/designer/src/uitools && ../../../../../create_generated_inc qt5_ui_tools && cp qt5_ui_tools_generated.inc ../../../../.. && cd ../../../../.. +cd qtjsbackend/src/v8 && ../../../create_generated_inc qt5_v8 && cp qt5_v8_generated.inc ../../.. && cd ../../.. + +cd qtdeclarative/src/qml && ../../../create_generated_inc qt5_qml && cp qt5_qml_generated.inc ../../.. && cd ../../.. +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 ../../../.. + # qtwebkit make -C qtbase/src/tools/bootstrap