Linux installer: Check that freetype is new enough

This commit is contained in:
Kovid Goyal 2024-10-02 20:49:03 +05:30
parent c08a34be69
commit 8fbb9b254b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 30 additions and 0 deletions

View File

@ -799,6 +799,19 @@ def check_glibc_version(min_required=(2, 31), release_date='2020-02-01'):
).format(ver, '.'.join(map(str, min_required)), release_date))
def check_for_recent_freetype():
import ctypes
try:
f = ctypes.CDLL('libfreetype.so')
except OSError:
raise SystemExit('Your system is missing the FreeType library libfreetype.so. Try installing the freetype package.')
try:
f.FT_Get_Color_Glyph_Paint
except AttributeError:
raise SystemExit('Your system has too old a version of the FreeType library.'
' freetype >= 2.11 is needed for the FT_Get_Color_Glyph_Paint function which is required by Qt WebEngine')
def main(install_dir=None, isolated=False, bin_dir=None, share_dir=None, ignore_umask=False, version=None):
if not ignore_umask and not isolated:
check_umask()
@ -825,6 +838,8 @@ def main(install_dir=None, isolated=False, bin_dir=None, share_dir=None, ignore_
check_for_libOpenGl()
if q[0] >= 7:
check_for_libxcb_cursor()
if q >= (7, 16, 0):
check_for_recent_freetype()
run_installer(install_dir, isolated, bin_dir, share_dir, version)

View File

@ -848,6 +848,19 @@ def check_glibc_version(min_required=(2, 31), release_date='2020-02-01'):
).format(ver, '.'.join(map(str, min_required)), release_date))
def check_for_recent_freetype():
import ctypes
try:
f = ctypes.CDLL('libfreetype.so')
except OSError:
raise SystemExit('Your system is missing the FreeType library libfreetype.so. Try installing the freetype package.')
try:
f.FT_Get_Color_Glyph_Paint
except AttributeError:
raise SystemExit('Your system has too old a version of the FreeType library.'
' freetype >= 2.11 is needed for the FT_Get_Color_Glyph_Paint function which is required by Qt WebEngine')
def main(install_dir=None, isolated=False, bin_dir=None, share_dir=None, ignore_umask=False, version=None):
if not ignore_umask and not isolated:
check_umask()
@ -874,6 +887,8 @@ def main(install_dir=None, isolated=False, bin_dir=None, share_dir=None, ignore_
check_for_libOpenGl()
if q[0] >= 7:
check_for_libxcb_cursor()
if q >= (7, 16, 0):
check_for_recent_freetype()
run_installer(install_dir, isolated, bin_dir, share_dir, version)