meson: add fontrootdir option to drop font-utils dependency

The only reason we still depend on xorg/font/utils is because we pull a
pkgconfig variable from that .pc file. Let's drop that dependency by
providing that option ourselves.

And where the option isn't specified and font-utils isn't found, default
to $datadir/fonts/X11, same path it's always been.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2022-11-23 14:13:55 +10:00
parent 9c03733669
commit a60799aed6
2 changed files with 11 additions and 2 deletions

View File

@ -141,8 +141,15 @@ endif
dfp = get_option('default_font_path') dfp = get_option('default_font_path')
if dfp == '' if dfp == ''
fontutil_dep = dependency('fontutil') fontrootdir = get_option('fontrootdir')
fontrootdir = fontutil_dep.get_pkgconfig_variable('fontrootdir') if fontrootdir == ''
fontutil_dep = dependency('fontutil', required: false)
if fontutil_dep.found()
fontrootdir = fontutil_dep.get_pkgconfig_variable('fontrootdir')
else
fontrootdir = join_paths(get_option('prefix'), get_option('datadir'), 'fonts', 'X11')
endif
endif
dfp_elements = [ dfp_elements = [
join_paths(fontrootdir, 'misc'), join_paths(fontrootdir, 'misc'),
join_paths(fontrootdir, 'TTF'), join_paths(fontrootdir, 'TTF'),

View File

@ -25,6 +25,8 @@ option('log_dir', type: 'string')
option('module_dir', type: 'string', value: 'xorg/modules', option('module_dir', type: 'string', value: 'xorg/modules',
description: 'X.Org modules directory (absolute or relative to the directory specified by the libdir option)') description: 'X.Org modules directory (absolute or relative to the directory specified by the libdir option)')
option('default_font_path', type: 'string') option('default_font_path', type: 'string')
option('fontrootdir', type: 'string',
description: 'Root directory for legacy fonts. Default: from font-utils.pc or $datadir/fonts/X11')
option('glx', type: 'boolean', value: true) option('glx', type: 'boolean', value: true)
option('xdmcp', type: 'boolean', value: true) option('xdmcp', type: 'boolean', value: true)