From a60799aed6c99e6ac97c4b3a3ef9246b1b5425dd Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 23 Nov 2022 14:13:55 +1000 Subject: [PATCH] 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 --- meson.build | 11 +++++++++-- meson_options.txt | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) 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)