Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] qt5: Add an option to select default platform
@ 2014-07-04 16:11 Jérôme Pouiller
  2014-07-15 20:31 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Jérôme Pouiller @ 2014-07-04 16:11 UTC (permalink / raw)
  To: buildroot

Whithout this path, default platform is automaticaly set (generally
set to "eglfs" as defined in
qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice
is not always what the user would like. Thus, user have to manually
appends "-platform <BACKEND>" to command line when running any qt5
application.

This patch allows user to choose default platform explicitly.

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
v2:
  * Fix typo in "minimal".
  * Add help for options minimal and offscreen. I didn't find any 
    documentation about offscreen. So, description of this option 
    is my understanding of sources.

 package/qt5/qt5base/Config.in  | 49 ++++++++++++++++++++++++++++++++++++++++++
 package/qt5/qt5base/qt5base.mk |  6 ++++++
 2 files changed, 55 insertions(+)

diff --git a/package/qt5/qt5base/Config.in b/package/qt5/qt5base/Config.in
index 70ddcd3..196099f 100644
--- a/package/qt5/qt5base/Config.in
+++ b/package/qt5/qt5base/Config.in
@@ -144,6 +144,55 @@ config BR2_PACKAGE_QT5BASE_EGLFS
 comment "eglfs backend available if OpenGLES and EGL are enabled"
 	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES
 
+choice
+	prompt "default graphical platform"
+	default BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL
+	help
+	  Notice you may choose platform at runtime using -platform (-platform
+	  help to get list of compiled platforms).
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL
+	bool "minimal"
+	help
+	  Dummy platform allowing user to launch graphical application without
+	  any real graphical backend
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_OFFSCREEN
+	bool "offscreen"
+	help
+	  Similar to "minimal". However, if compiled with OpenGL, with backend
+	  allows to allocate offscreen OpenGL contexts.
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_LINUXFB
+	bool "linuxfb"
+	depends on BR2_PACKAGE_QT5BASE_LINUXFB
+
+comment 'linuxfb needs linuxfb support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_LINUXFB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_DIRECTFB
+	bool "directfb"
+	depends on BR2_PACKAGE_QT5BASE_DIRECTFB
+
+comment 'directfb needs directfb support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_DIRECTFB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_XCB
+	bool "xcb"
+	depends on BR2_PACKAGE_QT5BASE_XCB
+
+comment 'xcb needs X.org XCB support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_XCB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_EGLFS
+	bool "eglfs"
+	depends on BR2_PACKAGE_QT5BASE_EGLFS
+
+comment 'eglfs needs eglfs support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_EGLFS
+
+endchoice
+
 config BR2_PACKAGE_QT5BASE_PRINTSUPPORT
 	bool "print support module"
 	select BR2_PACKAGE_QT5BASE_WIDGETS
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 618251e..77912e7 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -96,6 +96,12 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-xcb
 endif
 
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL),-qpa minimal)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_OFFSCREEN),-qpa offscreen)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_LINUXFB),-qpa linuxfb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_XCB),-qpa xcb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_EGLFS),-qpa eglfs)
+
 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
 QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
 QT5BASE_DEPENDENCIES   += libgles libegl
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2] qt5: Add an option to select default platform
  2014-07-04 16:11 [Buildroot] [PATCH v2] qt5: Add an option to select default platform Jérôme Pouiller
@ 2014-07-15 20:31 ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2014-07-15 20:31 UTC (permalink / raw)
  To: buildroot

J?r?me, All,

On 2014-07-04 18:11 +0200, J?r?me Pouiller spake thusly:
> Whithout this path, default platform is automaticaly set (generally
> set to "eglfs" as defined in
> qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice
> is not always what the user would like. Thus, user have to manually
> appends "-platform <BACKEND>" to command line when running any qt5
> application.
> 
> This patch allows user to choose default platform explicitly.
> 
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

As discussed in your previous iteration, it was stated that a free-form
string would be just better than a choice.

So I'm marking this patchs "Changes REquested" in the Patchwork.

Thanks!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2] qt5: Add an option to select default platform
@ 2014-07-16 15:58 Jérôme Pouiller
  2014-07-16 17:05 ` Yann E. MORIN
  2014-07-16 17:50 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Jérôme Pouiller @ 2014-07-16 15:58 UTC (permalink / raw)
  To: buildroot

Whithout this path, default platform is automaticaly set (generally
set to "eglfs" as defined in
qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice
is not always what the user would like. Thus, user have to manually
appends "-platform <BACKEND>" to command line when running any qt5
application.

This patch allows user to choose default platform explicitly.

Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
v2:
  * Use a string instead of a choice
  * Improve help message


 package/qt5/qt5base/Config.in  | 11 +++++++++++
 package/qt5/qt5base/qt5base.mk |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/package/qt5/qt5base/Config.in b/package/qt5/qt5base/Config.in
index 24e5902..632711c 100644
--- a/package/qt5/qt5base/Config.in
+++ b/package/qt5/qt5base/Config.in
@@ -144,6 +144,17 @@ config BR2_PACKAGE_QT5BASE_EGLFS
 comment "eglfs backend available if OpenGLES and EGL are enabled"
 	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES
 
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA
+	string "Default graphical platform"
+	help
+	  Choose the default platform abstraction to use for graphical
+	  application (e.g xcb, linuxfb, eglfs, ...). If this is empty, the
+	  default for your architecture will be used (usually this is eglfs).
+
+	  You can get a list of supported platform by running a Qt application
+	  with the option "-platform help" on your target. You can choose a
+	  different platform at runtime with the -platform option.
+
 config BR2_PACKAGE_QT5BASE_PRINTSUPPORT
 	bool "print support module"
 	select BR2_PACKAGE_QT5BASE_WIDGETS
diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 618251e..fecde13 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -96,6 +96,9 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-xcb
 endif
 
+QT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA))
+QT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA))
+
 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
 QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
 QT5BASE_DEPENDENCIES   += libgles libegl
-- 
2.0.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2] qt5: Add an option to select default platform
  2014-07-16 15:58 Jérôme Pouiller
@ 2014-07-16 17:05 ` Yann E. MORIN
  2014-07-16 17:50 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2014-07-16 17:05 UTC (permalink / raw)
  To: buildroot

J?r?me, All,

On 2014-07-16 17:58 +0200, J?r?me Pouiller spake thusly:
> Whithout this path, default platform is automaticaly set (generally
> set to "eglfs" as defined in
> qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice
> is not always what the user would like. Thus, user have to manually
> appends "-platform <BACKEND>" to command line when running any qt5
> application.
> 
> This patch allows user to choose default platform explicitly.
> 
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

Two very small nit-picks, below. Otherwise:

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

> ---
> v2:
>   * Use a string instead of a choice
>   * Improve help message
> 
> 
>  package/qt5/qt5base/Config.in  | 11 +++++++++++
>  package/qt5/qt5base/qt5base.mk |  3 +++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/package/qt5/qt5base/Config.in b/package/qt5/qt5base/Config.in
> index 24e5902..632711c 100644
> --- a/package/qt5/qt5base/Config.in
> +++ b/package/qt5/qt5base/Config.in
> @@ -144,6 +144,17 @@ config BR2_PACKAGE_QT5BASE_EGLFS
>  comment "eglfs backend available if OpenGLES and EGL are enabled"
>  	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES
>  
> +config BR2_PACKAGE_QT5BASE_DEFAULT_QPA
> +	string "Default graphical platform"
> +	help
> +	  Choose the default platform abstraction to use for graphical
> +	  application (e.g xcb, linuxfb, eglfs, ...). If this is empty, the

applications <- plural, no?

> +	  default for your architecture will be used (usually this is eglfs).
> +
> +	  You can get a list of supported platform by running a Qt application

platforms  <- plural, too, no?

Regards,
Yann E. MORIN.

> +	  with the option "-platform help" on your target. You can choose a
> +	  different platform at runtime with the -platform option.
> +
>  config BR2_PACKAGE_QT5BASE_PRINTSUPPORT
>  	bool "print support module"
>  	select BR2_PACKAGE_QT5BASE_WIDGETS
> diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
> index 618251e..fecde13 100644
> --- a/package/qt5/qt5base/qt5base.mk
> +++ b/package/qt5/qt5base/qt5base.mk
> @@ -96,6 +96,9 @@ else
>  QT5BASE_CONFIGURE_OPTS += -no-xcb
>  endif
>  
> +QT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA))
> +QT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA))
> +
>  ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
>  QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
>  QT5BASE_DEPENDENCIES   += libgles libegl
> -- 
> 2.0.1
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v2] qt5: Add an option to select default platform
  2014-07-16 15:58 Jérôme Pouiller
  2014-07-16 17:05 ` Yann E. MORIN
@ 2014-07-16 17:50 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2014-07-16 17:50 UTC (permalink / raw)
  To: buildroot

Dear J?r?me Pouiller,

On Wed, 16 Jul 2014 17:58:51 +0200, J?r?me Pouiller wrote:
> Whithout this path, default platform is automaticaly set (generally
> set to "eglfs" as defined in
> qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice
> is not always what the user would like. Thus, user have to manually
> appends "-platform <BACKEND>" to command line when running any qt5
> application.
> 
> This patch allows user to choose default platform explicitly.
> 
> Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>

Thanks, applied with the minor fixes suggested by Yann E. Morin.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-16 17:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 16:11 [Buildroot] [PATCH v2] qt5: Add an option to select default platform Jérôme Pouiller
2014-07-15 20:31 ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2014-07-16 15:58 Jérôme Pouiller
2014-07-16 17:05 ` Yann E. MORIN
2014-07-16 17:50 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox