From d4c894c8a6058f755a0d97b255b44bc5423e3ca9 Mon Sep 17 00:00:00 2001 From: b-aaz <85005689+b-aaz@users.noreply.github.com> Date: Thu, 4 Dec 2025 15:53:13 +0330 Subject: [PATCH] meson: Automatically detect the default xorg-module-dir. The module directory has changed to a per ABI folder in the xlibre-xserver. Now the default value of `xorg-module-dir` will be detected from the `moduledir` variable in xorg-server.pc. Signed-off-by: b-aaz --- meson_options.txt | 4 ++-- src/meson.build | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index a7431fb3..60265c41 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -36,5 +36,5 @@ option('async-swap', type : 'boolean', value : false, description : 'Enable use of asynchronous swaps (experimental)') option('internal-debug', type : 'combo', value : 'no', choices : [ 'no', 'sync', 'memory', 'pixmap', 'full' ], description : 'Enable internal debugging') -option('xorg-module-dir', type : 'string', value : '@libdir@/xorg/modules', - description : 'Default xorg module directory') +option('xorg-module-dir', type: 'string', value: '', + description: 'Directory to install the driver in [default=from xorg-server pkgconf]') diff --git a/src/meson.build b/src/meson.build index 1125c65b..9afe0380 100644 --- a/src/meson.build +++ b/src/meson.build @@ -134,13 +134,9 @@ if with_valgrind endif xorg_moduledir = get_option('xorg-module-dir') -moduledir = '' -foreach dir : xorg_moduledir.split('/') - if dir == '@libdir@' - dir = get_option('libdir') - endif - moduledir = join_paths(moduledir, dir) -endforeach +if xorg_moduledir == '' + xorg_moduledir = xorg.get_variable(pkgconfig: 'moduledir') +endif shared_module('intel_drv', sources : intel_drv_sources, @@ -152,5 +148,5 @@ shared_module('intel_drv', '-Wno-sign-compare', ], name_prefix : '', - install_dir : join_paths(moduledir, 'drivers'), + install_dir : join_paths(xorg_moduledir, 'drivers'), install : true)