Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

th/build_meson_on_travis #54

Merged
merged 9 commits into from Jan 10, 2018
55 changes: 50 additions & 5 deletions .travis.yml
Expand Up @@ -19,6 +19,8 @@ addons:
- libnl-3-dev
- libnl-route-3-dev
- libnl-genl-3-dev
- libmm-glib-dev
- ppp
- ppp-dev
- libpolkit-gobject-1-dev
- libgnutls-dev
Expand All @@ -44,7 +46,9 @@ addons:
- libnl-3-dev
- libndp-dev
- automake
- dnsmasq
- libcurl4-gnutls-dev
- python3-pip
coverity_scan:
project:
name: NetworkManager/NetworkManager
Expand All @@ -53,13 +57,54 @@ addons:
branch_pattern: .*coverity.*

before_install:
- sudo dbus-uuidgen --ensure
- sudo dbus-uuidgen --ensure
- |
if test "$BUILD_TYPE" == 'meson'; then
git clone https://github.com/ninja-build/ninja &&
pushd ninja &&
./configure.py --bootstrap &&
sudo cp ninja /usr/bin/ &&
popd
sudo pip3 install meson
fi
- sudo chmod o+x /usr/sbin/pppd

script: |
sh autogen.sh --with-systemd-logind=no --enable-more-warnings=no --enable-ifcfg-rh --enable-ifupdown --enable-tests &&
make -j4 &&
./contrib/travis/travis-check.sh
script:
- |
if test "$BUILD_TYPE" == 'meson'; then
meson build \
\
-D ld_gc=false \
-D session_tracking=no \
-D systemdsystemunitdir=no \
-D systemd_journal=false \
-D selinux=false \
-D libaudit=no \
-D libpsl=false \
-D vapi=false \
-D introspection=false \
-D qt=false \
\
-D docs=true \
\
-D ifcfg_rh=false \
-D ibft=true \
-D ifupdown=true \
&&
ninja -C build &&
ninja -C build test
fi
- |
if test "$BUILD_TYPE" == 'autotools'; then
git clean -fdx &&
./autogen.sh --with-systemd-logind=no --enable-more-warnings=no --enable-ifcfg-rh --enable-config-plugin-ibft --enable-ifupdown --enable-tests &&
make -j4 &&
./contrib/travis/travis-check.sh
fi

env:
matrix:
- BUILD_TYPE=autotools
- BUILD_TYPE=meson
global:
secure: K36MXkcsuDZ0msuEj5zHMmHfv6O725lsXuFdP6AJ3rYWKuLYE1+iNLgIRndNWDK9ckkNQFaCxDY4Z/NCfCYQTGAS9oXR5AwNqNbhOq8XrqdaZ2GX35sob8Tp4B3IsoREkN/UbIkXQKYlA5rUhgtSifUg3EwfeOiFvnLCwHcp0rYHnvT/jaq5vodBbA1jChjezcMHsp43kvPXHpybKRkipb9EzV/V3VtDLLWh9WQBvQNawpsHnT+MXSke1yU1zfNMyD9XiD7VDzCwaTs6LzjoFBLc86QS5U/9W72s0rFe6SbecntQHftknRzSrGiJDNe64wDZN/Wxq1MHxEOFCwDi6vcSwQ+RoTdhyshhfPVY2Mm5soj2w7Dx43Cz0dDZDCMhu5xxzFAFgkieJSfwXbuxga0ds58Ph8MgtDSp3fBRewZwI+vMuzl7a1hGkcqJojrm1lfgAKbNgrNUzQRwbVYAyrpa6/vCbd6ZH4PEtITwLaRf2mz8PG71xiMQguDDDXS8WF0U7Looe+G9ybAUwDS5hqHfeP+3q6bfN5Sg5Zs5QkBIN5LZbeWbPYldOEEDTvo3VI7e84bk7U5qEoUKc0w/tqVF1B5KgNUq6nIkCkmoBx8RFnmjpOHh99IfeRG9nQTRpCaEDvAM4fcRzITzId8dIIfAW/45P3ozzfz/HYiie+o=
7 changes: 3 additions & 4 deletions clients/cli/meson.build
Expand Up @@ -31,10 +31,9 @@ cflags = clients_cflags + [
'-DNMCLI_LOCALEDIR="@0@"'.format(nm_localedir)
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]

if enable_polkit_agent
sources += nm_polkit_listener
Expand Down
7 changes: 3 additions & 4 deletions clients/meson.build
Expand Up @@ -14,10 +14,9 @@ cflags = clients_cflags + [
'-DG_LOG_DOMAIN="@0@"'.format(name),
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]

executable(
name,
Expand Down
7 changes: 3 additions & 4 deletions clients/tui/meson.build
Expand Up @@ -61,10 +61,9 @@ deps += [
libnmt_newt_dep
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]

executable(
name,
Expand Down
7 changes: 3 additions & 4 deletions dispatcher/meson.build
Expand Up @@ -54,10 +54,9 @@ sources += gnome.gdbus_codegen(
namespace: 'NMDBus'
)

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]

executable(
name,
Expand Down
18 changes: 10 additions & 8 deletions docs/api/meson.build
Expand Up @@ -3,14 +3,16 @@ doc_module = nm_name
settings = 'settings-spec'
output = settings + '.xml'

settings_xml = custom_target(
output,
input: nm_settings_docs,
output: output,
command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), settings + '.xsl'), '@INPUT@'],
# FIXME: there is no target depending on this, so it will not be built
build_by_default: true
)
if enable_introspection
settings_xml = custom_target(
output,
input: nm_settings_docs,
output: output,
command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), settings + '.xsl'), '@INPUT@'],
# FIXME: there is no target depending on this, so it will not be built
build_by_default: true
)
endif

configure_file(
input: version_xml + '.in',
Expand Down
14 changes: 6 additions & 8 deletions libnm-glib/meson.build
Expand Up @@ -102,10 +102,9 @@ deps = common_deps + [libnm_util_dep]

symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]

libnm_glib_vpn = shared_library(
'nm-glib-vpn',
Expand Down Expand Up @@ -195,10 +194,9 @@ deps = common_deps + [

symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib.ver')

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]

libnm_glib = shared_library(
'nm-glib',
Expand Down
5 changes: 3 additions & 2 deletions libnm-glib/tests/meson.build
Expand Up @@ -7,8 +7,9 @@ deps = [
]

test_units = [
'test-nm-client',
'test-remote-settings-client'
# FIXME: these tests currently fail
#'test-nm-client',
#'test-remote-settings-client'
]

foreach test_unit: test_units
Expand Down
7 changes: 3 additions & 4 deletions libnm-util/meson.build
Expand Up @@ -110,10 +110,9 @@ cflags = common_cflags + [

symbol_map = join_paths(meson.current_source_dir(), 'libnm-util.ver')

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]

libnm_util = shared_library(
'nm-util',
Expand Down
18 changes: 8 additions & 10 deletions libnm/meson.build
Expand Up @@ -2,13 +2,7 @@ libnm_inc = include_directories('.')

sources = files('nm-libnm-utils.c')

if have_fake_typelibs
subdir('fake-typelib')
endif

deps = [
# FIXME: this makes GIR mandatory?
gir_dep,
libnmdbus_dep,
shared_dep
]
Expand All @@ -19,6 +13,11 @@ cflags = [
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
]

if have_fake_typelibs
deps += [ gir_dep ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Square brackets are not necessary when adding a dependency to a list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by commit 98b4653

subdir('fake-typelib')
endif

libnm_utils = static_library(
'nm-utils',
sources: sources,
Expand Down Expand Up @@ -146,10 +145,9 @@ deps = [

symbol_map = join_paths(meson.current_source_dir(), 'libnm.ver')

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]

libnm = shared_library(
'nm',
Expand Down
22 changes: 9 additions & 13 deletions meson.build
Expand Up @@ -165,14 +165,9 @@ endif
add_project_arguments(common_flags, language: 'c')
add_project_link_arguments(common_ldflags, language: 'c')

ldflag = '-Wl,--version-script'
have_version_script = host_machine.system().contains('linux') and cc.has_argument(ldflag)

if have_version_script
linker_script_binary = join_paths(meson.source_root(), 'linker-script-binary.ver')
linker_script_devices = join_paths(meson.source_root(), 'linker-script-devices.ver')
linker_script_settings = join_paths(meson.source_root(), 'linker-script-settings.ver')
endif
linker_script_binary = join_paths(meson.source_root(), 'linker-script-binary.ver')
linker_script_devices = join_paths(meson.source_root(), 'linker-script-devices.ver')
linker_script_settings = join_paths(meson.source_root(), 'linker-script-settings.ver')

uuid_dep = dependency('uuid')
libelogind_dep = dependency('libelogind', version: '>= 219', required: false)
Expand Down Expand Up @@ -240,9 +235,9 @@ endif

enable_ifcfg_rh = get_option('ifcfg_rh') or (distro == 'redhat')
enable_ifupdown = get_option('ifupdown') or (distro == 'debian')
enable_ibft = get_option('ibft') or enable_ifcfg_rh

enable_config_plugin_ibft = get_option('config_plugin_ibft')
config_h.set10('WITH_SETTINGS_PLUGIN_IBFT', enable_config_plugin_ibft)
config_h.set10('WITH_SETTINGS_PLUGIN_IBFT', enable_ibft)

config_plugins_default = get_option('config_plugins_default')
if config_plugins_default == ''
Expand All @@ -256,7 +251,7 @@ if config_plugins_default == ''
config_plugins += ['ifupdown']
endif

if enable_config_plugin_ibft
if enable_ibft
config_plugins += ['ibft']
endif

Expand Down Expand Up @@ -402,6 +397,8 @@ session_tracking = get_option('session_tracking')
session_trackers = []
enable_session_tracking = (session_tracking != 'no')

enable_consolekit = get_option('consolekit')

if enable_session_tracking
if session_tracking == 'systemd'
logind_dep = libsystemd_dep
Expand All @@ -418,7 +415,6 @@ if enable_session_tracking
config_h.set('SESSION_TRACKING_ELOGIND', true)
endif

enable_consolekit = get_option('consolekit')
if enable_consolekit
session_trackers += 'consolekit'
config_h.set_quoted('CKDB_PATH', '/var/run/ConsoleKit/database')
Expand Down Expand Up @@ -981,7 +977,7 @@ output += ' libnm-glib: ' + enable_libnm_glib.to_string() + '\n'
output += ' nmcli: ' + enable_nmcli.to_string() + '\n'
output += ' nmtui: ' + enable_nmtui.to_string() + '\n'
output += '\nConfiguration_plugins (main.plugins=' + config_plugins_default + ')\n'
output += ' ibft: ' + enable_config_plugin_ibft.to_string() + '\n'
output += ' ibft: ' + enable_ibft.to_string() + '\n'
output += ' ifcfg-rh: ' + enable_ifcfg_rh.to_string() + '\n'
output += ' ifupdown: ' + enable_ifupdown.to_string() + '\n'
output += '\nHandlers for /etc/resolv.conf:\n'
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Expand Up @@ -44,7 +44,7 @@ option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5

# configuration plugins
option('config_plugins_default', type: 'string', value: '', description: 'Default configuration option for main.plugins setting, used as fallback if the configuration option is unset')
option('config_plugin_ibft', type: 'boolean', value: true, description: 'enable ibft configuration plugin')
option('ibft', type: 'boolean', value: false, description: 'enable ibft configuration plugin')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple whitespaces in front of type that would be nice to remove.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the white space is intentional, to vertically align with the neighbouring lines, that do something similar.

option('ifcfg_rh', type: 'boolean', value: false, description: 'enable ifcfg-rh configuration plugin (Fedora/RHEL)')
option('ifupdown', type: 'boolean', value: false, description: 'enable ifupdown configuration plugin (Debian/Ubuntu)')

Expand Down
7 changes: 3 additions & 4 deletions src/devices/adsl/meson.build
Expand Up @@ -9,10 +9,9 @@ deps = [
nm_dep
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]

libnm_device_plugin_adsl = shared_module(
'nm-device-plugin-adsl',
Expand Down
7 changes: 3 additions & 4 deletions src/devices/bluetooth/meson.build
Expand Up @@ -14,10 +14,9 @@ deps = [
nm_dep
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]

if enable_bluez5_dun
sources += files('nm-bluez5-dun.c')
Expand Down
7 changes: 3 additions & 4 deletions src/devices/ovs/meson.build
Expand Up @@ -12,10 +12,9 @@ deps = [
nm_dep
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]

libnm_device_plugin_ovs = shared_module(
'nm-device-plugin-ovs',
Expand Down
7 changes: 3 additions & 4 deletions src/devices/team/meson.build
Expand Up @@ -10,10 +10,9 @@ deps = [
nm_dep
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]

libnm_device_plugin_team = shared_module(
'nm-device-plugin-team',
Expand Down
7 changes: 3 additions & 4 deletions src/devices/wifi/meson.build
Expand Up @@ -21,10 +21,9 @@ deps = [
nm_dep
]

ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]

libnm_device_plugin_wifi = shared_module(
'nm-device-plugin-wifi',
Expand Down