diff mbox

[3/6] qt5declarative: add an option for quick module

Message ID 1405791208-30356-4-git-send-email-fatih.asici@gmail.com
State Accepted
Headers show

Commit Message

Fatih Aşıcı July 19, 2014, 5:33 p.m. UTC
With this change, qt5declarative can be built without OpenGL.

Signed-off-by: Fatih Aşıcı <fatih.asici@gmail.com>
---
 package/qt5/qt5declarative/Config.in         | 17 +++++++++++------
 package/qt5/qt5declarative/qt5declarative.mk | 12 ++++++++++--
 2 files changed, 21 insertions(+), 8 deletions(-)

Comments

Thomas Petazzoni July 20, 2014, 10:04 a.m. UTC | #1
Dear Fatih Aşıcı,

On Sat, 19 Jul 2014 20:33:25 +0300, Fatih Aşıcı wrote:

> diff --git a/package/qt5/qt5declarative/qt5declarative.mk b/package/qt5/qt5declarative/qt5declarative.mk
> index 472d092..34dd14a 100644
> --- a/package/qt5/qt5declarative/qt5declarative.mk
> +++ b/package/qt5/qt5declarative/qt5declarative.mk
> @@ -35,12 +35,20 @@ define QT5DECLARATIVE_INSTALL_STAGING_CMDS
>  endef
>  
>  ifeq ($(BR2_PREFER_STATIC_LIB),)
> -define QT5DECLARATIVE_INSTALL_TARGET_LIBS
> -	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Qml*.so.* $(TARGET_DIR)/usr/lib
> +
> +ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
> +define QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS
>  	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Quick*.so.* $(TARGET_DIR)/usr/lib
>  	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/accessible $(TARGET_DIR)/usr/lib/qt/plugins
> +endef
> +endif
> +
> +define QT5DECLARATIVE_INSTALL_TARGET_LIBS
> +	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Qml*.so.* $(TARGET_DIR)/usr/lib
>  	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/qml* $(TARGET_DIR)/usr/lib/qt/plugins
> +	$(QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS)
>  endef

I am still unsure to understand what's the difference between
qt5declarative and qt5quick exactly. But here, you're installing
libQt5Qml and the qml plugins as soon as the qt5declarative package is
enabled, even if the quick module is disabled.

But then, in PATCH 4/6, you only install QML files if the quick module
is enabled. So I'm a bit confused as to what is needed to actually use
qml files.

Could you explain a bit more the interaction/difference between
qt5declarative and the quick module?

Thanks,

Thomas
Fatih Aşıcı July 20, 2014, 11:33 a.m. UTC | #2
On Sunday 20 July 2014 12:04:31 Thomas Petazzoni wrote:
> Dear Fatih Aşıcı,
> 
> On Sat, 19 Jul 2014 20:33:25 +0300, Fatih Aşıcı wrote:
> > diff --git a/package/qt5/qt5declarative/qt5declarative.mk
> > b/package/qt5/qt5declarative/qt5declarative.mk index 472d092..34dd14a
> > 100644
> > --- a/package/qt5/qt5declarative/qt5declarative.mk
> > +++ b/package/qt5/qt5declarative/qt5declarative.mk
> > @@ -35,12 +35,20 @@ define QT5DECLARATIVE_INSTALL_STAGING_CMDS
> > 
> >  endef
> >  
> >  ifeq ($(BR2_PREFER_STATIC_LIB),)
> > 
> > -define QT5DECLARATIVE_INSTALL_TARGET_LIBS
> > -	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Qml*.so.* $(TARGET_DIR)/usr/lib
> > +
> > +ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
> > +define QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS
> > 
> >  	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Quick*.so.* $(TARGET_DIR)/usr/lib
> >  	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/accessible
> >  	$(TARGET_DIR)/usr/lib/qt/plugins> 
> > +endef
> > +endif
> > +
> > +define QT5DECLARATIVE_INSTALL_TARGET_LIBS
> > +	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Qml*.so.* $(TARGET_DIR)/usr/lib
> > 
> >  	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/qml*
> >  	$(TARGET_DIR)/usr/lib/qt/plugins> 
> > +	$(QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS)
> > 
> >  endef
> 
> I am still unsure to understand what's the difference between
> qt5declarative and qt5quick exactly. But here, you're installing
> libQt5Qml and the qml plugins as soon as the qt5declarative package is
> enabled, even if the quick module is disabled.
> 
> But then, in PATCH 4/6, you only install QML files if the quick module
> is enabled. So I'm a bit confused as to what is needed to actually use
> qml files.
> 
> Could you explain a bit more the interaction/difference between
> qt5declarative and the quick module?

qt5quick1 includes the old libs, interpreter, modules, etc. It is probably provided to 
ease porting from Qt 4.x. So it has no dependency on qt5declarative.

QML is the name of the language. Quick is the name of QML module kit that is used to 
create user interfaces. qt5declarative contains both the interpreter and Quick module 
kit. It seems possible to use QML without Quick.

QML files in the other qt5* modules depend on Quick modules. Those are not built 
when quick is disabled.

Regards,
Fatih
diff mbox

Patch

diff --git a/package/qt5/qt5declarative/Config.in b/package/qt5/qt5declarative/Config.in
index 4a6e805..edac8cd 100644
--- a/package/qt5/qt5declarative/Config.in
+++ b/package/qt5/qt5declarative/Config.in
@@ -3,9 +3,6 @@  config BR2_PACKAGE_QT5DECLARATIVE
 	select BR2_PACKAGE_QT5XMLPATTERNS
 	select BR2_PACKAGE_QT5BASE
 	select BR2_PACKAGE_QT5BASE_GUI
-	select BR2_PACKAGE_QT5BASE_EGLFS
-	depends on BR2_PACKAGE_HAS_LIBEGL
-	depends on BR2_PACKAGE_HAS_LIBGLES
 	depends on BR2_PACKAGE_QT5_JSCORE_AVAILABLE
 	help
 	  Qt is a cross-platform application and UI framework for
@@ -15,6 +12,14 @@  config BR2_PACKAGE_QT5DECLARATIVE
 
 	  http://qt-project.org
 
-comment "qt5declarative requires an OpenGL-capable backend"
-	depends on (!BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES) && \
-		BR2_PACKAGE_QT5_JSCORE_AVAILABLE
+if BR2_PACKAGE_QT5DECLARATIVE
+
+comment "quick module needs an OpenGL-capable backend"
+	depends on !BR2_PACKAGE_QT5_GL_AVAILABLE
+
+config BR2_PACKAGE_QT5DECLARATIVE_QUICK
+	bool "quick module"
+	select BR2_PACKAGE_QT5BASE_OPENGL
+	depends on BR2_PACKAGE_QT5_GL_AVAILABLE
+
+endif
diff --git a/package/qt5/qt5declarative/qt5declarative.mk b/package/qt5/qt5declarative/qt5declarative.mk
index 472d092..34dd14a 100644
--- a/package/qt5/qt5declarative/qt5declarative.mk
+++ b/package/qt5/qt5declarative/qt5declarative.mk
@@ -35,12 +35,20 @@  define QT5DECLARATIVE_INSTALL_STAGING_CMDS
 endef
 
 ifeq ($(BR2_PREFER_STATIC_LIB),)
-define QT5DECLARATIVE_INSTALL_TARGET_LIBS
-	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Qml*.so.* $(TARGET_DIR)/usr/lib
+
+ifeq ($(BR2_PACKAGE_QT5DECLARATIVE_QUICK),y)
+define QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS
 	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Quick*.so.* $(TARGET_DIR)/usr/lib
 	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/accessible $(TARGET_DIR)/usr/lib/qt/plugins
+endef
+endif
+
+define QT5DECLARATIVE_INSTALL_TARGET_LIBS
+	cp -dpf $(STAGING_DIR)/usr/lib/libQt5Qml*.so.* $(TARGET_DIR)/usr/lib
 	cp -dpfr $(STAGING_DIR)/usr/lib/qt/plugins/qml* $(TARGET_DIR)/usr/lib/qt/plugins
+	$(QT5DECLARATIVE_INSTALL_TARGET_QUICK_LIBS)
 endef
+
 endif
 
 define QT5DECLARATIVE_INSTALL_TARGET_CMDS