diff mbox

[v4,08/21] qt5base: install bundled fonts to target

Message ID 1363721394-14973-9-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Headers show

Commit Message

Thomas Petazzoni March 19, 2013, 7:29 p.m. UTC
From: Floris Bos <bos@je-eigen-domein.nl>

If not using font-config, Qt 5 offers a set of standard fonts to
use instead. Install these to target.

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/qt5/qt5base/qt5base.mk |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Peter Korsgaard March 19, 2013, 9:43 p.m. UTC | #1
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> From: Floris Bos <bos@je-eigen-domein.nl>
 Thomas> If not using font-config, Qt 5 offers a set of standard fonts to
 Thomas> use instead. Install these to target.

Should that then only happen if !BR2_PACKAGE_QT5BASE_FONTCONFIG?
Floris Bos March 19, 2013, 10:07 p.m. UTC | #2
On 03/19/2013 10:43 PM, Peter Korsgaard wrote:
>>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
>   Thomas> From: Floris Bos <bos@je-eigen-domein.nl>
>   Thomas> If not using font-config, Qt 5 offers a set of standard fonts to
>   Thomas> use instead. Install these to target.
>
> Should that then only happen if !BR2_PACKAGE_QT5BASE_FONTCONFIG?

Could add a check to only execute QT5BASE_INSTALL_TARGET_FONTS if 
!BR2_PACKAGE_QT5BASE_FONTCONFIG, if that looks cleaner.

But the standard Qt build script already causes that:

==
mkspecs/features/qpa/genericunixfontdatabase.prf

CONFIG += qpa/basicunixfontdatabase
contains(QT_CONFIG, fontconfig) {
     DEFINES += Q_FONTCONFIGDATABASE
     LIBS += -lfontconfig
} else {
     fonts.path = $$[QT_INSTALL_LIBS]/fonts
     fonts.files = $$QT_SOURCE_TREE/lib/fonts/*
     INSTALLS += fonts
}
==

If fonts are not installed to staging (by INSTALLS += fonts), they are 
not copied to target either.
diff mbox

Patch

diff --git a/package/qt5/qt5base/qt5base.mk b/package/qt5/qt5base/qt5base.mk
index 3b4c007..83ce999 100644
--- a/package/qt5/qt5base/qt5base.mk
+++ b/package/qt5/qt5base/qt5base.mk
@@ -172,9 +172,17 @@  define QT5BASE_INSTALL_TARGET_PLUGINS
 	fi
 endef
 
+define QT5BASE_INSTALL_TARGET_FONTS
+	if [ -d $(STAGING_DIR)/usr/lib/fonts/ ] ; then \
+		mkdir -p $(TARGET_DIR)/usr/lib/fonts ; \
+		cp -dpfr $(STAGING_DIR)/usr/lib/fonts/* $(TARGET_DIR)/usr/lib/fonts ; \
+	fi
+endef
+
 define QT5BASE_INSTALL_TARGET_CMDS
 	$(QT5BASE_INSTALL_TARGET_LIBS)
 	$(QT5BASE_INSTALL_TARGET_PLUGINS)
+	$(QT5BASE_INSTALL_TARGET_FONTS)
 endef
 
 $(eval $(generic-package))