diff --git a/meson.build b/meson.build index 546bb4e4b..0f0a4442a 100644 --- a/meson.build +++ b/meson.build @@ -141,8 +141,15 @@ endif dfp = get_option('default_font_path') if dfp == '' - fontutil_dep = dependency('fontutil') - fontrootdir = fontutil_dep.get_pkgconfig_variable('fontrootdir') + fontrootdir = get_option('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 = [ join_paths(fontrootdir, 'misc'), join_paths(fontrootdir, 'TTF'), diff --git a/meson_options.txt b/meson_options.txt index ed3b11677..11d576780 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -25,6 +25,8 @@ option('log_dir', type: 'string') option('module_dir', type: 'string', value: 'xorg/modules', description: 'X.Org modules directory (absolute or relative to the directory specified by the libdir option)') 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('xdmcp', type: 'boolean', value: true)