build: replace FreeType back-compat sed with a patch in qt package

pull/764/head
fanquake 4 years ago
parent 3aaa39d436
commit c723e4176e
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -11,6 +11,7 @@ $(package)_qt_libs=corelib network widgets gui plugins testlib
$(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch $(package)_patches=fix_qt_pkgconfig.patch mac-qmake.conf fix_configure_mac.patch fix_no_printer.patch
$(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch $(package)_patches+= fix_rcc_determinism.patch fix_riscv64_arch.patch xkb-default.patch no-xlib.patch
$(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch $(package)_patches+= fix_android_qmake_conf.patch fix_android_jni_static.patch dont_hardcode_pwd.patch
$(package)_patches+= freetype_back_compat.patch
# Update OSX_QT_TRANSLATIONS when this is updated # Update OSX_QT_TRANSLATIONS when this is updated
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) $(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
@ -192,7 +193,7 @@ define $(package)_extract_cmds
endef endef
define $(package)_preprocess_cmds define $(package)_preprocess_cmds
sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \ patch -p1 -i $($(package)_patch_dir)/freetype_back_compat.patch && \
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \ sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \ sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch &&\

@ -0,0 +1,28 @@
commit 14bc77db61bf9d56f9b6c8b84aa02573605c19c6
Author: fanquake <fanquake@gmail.com>
Date: Tue Aug 18 15:15:08 2020 +0800
Fix backwards compatibility with older Freetype versions at runtime
A few years ago, libfreetype introduced FT_Get_Font_Format() as an alias
for FT_Get_X11_Font_Format(), but FT_Get_X11_Font_Format() was kept for abi
backwards-compatibility.
Qt 5.9 introduced a call to FT_Get_Font_Format(). Replace it with FT_Get_X11_Font_Format()
in order to remain compatibile with older freetype, which is still used by e.g. Ubuntu Trusty.
See #14348.
diff --git a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 3f543755..8ecc1c8c 100644
--- a/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -898,7 +898,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format,
}
}
#if defined(FT_FONT_FORMATS_H)
- const char *fmt = FT_Get_Font_Format(face);
+ const char *fmt = FT_Get_X11_Font_Format(face);
if (fmt && qstrncmp(fmt, "CFF", 4) == 0) {
FT_Bool no_stem_darkening = true;
FT_Error err = FT_Property_Get(qt_getFreetype(), "cff", "no-stem-darkening", &no_stem_darkening);
Loading…
Cancel
Save