mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 01:58:01 +02:00
meson: install scripts in /usr/share/wireplumber
Since the wireplumber configuration has been moved to /usr/share/pipewire, it does not makes sense to have a different path for the WIREPLUMBER_CONFIG_DIR environment variable. Therefore, the WIREPLUMBER_CONFIG_DIR environment variable has been changed to just be an alias of PIPEWIRE_CONFIG_DIR. Finally, Lua scripts are now installed under /usr/share/wireplumber/scripts instead of /usr/share/pipewire/scripts as they are a wireplumber feature only.
This commit is contained in:
parent
e7c992e97d
commit
310232b810
7 changed files with 18 additions and 37 deletions
|
|
@ -6,16 +6,10 @@ Locations of files
|
|||
Location of configuration files
|
||||
-------------------------------
|
||||
|
||||
WirePlumber's default locations of its configuration files are determined at
|
||||
compile time by the build system. Typically, those end up being
|
||||
``$XDG_CONFIG_DIR/wireplumber``, ``/etc/wireplumber``, and
|
||||
``/usr/share/wireplumber``, in that order of priority.
|
||||
|
||||
In more detail, the latter two are controlled by the ``--sysconfdir`` and ``--datadir``
|
||||
meson options. When those are set to an absolute path, such as ``/etc``, the
|
||||
location of the configuration files is set to be ``$sysconfdir/wireplumber``.
|
||||
When set to a relative path, such as ``etc``, then the installation prefix (``--prefix``)
|
||||
is prepended to the path: ``$prefix/$sysconfdir/wireplumber``
|
||||
WirePlumber's default locations of its configuration files are the same as
|
||||
pipewire. Typically, those end up being
|
||||
``$XDG_CONFIG_DIR/pipewire``, ``/etc/pipewire``, and
|
||||
``/usr/share/pipewire``, in that order of priority.
|
||||
|
||||
The three locations are intended for custom user configuration,
|
||||
host-specific configuration and distribution-provided configuration,
|
||||
|
|
@ -30,6 +24,8 @@ It is also possible to override the configuration directory by setting the
|
|||
|
||||
WIREPLUMBER_CONFIG_DIR=src/config wireplumber
|
||||
|
||||
For convenience, the behaviour of the ``WIREPLUMBER_CONFIG_DIR`` environment
|
||||
variable is the same as the ``PIPEWIRE_CONFIG_DIR`` environment variable.
|
||||
If ``WIREPLUMBER_CONFIG_DIR`` is set, the default locations are ignored and
|
||||
configuration files are *only* looked up in this directory.
|
||||
|
||||
|
|
|
|||
|
|
@ -129,14 +129,7 @@ lookup_dirs (guint flags)
|
|||
* - XDG config directories
|
||||
* - /etc/
|
||||
* - /usr/share/....
|
||||
*
|
||||
* Note that wireplumber environment variables *replace* other directories.
|
||||
*/
|
||||
if ((flags & WP_LOOKUP_DIR_ENV_CONFIG) &&
|
||||
(dir = g_getenv ("WIREPLUMBER_CONFIG_DIR"))) {
|
||||
g_ptr_array_add (dirs, g_canonicalize_filename (dir, NULL));
|
||||
goto done;
|
||||
}
|
||||
if (flags & (WP_LOOKUP_DIR_ENV_DATA | WP_LOOKUP_DIR_ENV_TEST_SRCDIR)) {
|
||||
if ((flags & WP_LOOKUP_DIR_ENV_DATA) &&
|
||||
(dir = g_getenv ("WIREPLUMBER_DATA_DIR")))
|
||||
|
|
@ -151,7 +144,7 @@ lookup_dirs (guint flags)
|
|||
}
|
||||
if (flags & WP_LOOKUP_DIR_XDG_CONFIG_HOME) {
|
||||
dir = g_get_user_config_dir ();
|
||||
g_ptr_array_add (dirs, g_build_filename (dir, "pipewire", NULL));
|
||||
g_ptr_array_add (dirs, g_build_filename (dir, "wireplumber", NULL));
|
||||
}
|
||||
if (flags & WP_LOOKUP_DIR_ETC)
|
||||
g_ptr_array_add (dirs,
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ const gchar * wp_get_module_dir (void);
|
|||
* \ingroup wp
|
||||
*/
|
||||
typedef enum { /*< flags >*/
|
||||
WP_LOOKUP_DIR_ENV_CONFIG = (1 << 0), /*!< $WIREPLUMBER_CONFIG_DIR */
|
||||
WP_LOOKUP_DIR_ENV_DATA = (1 << 1), /*!< $WIREPLUMBER_DATA_DIR */
|
||||
WP_LOOKUP_DIR_ENV_TEST_SRCDIR = (1 << 2), /*!< $G_TEST_SRCDIR */
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,10 @@ wireplumber_headers_dir = get_option('includedir') / 'wireplumber-' + wireplumbe
|
|||
|
||||
wireplumber_bin_dir = get_option('prefix') / get_option('bindir')
|
||||
wireplumber_module_dir = get_option('prefix') / get_option('libdir') / 'wireplumber-' + wireplumber_api_version
|
||||
wireplumber_data_dir = get_option('prefix') / get_option('datadir') / 'pipewire'
|
||||
wireplumber_config_dir = get_option('prefix') / get_option('sysconfdir') / 'pipewire'
|
||||
wireplumber_data_dir = get_option('prefix') / get_option('datadir') / 'wireplumber'
|
||||
wireplumber_config_dir = get_option('prefix') / get_option('sysconfdir') / 'wireplumber'
|
||||
wireplumber_locale_dir = get_option('prefix') / get_option('localedir')
|
||||
pipewire_data_dir = get_option('prefix') / get_option('datadir') / 'pipewire'
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
|
|
@ -168,7 +169,7 @@ wireplumber_uninstalled = custom_target('wp-uninstalled',
|
|||
|
||||
devenv = environment({
|
||||
'WIREPLUMBER_MODULE_DIR': builddir / 'modules',
|
||||
'WIREPLUMBER_CONFIG_DIR': srcdir / 'src' / 'config',
|
||||
'PIPEWIRE_CONFIG_DIR': srcdir / 'src' / 'config',
|
||||
'WIREPLUMBER_DATA_DIR': srcdir / 'src',
|
||||
})
|
||||
|
||||
|
|
|
|||
19
src/main.c
19
src/main.c
|
|
@ -529,7 +529,7 @@ main (gint argc, gchar **argv)
|
|||
g_autoptr (GOptionContext) context = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
g_autoptr (WpProperties) properties = NULL;
|
||||
g_autofree gchar *config_file_path = NULL;
|
||||
const gchar *conf_env;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
setlocale (LC_NUMERIC, "C");
|
||||
|
|
@ -555,20 +555,13 @@ main (gint argc, gchar **argv)
|
|||
if (!config_file)
|
||||
config_file = "wireplumber.conf";
|
||||
|
||||
config_file_path = wp_find_file (
|
||||
WP_LOOKUP_DIR_ENV_CONFIG |
|
||||
WP_LOOKUP_DIR_XDG_CONFIG_HOME |
|
||||
WP_LOOKUP_DIR_ETC |
|
||||
WP_LOOKUP_DIR_PREFIX_SHARE,
|
||||
config_file, NULL);
|
||||
if (config_file_path == NULL) {
|
||||
fprintf (stderr, "Unable to find the required configuration file %s\n",
|
||||
config_file);
|
||||
return WP_EXIT_CONFIG;
|
||||
}
|
||||
/* Forward WIREPLUMBER_CONFIG_DIR to PIPEWIRE_CONFIG_DIR */
|
||||
conf_env = g_getenv ("WIREPLUMBER_CONFIG_DIR");
|
||||
if (conf_env)
|
||||
g_setenv ("PIPEWIRE_CONFIG_DIR", conf_env, TRUE);
|
||||
|
||||
properties = wp_properties_new (
|
||||
PW_KEY_CONFIG_NAME, config_file_path,
|
||||
PW_KEY_CONFIG_NAME, config_file,
|
||||
PW_KEY_APP_NAME, "WirePlumber",
|
||||
"wireplumber.daemon", "true",
|
||||
"wireplumber.export-core", "true",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ if build_daemon
|
|||
subdir('systemd')
|
||||
|
||||
install_subdir('config',
|
||||
install_dir: wireplumber_data_dir,
|
||||
install_dir: pipewire_data_dir,
|
||||
strip_directory : true
|
||||
)
|
||||
install_subdir('scripts',
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ common_test_env = environment({
|
|||
'XDG_CONFIG_HOME': meson.current_build_dir() / '.config',
|
||||
'XDG_STATE_HOME': meson.current_build_dir() / '.local' / 'state',
|
||||
'FILE_MONITOR_DIR': meson.current_build_dir() / '.local' / 'file_monitor',
|
||||
'WIREPLUMBER_CONFIG_DIR': '/invalid',
|
||||
'WIREPLUMBER_DATA_DIR': meson.current_source_dir() / '..' / 'src',
|
||||
'WIREPLUMBER_MODULE_DIR': meson.current_build_dir() / '..' / 'modules',
|
||||
'WIREPLUMBER_DEBUG': '7',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue