Skip to contentSkip to conversation

qt5base: use system/buildroot provided freetype

PATCH New Peter Seiderer 2 participants 6 messages Feb 13, 2017 – Feb 18, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 qt5base: use system/buildroot provided freetype

Select (and use) builroot provided freetype in case qt5base gui is selected (gui without freetype/font support makes not much sense and gives compile errors).

Qt 5.6 needs some support to find the include headers, 5.8 is clever enough inherently.

Fixes [1] (by avoiding the build-in freetype library which depends on avtivated libpng support):

Project ERROR: Library 'libpng' is not defined. make[3]: *** [sub-3rdparty-freetype-make_first] Error 3

[1] http://autobuild.buildroot.net/results/219162ba616289f799a5053c4dcc6b8574284283

---
Changes v1 -> v2:
- updated patch description
- checked and fixed for Qt 5.6

---
 package/qt5/qt5base/Config.in  | 1 +
 package/qt5/qt5base/qt5base.mk | 5 +++++
 2 files changed, 6 insertions(+)
package/qt5/qt5base/Config.in +1 -0
index f22e034b3..337dcf245 100644
@@ -128,6 +128,7 @@ config BR2_PACKAGE_QT5BASE_XML
 
 config BR2_PACKAGE_QT5BASE_GUI
 	bool "gui module"
+	select BR2_PACKAGE_FREETYPE
 	# At least one graphic backend must be enabled, so enable
 	# linuxfb if nothing is enabled.
 	select BR2_PACKAGE_QT5BASE_LINUXFB if \
package/qt5/qt5base/qt5base.mk +5 -0
index 09bf5cf7b..3825f5bcc 100644
@@ -100,6 +100,11 @@ endif
 # We have to use --enable-linuxfb, otherwise Qt thinks that -linuxfb
 # is to add a link against the "inuxfb" library.
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GUI),-gui,-no-gui)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GUI),-system-freetype,-no-freetype)
+ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
+QT5BASE_CONFIGURE_OPTS += -I$(STAGING_DIR)/usr/include/freetype2
+endif
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_GUI),freetype)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 2/2 qt5base: make harfbuzz support selectable

If selected use:

- system/buildroot harfbuzz in case __sync for 4 bytes is supported
- qt harfbuzz otherwise (using QAtomic instead)

---
Changes v1 -> v2:
- make harfbuzz support selectable, preferre the system provided one, but fall back to qt provided one

---
 package/qt5/qt5base/Config.in  |  9 +++++++++
 package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
 2 files changed, 23 insertions(+)
package/qt5/qt5base/Config.in +9 -0
index 337dcf245..27f225026 100644
@@ -239,6 +239,15 @@ config BR2_PACKAGE_QT5BASE_FONTCONFIG
 	  This option enables Fontconfig and Freetype support using
 	  the system fontconfig and freetype2 libraries.
 
+config BR2_PACKAGE_QT5BASE_HARFBUZZ
+	bool "harfbuzz support"
+	select BR2_PACKAGE_HARFBUZZ if BR2_TOOLCHAIN_HAS_SYNC_4
+	help
+	  This option enables HarfBuzz support (either system
+	  harfbuzz if the toolchain supports __sync for 4 bytes
+	  or qt provided one which avoids this dependenc by using
+	  QAtomic).
+
 config BR2_PACKAGE_QT5BASE_GIF
 	bool "GIF support"
 	help
package/qt5/qt5base/qt5base.mk +14 -0
index 3825f5bcc..187388e19 100644
@@ -105,6 +105,20 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5BASE_CONFIGURE_OPTS += -I$(STAGING_DIR)/usr/include/freetype2
 endif
 QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_GUI),freetype)
+ifeq ($(BR2_PACKAGE_QT5BASE_GUI)$(BR2_PACKAGE_QT5BASE_HARFBUZZ),yy)
+ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4),y)
+# system harfbuzz in case __sync for 4 bytes is supported
+QT5BASE_CONFIGURE_OPTS += -system-harfbuzz
+QT5BASE_DEPENDENCIES   += harfbuzz
+else
+# qt harfbuzz otherwise (using QAtomic instead)
+QT5BASE_CONFIGURE_OPTS += -qt-harfbuzz
+QT5BASE_LICENSE := $(QT5BASE_LICENSE), MIT (harfbuzz)
+QT5BASE_LICENSE_FILES += src/3rdparty/harfbuzz-ng/COPYING
+endif
+else
+QT5BASE_CONFIGURE_OPTS   += -no-harfbuzz
+endif
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 2/2 qt5base: make harfbuzz support selectable

Quoted 20 lines · Peter Seiderer

If selected use:

- system/buildroot harfbuzz in case __sync for 4 bytes is supported
- qt harfbuzz otherwise (using QAtomic instead)

---
Changes v1 -> v2:
- make harfbuzz support selectable, preferre the system provided one, but fall back to qt provided one

---
 package/qt5/qt5base/Config.in  |  9 +++++++++
 package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
 2 files changed, 23 insertions(+)
package/qt5/qt5base/Config.in +0 -0
index 337dcf245..27f225026 100644

package/qt5/qt5base/Config.in config BR2_PACKAGE_QT5BASE_FONTCONFIG · line 244

Quoted 6 lines
package/qt5/qt5base/Config.in +3 -0
@@ -239,6 +239,15 @@ config BR2_PACKAGE_QT5BASE_FONTCONFIG
 	  This option enables Fontconfig and Freetype support using
 	  the system fontconfig and freetype2 libraries.
 
+config BR2_PACKAGE_QT5BASE_HARFBUZZ
+	bool "harfbuzz support"
+	select BR2_PACKAGE_HARFBUZZ if BR2_TOOLCHAIN_HAS_SYNC_4

I think we should automatically use system harfbuzz if it is selected, and only
offer this option if system harfbuzz is not available. So here 'depends on !SYNC_4'...

Quoted 14 lines
package/qt5/qt5base/Config.in +6 -0
+	help
+	  This option enables HarfBuzz support (either system
+	  harfbuzz if the toolchain supports __sync for 4 bytes
+	  or qt provided one which avoids this dependenc by using
+	  QAtomic).
+
 config BR2_PACKAGE_QT5BASE_GIF
 	bool "GIF support"
 	help
package/qt5/qt5base/qt5base.mk +0 -0
index 3825f5bcc..187388e19 100644

package/qt5/qt5base/qt5base.mk ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y) · line 110

Quoted 6 lines
package/qt5/qt5base/qt5base.mk +3 -0
@@ -105,6 +105,20 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5BASE_CONFIGURE_OPTS += -I$(STAGING_DIR)/usr/include/freetype2
 endif
 QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_GUI),freetype)
+ifeq ($(BR2_PACKAGE_QT5BASE_GUI)$(BR2_PACKAGE_QT5BASE_HARFBUZZ),yy)
+ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4),y)
+# system harfbuzz in case __sync for 4 bytes is supported

... and here 'ifeq ($(BR2_PACKAGE_HARFBUZZ),y) ...

package/qt5/qt5base/qt5base.mk ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y) · line 113

Quoted 3 lines
package/qt5/qt5base/qt5base.mk +3 -0
+QT5BASE_CONFIGURE_OPTS += -system-harfbuzz
+QT5BASE_DEPENDENCIES   += harfbuzz
+else

... and here 'else ifeq ($(BR2_PACKAGE_QT5BASE_HARFBUZZ),y) ...

package/qt5/qt5base/qt5base.mk ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y) · line 121

Quoted 8 lines
package/qt5/qt5base/qt5base.mk +8 -0
+# qt harfbuzz otherwise (using QAtomic instead)
+QT5BASE_CONFIGURE_OPTS += -qt-harfbuzz
+QT5BASE_LICENSE := $(QT5BASE_LICENSE), MIT (harfbuzz)
+QT5BASE_LICENSE_FILES += src/3rdparty/harfbuzz-ng/COPYING
+endif
+else
+QT5BASE_CONFIGURE_OPTS   += -no-harfbuzz
+endif

Leave an empty line below and above this conditional block.

Also, it would be more logical IMHO to put it close to openssl.

Regards,
Arnout

Quoted 4 lines
package/qt5/qt5base/qt5base.mk +0 -0
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH v2 2/2 qt5base: make harfbuzz support selectable

Hello Arnout,

Quoted 26 lines · Arnout Vandecappelle
Quoted 23 lines · Peter Seiderer

If selected use:

- system/buildroot harfbuzz in case __sync for 4 bytes is supported
- qt harfbuzz otherwise (using QAtomic instead)

---
Changes v1 -> v2:
- make harfbuzz support selectable, preferre the system provided one, but fall back to qt provided one

---
 package/qt5/qt5base/Config.in  |  9 +++++++++
 package/qt5/qt5base/qt5base.mk | 14 ++++++++++++++
 2 files changed, 23 insertions(+)
package/qt5/qt5base/Config.in +0 -0
index 337dcf245..27f225026 100644
@@ -239,6 +239,15 @@ config BR2_PACKAGE_QT5BASE_FONTCONFIG
 	  This option enables Fontconfig and Freetype support using
 	  the system fontconfig and freetype2 libraries.
 
Quoted 7 lines

package/qt5/qt5base/Config.in config BR2_PACKAGE_QT5BASE_FONTCONFIG · line 244

Quoted 3 lines
package/qt5/qt5base/Config.in +3 -0
+config BR2_PACKAGE_QT5BASE_HARFBUZZ
+	bool "harfbuzz support"
+	select BR2_PACKAGE_HARFBUZZ if BR2_TOOLCHAIN_HAS_SYNC_4

I think we should automatically use system harfbuzz if it is selected, and only
offer this option if system harfbuzz is not available. So here 'depends on !SYNC_4'...

I know that is the buildroot style for many options, but my reasoning was that it is a little complicated logic 'you can enable buildroot harfbuzz but in case you have toolchain xy this one is not used and there is this special qt5base config option for you (which is only visible depending on toolchain xy)'.

I think the solution 'do you want HarfBuzz support for qt5base' (and hide the decision which one is used) is more undertandable...

Quoted 30 lines
Quoted 15 lines
package/qt5/qt5base/Config.in +6 -0
+	help
+	  This option enables HarfBuzz support (either system
+	  harfbuzz if the toolchain supports __sync for 4 bytes
+	  or qt provided one which avoids this dependenc by using
+	  QAtomic).
+
 config BR2_PACKAGE_QT5BASE_GIF
 	bool "GIF support"
 	help
package/qt5/qt5base/qt5base.mk +0 -0
index 3825f5bcc..187388e19 100644

package/qt5/qt5base/qt5base.mk ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y) · line 110

Quoted 6 lines
package/qt5/qt5base/qt5base.mk +3 -0
@@ -105,6 +105,20 @@ ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)
 QT5BASE_CONFIGURE_OPTS += -I$(STAGING_DIR)/usr/include/freetype2
 endif
 QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_GUI),freetype)
+ifeq ($(BR2_PACKAGE_QT5BASE_GUI)$(BR2_PACKAGE_QT5BASE_HARFBUZZ),yy)
+ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_4),y)
+# system harfbuzz in case __sync for 4 bytes is supported

... and here 'ifeq ($(BR2_PACKAGE_HARFBUZZ),y) ...

package/qt5/qt5base/qt5base.mk ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y) · line 113

Quoted 3 lines
package/qt5/qt5base/qt5base.mk +3 -0
+QT5BASE_CONFIGURE_OPTS += -system-harfbuzz
+QT5BASE_DEPENDENCIES   += harfbuzz
+else

... and here 'else ifeq ($(BR2_PACKAGE_QT5BASE_HARFBUZZ),y) ...

Quoted 10 lines

package/qt5/qt5base/qt5base.mk ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y) · line 121

Quoted 8 lines
package/qt5/qt5base/qt5base.mk +8 -0
+# qt harfbuzz otherwise (using QAtomic instead)
+QT5BASE_CONFIGURE_OPTS += -qt-harfbuzz
+QT5BASE_LICENSE := $(QT5BASE_LICENSE), MIT (harfbuzz)
+QT5BASE_LICENSE_FILES += src/3rdparty/harfbuzz-ng/COPYING
+endif
+else
+QT5BASE_CONFIGURE_OPTS   += -no-harfbuzz
+endif

Leave an empty line below and above this conditional block.

Empty lines added...

Quoted 2 lines

Also, it would be more logical IMHO to put it close to openssl.

HarfBuzz support makes only sense with GUI selected (no standalone plugin), it is a configure option of the freeetype support and belongs logically to the font (and so fontconfig) support....

Regards,
Peter

Quoted 9 lines

Regards,
Arnout

Quoted 4 lines
package/qt5/qt5base/qt5base.mk +0 -0
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
#4 lore raw

PATCH v2 1/2 qt5base: use system/buildroot provided freetype

In reply to Peter Seiderer
Quoted 9 lines · Peter Seiderer

Select (and use) builroot provided freetype in case qt5base gui is selected (gui without freetype/font support makes not much sense and gives compile errors).

Qt 5.6 needs some support to find the include headers, 5.8 is clever enough inherently.

Fixes [1] (by avoiding the build-in freetype library which depends on avtivated libpng support):

     ^^^^^^^^^activated, I guess?
Quoted 33 lines

Project ERROR: Library 'libpng' is not defined. make[3]: *** [sub-3rdparty-freetype-make_first] Error 3

[1] http://autobuild.buildroot.net/results/219162ba616289f799a5053c4dcc6b8574284283

---
Changes v1 -> v2:
- updated patch description
- checked and fixed for Qt 5.6

---
 package/qt5/qt5base/Config.in  | 1 +
 package/qt5/qt5base/qt5base.mk | 5 +++++
 2 files changed, 6 insertions(+)
package/qt5/qt5base/Config.in +1 -0
index f22e034b3..337dcf245 100644
@@ -128,6 +128,7 @@ config BR2_PACKAGE_QT5BASE_XML
 
 config BR2_PACKAGE_QT5BASE_GUI
 	bool "gui module"
+	select BR2_PACKAGE_FREETYPE
 	# At least one graphic backend must be enabled, so enable
 	# linuxfb if nothing is enabled.
 	select BR2_PACKAGE_QT5BASE_LINUXFB if \
package/qt5/qt5base/qt5base.mk +0 -0
index 09bf5cf7b..3825f5bcc 100644

package/qt5/qt5base/qt5base.mk endif · line 104

Quoted 5 lines
package/qt5/qt5base/qt5base.mk +2 -0
@@ -100,6 +100,11 @@ endif
 # We have to use --enable-linuxfb, otherwise Qt thinks that -linuxfb
 # is to add a link against the "inuxfb" library.
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GUI),-gui,-no-gui)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GUI),-system-freetype,-no-freetype)
+ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)

This should also only be enabled if BR2_PACKAGE_QT5BASE_GUI is y.

package/qt5/qt5base/qt5base.mk endif · line 107

Quoted 3 lines
package/qt5/qt5base/qt5base.mk +3 -0
+QT5BASE_CONFIGURE_OPTS += -I$(STAGING_DIR)/usr/include/freetype2
+endif
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_GUI),freetype)

Since the condition becomes a bit complicated I'd use an ifeq instead of inline
condition.

With those small nits fixed you can add my

Regards,
Arnout

Quoted 4 lines
package/qt5/qt5base/qt5base.mk +0 -0
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#5 lore raw

PATCH v2 1/2 qt5base: use system/buildroot provided freetype

Hello Arnout,

Quoted 7 lines · Arnout Vandecappelle
Quoted 4 lines · Peter Seiderer

Select (and use) builroot provided freetype in case qt5base gui is selected (gui without freetype/font support makes not much sense and gives compile errors).

Quoted 6 lines
Quoted 5 lines

Qt 5.6 needs some support to find the include headers, 5.8 is clever enough inherently.

Fixes [1] (by avoiding the build-in freetype library which depends on avtivated libpng support):

     ^^^^^^^^^activated, I guess?

Of course ;-), fixed...

Quoted 33 lines
Quoted 33 lines

Project ERROR: Library 'libpng' is not defined. make[3]: *** [sub-3rdparty-freetype-make_first] Error 3

[1] http://autobuild.buildroot.net/results/219162ba616289f799a5053c4dcc6b8574284283

---
Changes v1 -> v2:
- updated patch description
- checked and fixed for Qt 5.6

---
 package/qt5/qt5base/Config.in  | 1 +
 package/qt5/qt5base/qt5base.mk | 5 +++++
 2 files changed, 6 insertions(+)
package/qt5/qt5base/Config.in +1 -0
index f22e034b3..337dcf245 100644
@@ -128,6 +128,7 @@ config BR2_PACKAGE_QT5BASE_XML
 
 config BR2_PACKAGE_QT5BASE_GUI
 	bool "gui module"
+	select BR2_PACKAGE_FREETYPE
 	# At least one graphic backend must be enabled, so enable
 	# linuxfb if nothing is enabled.
 	select BR2_PACKAGE_QT5BASE_LINUXFB if \
package/qt5/qt5base/qt5base.mk +0 -0
index 09bf5cf7b..3825f5bcc 100644
Quoted 8 lines

package/qt5/qt5base/qt5base.mk endif · line 104

Quoted 6 lines
package/qt5/qt5base/qt5base.mk +2 -0
@@ -100,6 +100,11 @@ endif
 # We have to use --enable-linuxfb, otherwise Qt thinks that -linuxfb
 # is to add a link against the "inuxfb" library.
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GUI),-gui,-no-gui)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_GUI),-system-freetype,-no-freetype)
+ifeq ($(BR2_PACKAGE_QT5_VERSION_5_6),y)

This should also only be enabled if BR2_PACKAGE_QT5BASE_GUI is y.

O.k., fixed...

Quoted 7 lines

package/qt5/qt5base/qt5base.mk endif · line 107

Quoted 4 lines
package/qt5/qt5base/qt5base.mk +3 -0
+QT5BASE_CONFIGURE_OPTS += -I$(STAGING_DIR)/usr/include/freetype2
+endif
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_GUI),freetype)

Since the condition becomes a bit complicated I'd use an ifeq instead of inline
condition.

O.k., fixed...

Thanks for review.

Regards,
Peter

Quoted 13 lines

With those small nits fixed you can add my

Regards,
Arnout

Quoted 4 lines
package/qt5/qt5base/qt5base.mk +0 -0
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_WIDGETS),-widgets,-no-widgets)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_LINUXFB),--enable-linuxfb,-no-linuxfb)
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DIRECTFB),-directfb,-no-directfb)