diff --git a/data/builder/meson.build b/data/builder/meson.build index 38c007d07..c7a430c09 100644 --- a/data/builder/meson.build +++ b/data/builder/meson.build @@ -1,3 +1,3 @@ install_data('README.md', - install_dir : join_paths(get_option('localstatedir'), 'lib', 'fwupd', 'builder') + install_dir : join_paths(localstatedir, 'lib', 'fwupd', 'builder') ) diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build index 3f6ecf4a3..9d83749a8 100644 --- a/data/installed-tests/meson.build +++ b/data/installed-tests/meson.build @@ -1,11 +1,7 @@ con2 = configuration_data() con2.set('installedtestsdir', - join_paths(get_option('prefix'), - get_option('datadir'), - 'installed-tests', 'fwupd')) -con2.set('bindir', - join_paths(get_option('prefix'), - get_option('bindir'))) + join_paths(datadir, 'installed-tests', 'fwupd')) +con2.set('bindir', bindir) configure_file( input : 'fwupdmgr.test.in', diff --git a/data/meson.build b/data/meson.build index 1a01c440a..02fda0b72 100644 --- a/data/meson.build +++ b/data/meson.build @@ -8,19 +8,19 @@ if get_option('enable-tests') endif install_data(['daemon.conf'], - install_dir : join_paths(get_option('sysconfdir'), 'fwupd') + install_dir : join_paths(sysconfdir, 'fwupd') ) install_data(['org.freedesktop.fwupd.metainfo.xml'], - install_dir: join_paths(get_option('datadir'), 'metainfo') + install_dir: join_paths(datadir, 'metainfo') ) install_data(['org.freedesktop.fwupd.conf'], - install_dir : join_paths(get_option('sysconfdir'), 'dbus-1', 'system.d') + install_dir : join_paths(sysconfdir, 'dbus-1', 'system.d') ) install_data(['metadata.xml'], - install_dir : join_paths(get_option('datadir'), 'fwupd', 'remotes.d', 'fwupd') + install_dir : join_paths(datadir, 'fwupd', 'remotes.d', 'fwupd') ) install_data(['90-fwupd-devices.rules'], @@ -28,14 +28,10 @@ install_data(['90-fwupd-devices.rules'], ) con2 = configuration_data() -con2.set('libexecdir', - join_paths(get_option('prefix'), - get_option('libexecdir'))) -con2.set('bindir', - join_paths(get_option('prefix'), - get_option('bindir'))) -con2.set('localstatedir', join_paths(get_option('localstatedir'))) -con2.set('datadir', join_paths(get_option('datadir'))) +con2.set('libexecdir', libexecdir) +con2.set('bindir', bindir) +con2.set('localstatedir', localstatedir) +con2.set('datadir', datadir) con2.set('bootdir', get_option('with-bootdir')) con2.set('sysconfdir', default_sysconfdir) @@ -45,7 +41,7 @@ configure_file( output : 'org.freedesktop.fwupd.service', configuration : con2, install: true, - install_dir: join_paths(get_option('datadir'), + install_dir: join_paths(datadir, 'dbus-1', 'system-services'), ) diff --git a/data/pki/meson.build b/data/pki/meson.build index 3c3a8be53..4d4a460cb 100644 --- a/data/pki/meson.build +++ b/data/pki/meson.build @@ -3,13 +3,13 @@ if get_option('enable-gpg') 'GPG-KEY-Hughski-Limited', 'GPG-KEY-Linux-Vendor-Firmware-Service', ], - install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd') + install_dir : join_paths(sysconfdir, 'pki', 'fwupd') ) install_data([ 'GPG-KEY-Linux-Vendor-Firmware-Service', ], - install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd-metadata') + install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata') ) endif @@ -17,12 +17,12 @@ if get_option('enable-pkcs7') install_data([ 'LVFS-CA.pem', ], - install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd') + install_dir : join_paths(sysconfdir, 'pki', 'fwupd') ) install_data([ 'LVFS-CA.pem', ], - install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd-metadata') + install_dir : join_paths(sysconfdir, 'pki', 'fwupd-metadata') ) endif diff --git a/data/remotes.d/meson.build b/data/remotes.d/meson.build index 69d3ef97c..fbed77170 100644 --- a/data/remotes.d/meson.build +++ b/data/remotes.d/meson.build @@ -3,28 +3,28 @@ if get_option('enable-lvfs') 'lvfs.conf', 'lvfs-testing.conf', ], - install_dir : join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d') + install_dir : join_paths(sysconfdir, 'fwupd', 'remotes.d') ) endif install_data('README.md', - install_dir : join_paths(get_option('datadir'), 'fwupd', 'remotes.d', 'vendor', 'firmware') + install_dir : join_paths(datadir, 'fwupd', 'remotes.d', 'vendor', 'firmware') ) # replace @datadir@ con2 = configuration_data() -con2.set('datadir', join_paths(get_option('prefix'), get_option('datadir'))) +con2.set('datadir', datadir) configure_file( input : 'fwupd.conf', output : 'fwupd.conf', configuration : con2, install: true, - install_dir: join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d'), + install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'), ) configure_file( input : 'vendor.conf', output : 'vendor.conf', configuration : con2, install: true, - install_dir: join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d'), + install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'), ) diff --git a/meson.build b/meson.build index 7cc6fe856..e4dc9cce0 100644 --- a/meson.build +++ b/meson.build @@ -223,6 +223,17 @@ if get_option('enable-consolekit') conf.set('HAVE_CONSOLEKIT' , '1') endif +prefix = get_option('prefix') + +bindir = join_paths(prefix, get_option('bindir')) +libdir = join_paths(prefix, get_option('libdir')) +datadir = join_paths(prefix, get_option('datadir')) +libexecdir = join_paths(prefix, get_option('libexecdir')) +sysconfdir = join_paths(prefix, get_option('sysconfdir')) +localstatedir = join_paths(prefix, get_option('localstatedir')) +mandir = join_paths(prefix, get_option('mandir')) +localedir = join_paths(prefix, get_option('localedir')) + systemdunitdir = get_option('with-systemdunitdir') if systemdunitdir == '' and get_option('enable-systemd') systemdunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') @@ -236,21 +247,15 @@ endif gnome = import('gnome') i18n = import('i18n') -plugin_dir = join_paths(get_option('prefix'), - get_option('libdir'), - 'fwupd-plugins-3') +plugin_dir = join_paths(libdir, 'fwupd-plugins-3') -conf.set_quoted('BINDIR', - join_paths(get_option('prefix'), - get_option('bindir'))) -conf.set_quoted('LIBEXECDIR', - join_paths(get_option('prefix'), - get_option('libexecdir'))) +conf.set_quoted('BINDIR', bindir) +conf.set_quoted('LIBEXECDIR', libexecdir) conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE_NAME', meson.project_name()) conf.set_quoted('VERSION', meson.project_version()) -conf.set_quoted('LOCALEDIR', get_option('localedir')) +conf.set_quoted('LOCALEDIR', localedir) configure_file( output : 'config.h', configuration : conf @@ -262,9 +267,6 @@ if default_sysconfdir == 'etc' default_sysconfdir = '/etc' endif -localstatedir = join_paths(get_option('prefix'), - get_option('localstatedir')) - plugin_deps = [] plugin_deps += appstream_glib plugin_deps += gio diff --git a/plugins/dell/meson.build b/plugins/dell/meson.build index a156977c4..0ba593786 100644 --- a/plugins/dell/meson.build +++ b/plugins/dell/meson.build @@ -1,7 +1,7 @@ cargs = ['-DG_LOG_DOMAIN="FuPluginDell"'] install_data(['dell.quirk'], - install_dir: join_paths(get_option('datadir'), 'fwupd', 'quirks.d') + install_dir: join_paths(datadir, 'fwupd', 'quirks.d') ) shared_module('fu_plugin_dell', diff --git a/plugins/dfu/meson.build b/plugins/dfu/meson.build index 817e99f42..dd49358db 100644 --- a/plugins/dfu/meson.build +++ b/plugins/dfu/meson.build @@ -1,7 +1,7 @@ cargs = ['-DG_LOG_DOMAIN="FuPluginDfu"'] install_data(['dfu.quirk'], - install_dir: join_paths(get_option('datadir'), 'fwupd', 'quirks.d') + install_dir: join_paths(datadir, 'fwupd', 'quirks.d') ) dfu = static_library( @@ -84,7 +84,7 @@ executable( ], c_args : cargs, install : true, - install_dir : get_option('bindir') + install_dir : bindir ) if get_option('enable-man') @@ -97,7 +97,7 @@ if get_option('enable-man') '--output', meson.current_build_dir(), ], install : true, - install_dir : join_paths(get_option('mandir'), 'man1'), + install_dir : join_paths(mandir, 'man1'), ) endif diff --git a/policy/meson.build b/policy/meson.build index 4b6734857..ec6002589 100644 --- a/policy/meson.build +++ b/policy/meson.build @@ -1,5 +1,5 @@ install_data('org.freedesktop.fwupd.rules', - install_dir : join_paths(get_option('datadir'), 'polkit-1', 'rules.d')) + install_dir : join_paths(datadir, 'polkit-1', 'rules.d')) #meson 0.41.0 added support for data_dirs argument if meson.version().version_compare('>=0.41.0') @@ -9,7 +9,7 @@ if meson.version().version_compare('>=0.41.0') input: 'org.freedesktop.fwupd.policy.in', output: 'org.freedesktop.fwupd.policy', install: true, - install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') , + install_dir: join_paths(datadir, 'polkit-1', 'actions') , type: 'xml', po_dir: join_paths(meson.source_root(), 'po') ) @@ -19,7 +19,7 @@ if meson.version().version_compare('>=0.41.0') input: 'org.freedesktop.fwupd.policy.in', output: 'org.freedesktop.fwupd.policy', install: true, - install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') , + install_dir: join_paths(datadir, 'polkit-1', 'actions') , type: 'xml', data_dirs: join_paths(meson.source_root(), 'policy'), po_dir: join_paths(meson.source_root(), 'po') @@ -38,6 +38,6 @@ else '-d', join_paths(meson.source_root(), 'po'), '-o', '@OUTPUT@'], install: true, - install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') + install_dir: join_paths(datadir, 'polkit-1', 'actions') ) endif diff --git a/src/meson.build b/src/meson.build index 3d35dd876..57852b4d1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,7 +1,7 @@ cargs = ['-DG_LOG_DOMAIN="Fu"'] install_data(['org.freedesktop.fwupd.xml'], - install_dir : join_paths(get_option('datadir'), 'dbus-1', 'interfaces') + install_dir : join_paths(datadir, 'dbus-1', 'interfaces') ) keyring_deps = [] @@ -51,7 +51,7 @@ libfwupdprivate = static_library( cargs, '-DLOCALSTATEDIR="' + localstatedir + '"', '-DSYSFSFIRMWAREDIR="/sys/firmware"', - '-DFWUPDDATADIR="' + join_paths(get_option('prefix'), get_option('datadir'), 'fwupd') + '"', + '-DFWUPDDATADIR="' + join_paths(datadir, 'fwupd') + '"', '-DFU_OFFLINE_DESTDIR=""', ], ) @@ -85,7 +85,7 @@ fwupdmgr = executable( '-DFU_OFFLINE_DESTDIR=""', ], install : true, - install_dir : get_option('bindir') + install_dir : bindir ) if get_option('enable-man') @@ -102,7 +102,7 @@ if get_option('enable-man') '--version-string', fwupd_version, ], install : true, - install_dir : join_paths(get_option('mandir'), 'man1'), + install_dir : join_paths(mandir, 'man1'), ) endif @@ -158,12 +158,12 @@ executable( '-DPLUGINDIR="' + plugin_dir + '"', '-DSYSFSFIRMWAREDIR="/sys/firmware"', '-DSYSCONFDIR="' + default_sysconfdir + '"', - '-DFWUPDDATADIR="' + join_paths(get_option('prefix'), get_option('datadir'), 'fwupd') + '"', + '-DFWUPDDATADIR="' + join_paths(datadir, 'fwupd') + '"', '-DFWUPDCONFIGDIR="' + join_paths(default_sysconfdir, 'fwupd') + '"', '-DFU_OFFLINE_DESTDIR=""', ], install : true, - install_dir : join_paths(get_option('libexecdir'), 'fwupd') + install_dir : join_paths(libexecdir, 'fwupd') ) if get_option('enable-tests')