diff --git a/setup/linux-installer.py b/setup/linux-installer.py index 3c7eced38d..df20843e83 100644 --- a/setup/linux-installer.py +++ b/setup/linux-installer.py @@ -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) diff --git a/setup/linux-installer.sh b/setup/linux-installer.sh index e3882f8a3e..bc3fd9b243 100644 --- a/setup/linux-installer.sh +++ b/setup/linux-installer.sh @@ -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)