Skip to contentSkip to conversation

package/qwt : prepared package for other versions of Qt.

PATCH New David Picard 2 participants 5 messages Mar 16, 2016 – Mar 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/qwt : prepared package for other versions of Qt.

Reformatted the package configuration to make it more generic. It will thus be easier to handle more than one version of Qt. Indeed, multiple versions of Qt are compatible with the current Qwt.

---
 package/qwt/Config.in |  9 ++++-----
 package/qwt/qwt.mk    | 10 ++++++++--
 2 files changed, 12 insertions(+), 7 deletions(-)
package/qwt/Config.in +4 -5
index 8c7bc56..e72db31 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_QWT
 	bool "qwt"
 	depends on BR2_PACKAGE_QT
-	depends on BR2_PACKAGE_QT_GUI_MODULE
+	select BR2_PACKAGE_QT_GUI_MODULE if BR2_PACKAGE_QT
 	help
 	  Qwt is a graphics extension to the Qt GUI application
 	  framework. It provides a 2D plotting widget and more.
@@ -12,16 +12,15 @@ if BR2_PACKAGE_QWT
 
 config BR2_PACKAGE_QWT_SVG
 	bool "SVG support"
-	select BR2_PACKAGE_QT_SVG
+	select BR2_PACKAGE_QT_SVG if BR2_PACKAGE_QT
 
 config BR2_PACKAGE_QWT_MATHML
 	bool "MathML support"
 
 config BR2_PACKAGE_QWT_OPENGL
 	bool "OpenGL support"
-	depends on BR2_PACKAGE_HAS_LIBGLES
-	depends on BR2_PACKAGE_HAS_LIBEGL
-	select BR2_PACKAGE_QT_OPENGL_ES
+	select BR2_PACKAGE_QT_OPENGL_ES if \
+	    BR2_PACKAGE_QT && BR2_PACKAGE_HAS_LIBGLES && BR2_PACKAGE_HAS_LIBEGL
 
 endif
 
package/qwt/qwt.mk +8 -2
index 8a46c25..afd0ffb 100644
@@ -8,7 +8,9 @@ QWT_VERSION = 6.1.2
 QWT_SOURCE = qwt-$(QWT_VERSION).tar.bz2
 QWT_SITE = http://downloads.sourceforge.net/project/qwt/qwt/$(QWT_VERSION)
 QWT_INSTALL_STAGING = YES
-QWT_DEPENDENCIES = qt
+ifeq ($(BR2_PACKAGE_QT),y)
+QWT_DEPENDENCIES = qt libgles libegl
+endif
 
 QWT_LICENSE = LGPLv2.1 with exceptions
 QWT_LICENSE_FILES = COPYING
@@ -35,9 +37,13 @@ else
 QWT_CONFIG += -e 's/^.*QWT_CONFIG.*QwtOpenGL.*$$/\# QWT_CONFIG += QwtOpenGL/'
 endif
 
+ifeq ($(BR2_PACKAGE_QT),y)
+    QWT_QMAKE = $(QT_QMAKE)
+endif
+
 define QWT_CONFIGURE_CMDS
 	$(SED) $(QWT_CONFIG) $(@D)/qwtconfig.pri
-	(cd $(@D); $(TARGET_MAKE_ENV) $(QT_QMAKE))
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QWT_QMAKE))
 endef
 
 define QWT_BUILD_CMDS
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 package/qwt : added support for Qt5.

This version of Qwt is compatible with both Qt and Qt5. This patch adds the option to compile it for Qt5.

---
 package/qwt/Config.in | 14 +++++++++-----
 package/qwt/qwt.mk    |  5 +++++
 2 files changed, 14 insertions(+), 5 deletions(-)
package/qwt/Config.in +9 -5
index e72db31..9dca8ed 100644
@@ -1,7 +1,9 @@
 config BR2_PACKAGE_QWT
 	bool "qwt"
-	depends on BR2_PACKAGE_QT
+	depends on BR2_PACKAGE_QT || BR2_PACKAGE_QT5
 	select BR2_PACKAGE_QT_GUI_MODULE if BR2_PACKAGE_QT
+	select BR2_PACKAGE_QT5BASE_GUI if BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE_CONCURRENT if BR2_PACKAGE_QT5
 	help
 	  Qwt is a graphics extension to the Qt GUI application
 	  framework. It provides a 2D plotting widget and more.
@@ -13,6 +15,7 @@ if BR2_PACKAGE_QWT
 config BR2_PACKAGE_QWT_SVG
 	bool "SVG support"
 	select BR2_PACKAGE_QT_SVG if BR2_PACKAGE_QT
+	select BR2_PACKAGE_QT5SVG if BR2_PACKAGE_QT5
 
 config BR2_PACKAGE_QWT_MATHML
 	bool "MathML support"
@@ -20,10 +23,11 @@ config BR2_PACKAGE_QWT_MATHML
 config BR2_PACKAGE_QWT_OPENGL
 	bool "OpenGL support"
 	select BR2_PACKAGE_QT_OPENGL_ES if \
-	    BR2_PACKAGE_QT && BR2_PACKAGE_HAS_LIBGLES && BR2_PACKAGE_HAS_LIBEGL
+		BR2_PACKAGE_QT && BR2_PACKAGE_HAS_LIBGLES && BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_QT5BASE_OPENGL_LIB if \
+		BR2_PACKAGE_QT5BASE && BR2_PACKAGE_QT5_GL_AVAILABLE
 
 endif
 
-comment "qwt depends on QT gui module"
-	depends on BR2_PACKAGE_QT
-	depends on !BR2_PACKAGE_QT_GUI_MODULE
+comment "qwt needs Qt or Qt5"
+	depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
package/qwt/qwt.mk +5 -0
index afd0ffb..8fbde32 100644
@@ -11,6 +11,9 @@ QWT_INSTALL_STAGING = YES
 ifeq ($(BR2_PACKAGE_QT),y)
 QWT_DEPENDENCIES = qt libgles libegl
 endif
+ifeq ($(BR2_PACKAGE_QT5BASE),y)
+QWT_DEPENDENCIES += qt5base libgles
+endif
 
 QWT_LICENSE = LGPLv2.1 with exceptions
 QWT_LICENSE_FILES = COPYING
@@ -39,6 +42,8 @@ endif
 
 ifeq ($(BR2_PACKAGE_QT),y)
     QWT_QMAKE = $(QT_QMAKE)
+else
+	QWT_QMAKE = $(QT5_QMAKE)
 endif
 
 define QWT_CONFIGURE_CMDS
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 package/qwt : added support for Qt5.

Hello,

package/qwt/Config.in line 6

Quoted 12 lines · David Picard
package/qwt/Config.in +3 -1
index e72db31..9dca8ed 100644
@@ -1,7 +1,9 @@
 config BR2_PACKAGE_QWT
 	bool "qwt"
-	depends on BR2_PACKAGE_QT
+	depends on BR2_PACKAGE_QT || BR2_PACKAGE_QT5
 	select BR2_PACKAGE_QT_GUI_MODULE if BR2_PACKAGE_QT
+	select BR2_PACKAGE_QT5BASE_GUI if BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE_CONCURRENT if BR2_PACKAGE_QT5

OK.

package/qwt/Config.in if BR2_PACKAGE_QWT · line 18

Quoted 8 lines
package/qwt/Config.in +1 -0
 	help
 	  Qwt is a graphics extension to the Qt GUI application
 	  framework. It provides a 2D plotting widget and more.
@@ -13,6 +15,7 @@ if BR2_PACKAGE_QWT
 config BR2_PACKAGE_QWT_SVG
 	bool "SVG support"
 	select BR2_PACKAGE_QT_SVG if BR2_PACKAGE_QT
+	select BR2_PACKAGE_QT5SVG if BR2_PACKAGE_QT5

OK.

package/qwt/Config.in config BR2_PACKAGE_QWT_MATHML · line 28

Quoted 11 lines
package/qwt/Config.in +3 -1
 config BR2_PACKAGE_QWT_MATHML
 	bool "MathML support"
@@ -20,10 +23,11 @@ config BR2_PACKAGE_QWT_MATHML
 config BR2_PACKAGE_QWT_OPENGL
 	bool "OpenGL support"
 	select BR2_PACKAGE_QT_OPENGL_ES if \
-	    BR2_PACKAGE_QT && BR2_PACKAGE_HAS_LIBGLES && BR2_PACKAGE_HAS_LIBEGL
+		BR2_PACKAGE_QT && BR2_PACKAGE_HAS_LIBGLES && BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_QT5BASE_OPENGL_LIB if \
+		BR2_PACKAGE_QT5BASE && BR2_PACKAGE_QT5_GL_AVAILABLE

As said for the previous commit, this is also not good. At the end, you should have:

depends on (BR2_PACKAGE_HAS_LIBGLES && BR2_PACKAGE_HAS_LIBEGL) || \
BR2_PACKAGE_QT5_GL_AVAILABLE
select BR2_PACKAGE_QT_OPENGL_ES if BR2_PACKAGE_QT select BR2_PACKAGE_QT5BASE_OPENGL_LIB if BR2_PACKAGE_QT5

package/qwt/Config.in config BR2_PACKAGE_QWT_MATHML · line 29

Quoted 3 lines
package/qwt/Config.in +0 -3
-comment "qwt depends on QT gui module"
-	depends on BR2_PACKAGE_QT
-	depends on !BR2_PACKAGE_QT_GUI_MODULE

This comment should have been removed as part of the previous commit, since in the previous commit, you changed the "depends on BR2_PACKAGE_QT_GUI_MODULE" into a "select".

package/qwt/Config.in config BR2_PACKAGE_QWT_MATHML · line 33

Quoted 2 lines
package/qwt/Config.in +2 -0
+comment "qwt needs Qt or Qt5"
+	depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5

To be honest, I am not sure such a comment is needed. I believe it is completely obvious for the user that a library like Qwt needs Qt.

package/qwt/qwt.mk QWT_INSTALL_STAGING = YES · line 16

Quoted 11 lines
package/qwt/qwt.mk +3 -0
index afd0ffb..8fbde32 100644
@@ -11,6 +11,9 @@ QWT_INSTALL_STAGING = YES
 ifeq ($(BR2_PACKAGE_QT),y)
 QWT_DEPENDENCIES = qt libgles libegl
 endif
+ifeq ($(BR2_PACKAGE_QT5BASE),y)
+QWT_DEPENDENCIES += qt5base libgles
+endif

In fact, now that I think of it, my suggestion in the previous patch to add a dependency on libgles and libegl is wrong. This is not needed, since qt/qt5 will already depend on them.

So, you should just have:

ifeq ($(BR2_PACKAGE_QT),y)
QWT_DEPENDENCIES += qt
QWT_QMAKE = $(QT_MAKE)
else ifeq ($(BR2_PACKAGE_QT5),y)
QWT_DEPENDENCIES += qt5
QWT_QMAKE = $(QT5_QMAKE)
endif

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/2 package/qwt : prepared package for other versions of Qt.

In reply to David Picard

Hello,

Quoted 3 lines · David Picard

Reformatted the package configuration to make it more generic. It will thus be easier to handle more than one version of Qt. Indeed, multiple versions of Qt are compatible with the current Qwt.

Thanks for this new version! Unfortunately, there are still some issues.

package/qwt/Config.in line 4

Quoted 10 lines
package/qwt/Config.in +1 -1
index 8c7bc56..e72db31 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_QWT
 	bool "qwt"
 	depends on BR2_PACKAGE_QT
-	depends on BR2_PACKAGE_QT_GUI_MODULE
+	select BR2_PACKAGE_QT_GUI_MODULE if BR2_PACKAGE_QT

This is OK.

package/qwt/Config.in if BR2_PACKAGE_QWT · line 15

Quoted 9 lines
package/qwt/Config.in +1 -1
 	help
 	  Qwt is a graphics extension to the Qt GUI application
 	  framework. It provides a 2D plotting widget and more.
@@ -12,16 +12,15 @@ if BR2_PACKAGE_QWT
 
 config BR2_PACKAGE_QWT_SVG
 	bool "SVG support"
-	select BR2_PACKAGE_QT_SVG
+	select BR2_PACKAGE_QT_SVG if BR2_PACKAGE_QT

OK.

package/qwt/Config.in if BR2_PACKAGE_QWT · line 23

Quoted 11 lines
package/qwt/Config.in +2 -3
 config BR2_PACKAGE_QWT_MATHML
 	bool "MathML support"
 
 config BR2_PACKAGE_QWT_OPENGL
 	bool "OpenGL support"
-	depends on BR2_PACKAGE_HAS_LIBGLES
-	depends on BR2_PACKAGE_HAS_LIBEGL
-	select BR2_PACKAGE_QT_OPENGL_ES
+	select BR2_PACKAGE_QT_OPENGL_ES if \
+	    BR2_PACKAGE_QT && BR2_PACKAGE_HAS_LIBGLES && BR2_PACKAGE_HAS_LIBEGL

This is not good. Because what you have written means:

enable the Qt OpenGL support if Qt is enabled, and OpenGLES/EGL is available

This means that it is now possible to enable BR2_PACKAGE_QWT_OPENGL without OpenGL support!

What you want to do here is:

depends on BR2_PACKAGE_HAS_LIBGLES depends on BR2_PACKAGE_HAS_LIBGL
select BR2_PACKAGE_QT_OPENGL_ES if BR2_PACKAGE_QT

package/qwt/Config.in if BR2_PACKAGE_QWT · line 25

Quoted 3 lines
package/qwt/Config.in +3 -0
+ifeq ($(BR2_PACKAGE_QT),y)
+QWT_DEPENDENCIES = qt libgles libegl
+endif

This is not good: you are adding unconditionally libgles and libegl as dependencies of qwt. This should probably be:

ifeq ($(BR2_PACKAGE_QT),y)
QWT_DEPENDENCIES += qt
QWT_QMAKE = $(QT_QMAKE)
endif

ifeq ($(BR2_PACKAGE_QWT_OPENGL),y)
QWT_DEPENDENCIES += libgles libegl
endif

package/qwt/Config.in else · line 41

Quoted 9 lines
package/qwt/Config.in +2 -0
 QWT_LICENSE = LGPLv2.1 with exceptions
 QWT_LICENSE_FILES = COPYING
@@ -35,9 +37,13 @@ else
 QWT_CONFIG += -e 's/^.*QWT_CONFIG.*QwtOpenGL.*$$/\# QWT_CONFIG += QwtOpenGL/'
 endif
 
+ifeq ($(BR2_PACKAGE_QT),y)
+    QWT_QMAKE = $(QT_QMAKE)

I've refactored this with the condition above. Also note that we do not intend the assignment of variables.

Care to rework this?

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/2 package/qwt : prepared package for other versions of Qt.

Hello,

Quoted 3 lines · Thomas Petazzoni

ifeq ($(BR2_PACKAGE_QWT_OPENGL),y)
QWT_DEPENDENCIES += libgles libegl
endif

I correct myself on this: this is not needed. Indeed, if BR2_PACKAGE_QWT_OPENGL is enabled, you have selected BR2_PACKAGE_QT_OPENGL_ES, so qt already depends on libgles/libegl. So there's no need to replicate this dependency here.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com