Skip to content

Commit c723e41

Browse files
committed
build: replace FreeType back-compat sed with a patch in qt package
1 parent 3aaa39d commit c723e41

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

depends/packages/qt.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ $(package)_qt_libs=corelib network widgets gui plugins testlib
1111
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch
1212
$(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch
1313
$(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch
14+
$(package)_patches+= freetype_back_compat.patch
1415

1516
# Update OSX_QT_TRANSLATIONS when this is updated
1617
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
@@ -192,7 +193,7 @@ define $(package)_extract_cmds
192193
endef
193194

194195
define $(package)_preprocess_cmds
195-
sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \
196+
patch -p1 -i $($(package)_patch_dir)/freetype_back_compat.patch && \
196197
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
197198
sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \
198199
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
commit 14bc77db61bf9d56f9b6c8b84aa02573605c19c6
2+
Author: fanquake <[email protected]>
3+
Date: Tue Aug 18 15:15:08 2020 +0800
4+
5+
Fix backwards compatibility with older Freetype versions at runtime
6+
7+
A few years ago, libfreetype introduced FT_Get_Font_Format() as an alias
8+
for FT_Get_X11_Font_Format(), but FT_Get_X11_Font_Format() was kept for abi
9+
backwards-compatibility.
10+
11+
Qt 5.9 introduced a call to FT_Get_Font_Format(). Replace it with FT_Get_X11_Font_Format()
12+
in order to remain compatibile with older freetype, which is still used by e.g. Ubuntu Trusty.
13+
14+
See #14348.
15+
16+
diff --git a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
17+
index 3f543755..8ecc1c8c 100644
18+
--- a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
19+
+++ b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
20+
@@ -898,7 +898,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
21+
}
22+
}
23+
#if defined(FT_FONT_FORMATS_H)
24+
- const char *fmt = FT_Get_Font_Format(face);
25+
+ const char *fmt = FT_Get_X11_Font_Format(face);
26+
if (fmt && qstrncmp(fmt, "CFF", 4) == 0) {
27+
FT_Bool no_stem_darkening = true;
28+
FT_Error err = FT_Property_Get(qt_getFreetype(), "cff", "no-stem-darkening", &no_stem_darkening);

0 commit comments

Comments
 (0)