diff --git a/data/meson.build b/data/meson.build index 1b7d95b49..40375d00d 100644 --- a/data/meson.build +++ b/data/meson.build @@ -21,7 +21,7 @@ install_data(['metadata.xml'], ) install_data(['90-fwupd-devices.rules'], - install_dir : join_paths(udev.get_pkgconfig_variable('udevdir'), 'rules.d') + install_dir : join_paths(udevdir, 'rules.d') ) con2 = configuration_data() @@ -53,7 +53,7 @@ if get_option('enable-systemd') output : 'fwupd-offline-update.service', configuration : con2, install: true, - install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'), + install_dir: systemdunitdir, ) endif @@ -64,6 +64,6 @@ if get_option('enable-systemd') output : 'fwupd.service', configuration : con2, install: true, - install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'), + install_dir: systemdunitdir, ) endif diff --git a/meson.build b/meson.build index 3d27557b9..7bcb872d1 100644 --- a/meson.build +++ b/meson.build @@ -202,6 +202,16 @@ if get_option('enable-consolekit') conf.set('HAVE_CONSOLEKIT' , '1') endif +systemdunitdir = get_option('with-systemdunitdir') +if systemdunitdir == 'dynamic' + systemdunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') +endif + +udevdir = get_option('with-udevdir') +if udevdir == 'dynamic' + udevdir = udev.get_pkgconfig_variable('udevdir') +endif + gnome = import('gnome') i18n = import('i18n') @@ -267,5 +277,5 @@ if meson.version().version_compare('<0.41.0') endif if get_option('enable-systemd') - meson.add_install_script('meson_post_install.sh', systemd.get_pkgconfig_variable('systemdsystemunitdir'), localstatedir) + meson.add_install_script('meson_post_install.sh', systemdunitdir, localstatedir) endif diff --git a/meson_options.txt b/meson_options.txt index 91f775d76..d039576d9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -15,3 +15,5 @@ option('enable-dummy', type : 'boolean', value : false, description : 'enable th option('enable-gpg', type : 'boolean', value : true, description : 'enable the GPG verification support') option('enable-pkcs7', type : 'boolean', value : true, description : 'enable the PKCS7 verification support') option('with-bootdir', type : 'string', value : '/boot/efi', description : 'Directory for EFI system partition') +option('with-systemdunitdir', type: 'string', value: 'dynamic', description: 'Directory for systemd units') +option('with-udevdir', type: 'string', value: 'dynamic', description: 'Directory for udev rules')