Skip to content

Commit

Permalink
Linux installer: Check that freetype is new enough
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Oct 2, 2024
1 parent c08a34b commit 8fbb9b2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions setup/linux-installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)


Expand Down
15 changes: 15 additions & 0 deletions setup/linux-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit 8fbb9b2

Please sign in to comment.