summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÍñigo Huguet <inigohuguet@hotmail.com>2024-04-04 08:13:55 +0000
committerÍñigo Huguet <inigohuguet@hotmail.com>2024-04-04 08:13:55 +0000
commitad6fd1955d1932f3cacab1b9efb2250201d2f97e (patch)
tree3aa199ddcbd06d6684dea53a6763b2df8efd75db
parentc6a8a5854850a1c082b542bfce8102ffa46d648f (diff)
parentded7b78a7b497c51cf2384cef556c21472678d0c (diff)
merge: branch 'ih/meson_deprecations'
meson: bump minimum version to 0.51 and remove usages of deprecated features https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1909
-rw-r--r--examples/C/qt/meson.build2
-rw-r--r--introspection/meson.build10
-rw-r--r--man/meson.build6
-rw-r--r--meson.build63
-rw-r--r--src/core/devices/wwan/meson.build3
-rw-r--r--src/libnm-client-impl/meson.build8
-rw-r--r--src/libnm-client-impl/tests/meson.build4
-rw-r--r--src/libnmc-setting/meson.build8
-rw-r--r--src/tests/client/meson.build4
9 files changed, 64 insertions, 44 deletions
diff --git a/examples/C/qt/meson.build b/examples/C/qt/meson.build
index 8b905bd61d..18f136e86a 100644
--- a/examples/C/qt/meson.build
+++ b/examples/C/qt/meson.build
@@ -8,7 +8,7 @@ examples = [
moc = find_program('moc-qt4', required: false)
if not moc.found()
- moc = qt_core_dep.get_pkgconfig_variable('moc_location')
+ moc = qt_core_dep.get_variable(pkgconfig: 'moc_location')
endif
example = 'monitor-nm-running'
diff --git a/introspection/meson.build b/introspection/meson.build
index 77479277ac..81afa7d674 100644
--- a/introspection/meson.build
+++ b/introspection/meson.build
@@ -80,14 +80,8 @@ foreach iface: ifaces
endif
content_files += dbus_iface_xml_path
-
- # res is an array only since 0.46. Documentation won't work with
- # older versions
- if meson.version().version_compare('>= 0.46.0')
- introspection_files += [ [res[2], dbus_iface_xml_path] ]
- headers += res[1]
- endif
-
+ introspection_files += [ [res[2], dbus_iface_xml_path] ]
+ headers += res[1]
endforeach
install_data(
diff --git a/man/meson.build b/man/meson.build
index f0113cd5d3..56f52bb4b3 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -62,7 +62,7 @@ foreach man: mans
endforeach
if enable_introspection
- merge_cmd = join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-merge.py')
+ merge_cmd = files(source_root / 'tools' / 'generate-docs-nm-settings-docs-merge.py')
name = 'dbus'
nm_settings_docs_xml_dbus = custom_target(
@@ -70,7 +70,7 @@ if enable_introspection
input: [merge_cmd, nm_property_infos_xml[name], nm_settings_docs_xml_gir[name]],
output: 'nm-settings-docs-' + name + '.xml',
command: [
- python.path(),
+ python_path,
merge_cmd,
'@OUTPUT@',
nm_property_infos_xml[name],
@@ -84,7 +84,7 @@ if enable_introspection
input: [merge_cmd, nm_property_infos_xml[name], gen_metadata_nm_settings_nmcli_xml, nm_settings_docs_xml_gir[name]],
output: 'nm-settings-docs-' + name + '.xml',
command: [
- python.path(),
+ python_path,
merge_cmd,
'@OUTPUT@',
'--only-properties-from',
diff --git a/meson.build b/meson.build
index b39b4cf453..66142d6b09 100644
--- a/meson.build
+++ b/meson.build
@@ -13,7 +13,7 @@ project(
'c_std=gnu11',
'warning_level=2' # value "2" will add "-Wall" and "-Wextra" to the compiler flags
],
- meson_version: '>= 0.47.2',
+ meson_version: '>= 0.51.0',
)
nm_name = meson.project_name()
@@ -77,7 +77,7 @@ pkg = import('pkgconfig')
source_root = meson.current_source_dir()
build_root = meson.current_build_dir()
-po_dir = join_paths(meson.source_root(), 'po')
+po_dir = source_root / 'po'
top_inc = include_directories('.')
@@ -253,7 +253,7 @@ config_h.set10('WITH_JANSSON', jansson_dep.found())
jansson_msg = 'no'
if jansson_dep.found()
- jansson_libdir = jansson_dep.get_pkgconfig_variable('libdir')
+ jansson_libdir = jansson_dep.get_variable(pkgconfig: 'libdir')
res = run_command(find_program('eu-readelf', 'readelf'), '-d', join_paths(jansson_libdir, 'libjansson.so'), check: false)
jansson_soname = ''
foreach line: res.stdout().split('\n')
@@ -362,7 +362,7 @@ install_systemdunitdir = (systemd_systemdsystemunitdir != 'no')
if install_systemdunitdir and systemd_systemdsystemunitdir == ''
assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
- systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir', define_variable: ['rootprefix', nm_prefix])
+ systemd_systemdsystemunitdir = systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define: ['rootprefix', nm_prefix])
endif
enable_systemd_journal = get_option('systemd_journal')
@@ -495,7 +495,7 @@ endif
enable_polkit = get_option('polkit')
if enable_polkit
# FIXME: policydir should be relative to `datadir`, not `prefix`. Fixed in https://gitlab.freedesktop.org/polkit/polkit/merge_requests/2
- polkit_gobject_policydir = dependency('polkit-gobject-1').get_pkgconfig_variable('policydir', define_variable: ['prefix', nm_prefix])
+ polkit_gobject_policydir = dependency('polkit-gobject-1').get_variable(pkgconfig: 'policydir', pkgconfig_define: ['prefix', nm_prefix])
endif
config_auth_polkit_default = get_option('config_auth_polkit_default')
@@ -545,11 +545,11 @@ endif
dbus_conf_dir = get_option('dbus_conf_dir')
if dbus_conf_dir == ''
assert(dbus_dep.found(), 'D-Bus required but not found, please provide a valid system bus config dir')
- dbus_conf_dir = join_paths(dbus_dep.get_pkgconfig_variable('datarootdir', define_variable: ['prefix', nm_prefix]), 'dbus-1', 'system.d')
+ dbus_conf_dir = join_paths(dbus_dep.get_variable(pkgconfig: 'datarootdir', pkgconfig_define: ['prefix', nm_prefix]), 'dbus-1', 'system.d')
endif
-dbus_interfaces_dir = dbus_dep.get_pkgconfig_variable('interfaces_dir', define_variable: ['datadir', nm_datadir])
-dbus_system_bus_services_dir = dbus_dep.get_pkgconfig_variable('system_bus_services_dir', define_variable: ['datadir', nm_datadir])
+dbus_interfaces_dir = dbus_dep.get_variable(pkgconfig: 'interfaces_dir', pkgconfig_define: ['datadir', nm_datadir])
+dbus_system_bus_services_dir = dbus_dep.get_variable(pkgconfig: 'system_bus_services_dir', pkgconfig_define: ['datadir', nm_datadir])
enable_firewalld_zone = get_option('firewalld_zone')
config_h.set10('WITH_FIREWALLD_ZONE', enable_firewalld_zone)
@@ -571,7 +571,11 @@ if enable_ppp
if pppd_path == ''
pppd = find_program('pppd', '/sbin/pppd', '/usr/sbin/pppd', required: false)
assert(pppd.found(), 'pppd required but not found, please provide a valid pppd path or use -Dppp=false to disable it')
- pppd_path = pppd.path()
+ if meson.version().version_compare('>= 0.55')
+ pppd_path = pppd.full_path()
+ else
+ pppd_path = pppd.path()
+ endif
endif
config_h.set_quoted('PPPD_PATH', pppd_path)
@@ -591,7 +595,7 @@ if enable_modem_manager
mobile_broadband_provider_info_database = get_option('mobile_broadband_provider_info_database')
if mobile_broadband_provider_info_database == ''
- mobile_broadband_provider_info_database = dependency('mobile-broadband-provider-info').get_pkgconfig_variable('database')
+ mobile_broadband_provider_info_database = dependency('mobile-broadband-provider-info').get_variable(pkgconfig: 'database')
endif
config_h.set_quoted('MOBILE_BROADBAND_PROVIDER_INFO_DATABASE', mobile_broadband_provider_info_database)
endif
@@ -625,7 +629,11 @@ foreach client : [ 'dhclient', 'dhcpcd', 'dhcpcanon' ]
'/usr/local/sbin/' + client,
required : false)
if client_prog.found()
- client_path = client_prog.path()
+ if meson.version().version_compare('>= 0.55')
+ client_path = client_prog.full_path()
+ else
+ client_path = client_prog.path()
+ endif
else
client_path = '/usr/sbin/' + client
message('@0@ not found, assume path @1@'.format(client, client_path))
@@ -667,7 +675,11 @@ foreach prog_name : ['resolvconf', 'netconfig']
'/usr/local/sbin/' + prog_name,
required : false)
if prog.found()
- prog_path = prog.path()
+ if meson.version().version_compare('>= 0.55')
+ prog_path = prog.full_path()
+ else
+ prog_path = prog.path()
+ endif
else
prog_enable = false
endif
@@ -705,7 +717,11 @@ foreach prog : progs
search_paths += (path + '/' + prog[0])
endforeach
exe = find_program(search_paths, required : false)
- path = exe.found() ? exe.path() : prog[2]
+ if meson.version().version_compare('>= 0.55')
+ path = exe.found() ? exe.full_path() : prog[2]
+ else
+ path = exe.found() ? exe.path() : prog[2]
+ endif
endif
name = prog[0].to_upper() + '_PATH'
config_h.set_quoted(name, path)
@@ -864,22 +880,32 @@ if enable_valgrind
if valgrind_suppressions_path == ''
valgrind_suppressions_path = join_paths(source_root, 'valgrind.suppressions')
endif
+ if meson.version().version_compare('>= 0.55')
+ valgrind_path = valgrind.full_path()
+ else
+ valgrind_path = valgrind.path()
+ endif
endif
test_args = [
'--called-from-make',
build_root,
'',
- enable_valgrind ? valgrind.path() : '',
+ enable_valgrind ? valgrind_path : '',
enable_valgrind ? valgrind_suppressions_path : '',
'--launch-dbus=auto',
]
-py3 = import('python3')
-python = py3.find_python()
+python_mod = import('python')
+python = python_mod.find_installation('python3', required: false)
if python.found()
- config_h.set_quoted('TEST_NM_PYTHON', python.path())
+ if meson.version().version_compare('>= 0.55')
+ python_path = python.full_path()
+ else
+ python_path = python.path()
+ endif
+ config_h.set_quoted('TEST_NM_PYTHON', python_path)
endif
data_conf = configuration_data()
@@ -976,7 +1002,6 @@ endif
if enable_docs
assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true')
- assert(meson.version().version_compare('>= 0.49.0'), '-Ddocs requires meson >= 0.49')
subdir('man')
subdir('docs')
meson.add_dist_script(
@@ -1113,7 +1138,7 @@ output += ' more-logging: ' + more_logging.to_string() + '\n'
output += ' warning-level: ' + get_option('warning_level') + '\n'
output += ' valgrind: ' + enable_valgrind.to_string()
if enable_valgrind
- output += ' ' + valgrind.path()
+ output += ' ' + valgrind_path
endif
output += '\n'
output += ' code coverage: ' + get_option('b_coverage').to_string() + '\n'
diff --git a/src/core/devices/wwan/meson.build b/src/core/devices/wwan/meson.build
index 37ef738c48..acccb5fd6e 100644
--- a/src/core/devices/wwan/meson.build
+++ b/src/core/devices/wwan/meson.build
@@ -4,7 +4,7 @@ wwan_inc = include_directories('.')
linker_script = join_paths(meson.current_source_dir(), 'libnm-wwan.ver')
-libnm_wwan = shared_module(
+libnm_wwan = shared_library(
'nm-wwan',
sources: files(
'nm-service-providers.c',
@@ -21,6 +21,7 @@ libnm_wwan = shared_module(
link_depends: linker_script,
install: true,
install_dir: nm_plugindir,
+ override_options: ['b_lundef=false'],
)
libnm_wwan_dep = declare_dependency(
diff --git a/src/libnm-client-impl/meson.build b/src/libnm-client-impl/meson.build
index 3f8ce5b1fc..3dd2338a82 100644
--- a/src/libnm-client-impl/meson.build
+++ b/src/libnm-client-impl/meson.build
@@ -177,8 +177,8 @@ if enable_introspection
endif
ld_library_path = meson.current_build_dir() + ld_library_path
- gen_infos_cmd = join_paths(meson.source_root(), 'tools', 'generate-docs-nm-property-infos.py')
- gen_gir_cmd = join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-gir.py')
+ gen_infos_cmd = files(source_root / 'tools' / 'generate-docs-nm-property-infos.py')
+ gen_gir_cmd = files(source_root / 'tools' / 'generate-docs-nm-settings-docs-gir.py')
names = [ 'dbus', 'nmcli', 'keyfile' ]
if enable_ifcfg_rh
@@ -190,7 +190,7 @@ if enable_introspection
input: [gen_infos_cmd, libnm_gir[0]] + libnm_core_settings_sources,
output: 'nm-property-infos-' + name + '.xml',
command: [
- python.path(),
+ python_path,
gen_infos_cmd,
name,
'@OUTPUT@',
@@ -206,7 +206,7 @@ if enable_introspection
'env',
'GI_TYPELIB_PATH=' + gi_typelib_path,
'LD_LIBRARY_PATH=' + ld_library_path,
- python.path(),
+ python_path,
gen_gir_cmd,
'--lib-path', meson.current_build_dir(),
'--gir', libnm_gir[0],
diff --git a/src/libnm-client-impl/tests/meson.build b/src/libnm-client-impl/tests/meson.build
index 0c0e188b77..42e9883e77 100644
--- a/src/libnm-client-impl/tests/meson.build
+++ b/src/libnm-client-impl/tests/meson.build
@@ -50,9 +50,9 @@ if enable_introspection
'check-local-libnm-gir',
python,
args: [
- join_paths(meson.source_root(), 'src', 'libnm-client-impl', 'tests', 'test-gir.py'),
+ join_paths(source_root, 'src', 'libnm-client-impl', 'tests', 'test-gir.py'),
'--gir', libnm_gir[0],
- '--ver', join_paths(meson.source_root(), 'src', 'libnm-client-impl', 'libnm.ver'),
+ '--ver', join_paths(source_root, 'src', 'libnm-client-impl', 'libnm.ver'),
],
)
endif
diff --git a/src/libnmc-setting/meson.build b/src/libnmc-setting/meson.build
index 7fb460dc33..4d5079dfb3 100644
--- a/src/libnmc-setting/meson.build
+++ b/src/libnmc-setting/meson.build
@@ -3,13 +3,13 @@
if enable_docs
assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true')
- merge_cmd = join_paths(meson.source_root(), 'tools', 'generate-docs-nm-settings-docs-merge.py')
+ merge_cmd = files(source_root / 'tools' / 'generate-docs-nm-settings-docs-merge.py')
settings_docs_input_xml = custom_target(
'settings-docs-input.xml',
input: [merge_cmd, nm_settings_docs_xml_gir['nmcli'], nm_property_infos_xml['nmcli']],
output: 'settings-docs-input.xml',
command: [
- python.path(),
+ python_path,
merge_cmd,
'@OUTPUT@',
nm_property_infos_xml['nmcli'],
@@ -17,13 +17,13 @@ if enable_docs
],
)
- gen_cmd = join_paths(meson.source_root(), 'tools', 'generate-docs-settings-docs.py')
+ gen_cmd = files(source_root / 'tools' / 'generate-docs-settings-docs.py')
settings_docs_source = custom_target(
'settings-docs.h',
input: [gen_cmd, settings_docs_input_xml],
output: 'settings-docs.h',
command: [
- python.path(),
+ python_path,
gen_cmd,
'--output', '@OUTPUT@',
'--xml', settings_docs_input_xml
diff --git a/src/tests/client/meson.build b/src/tests/client/meson.build
index 8c36e40559..5686a1c174 100644
--- a/src/tests/client/meson.build
+++ b/src/tests/client/meson.build
@@ -6,7 +6,7 @@ test(
args: [
build_root,
source_root,
- python.path(),
+ python_path,
'--',
'TestNmcli',
],
@@ -23,7 +23,7 @@ if enable_nm_cloud_setup
args: [
build_root,
source_root,
- python.path(),
+ python_path,
'--',
'TestNmCloudSetup',
],