diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2017-07-25 22:28:38 +0200 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-01-17 20:09:35 -0200 |
commit | 32edd6789e9d60b1e371660bdbb3c4a0671bd714 (patch) | |
tree | dc6db5385f0dded9a7c3720eaabef14c17e6ec15 /shell | |
parent | d7012d033782869be146e876c7f10d451a906058 (diff) | |
download | gnome-control-center-32edd6789e9d60b1e371660bdbb3c4a0671bd714.tar.gz |
build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.
https://bugzilla.gnome.org/show_bug.cgi?id=785414
Diffstat (limited to 'shell')
-rw-r--r-- | shell/Makefile.am | 4 | ||||
-rw-r--r-- | shell/appdata/Makefile.am | 4 | ||||
-rw-r--r-- | shell/appdata/meson.build | 10 | ||||
-rw-r--r-- | shell/completions/meson.build | 12 | ||||
-rw-r--r-- | shell/meson.build | 134 |
5 files changed, 162 insertions, 2 deletions
diff --git a/shell/Makefile.am b/shell/Makefile.am index 7f274a1e7..2adc5f279 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -144,7 +144,9 @@ EXTRA_DIST = \ panel-list.ui \ window.ui \ $(resource_files) \ - list-panel.sh + list-panel.sh \ + meson.build \ + completions/meson.build CLEANFILES = $(BUILT_SOURCES) $(completion_DATA) $(servicefile_DATA) DISTCLEANFILES = gnome-control-center.desktop gnome-control-center.desktop.in diff --git a/shell/appdata/Makefile.am b/shell/appdata/Makefile.am index 51bc83bb7..29e3d2be6 100644 --- a/shell/appdata/Makefile.am +++ b/shell/appdata/Makefile.am @@ -6,7 +6,9 @@ appdata_in_files = \ test: -EXTRA_DIST = $(appdata_in_files) +EXTRA_DIST = \ + $(appdata_in_files) \ + meson.build CLEANFILES = \ gnome-control-center.appdata.xml diff --git a/shell/appdata/meson.build b/shell/appdata/meson.build new file mode 100644 index 000000000..d480daa13 --- /dev/null +++ b/shell/appdata/meson.build @@ -0,0 +1,10 @@ +appdata = 'gnome-control-center.appdata.xml' + +custom_target( + appdata, + input: appdata + '.in', + output: appdata, + command: intltool_xml_cmd, + install: true, + install_dir: join_paths(control_center_datadir, 'metainfo') +) diff --git a/shell/completions/meson.build b/shell/completions/meson.build new file mode 100644 index 000000000..951d0607d --- /dev/null +++ b/shell/completions/meson.build @@ -0,0 +1,12 @@ +completion_conf = configuration_data() +completion_conf.set('PANELS', ' '.join(panels_list)) + +desktop = 'gnome-control-center' + +desktop_in = configure_file( + input: desktop + '.in', + output: desktop, + configuration: completion_conf, + install: true, + install_dir: join_paths(control_center_datadir, 'bash-completion', 'completions') +) diff --git a/shell/meson.build b/shell/meson.build new file mode 100644 index 000000000..91dee5b1f --- /dev/null +++ b/shell/meson.build @@ -0,0 +1,134 @@ +subdir('appdata') +subdir('completions') + +service_conf = configuration_data() +service_conf.set('bindir', control_center_bindir) + +service = 'org.gnome.ControlCenter.service' + +configure_file( + input: service + '.in', + output: service, + install: true, + install_dir: join_paths(control_center_datadir, 'dbus-1', 'services'), + configuration: service_conf +) + +desktop = 'gnome-control-center.desktop' + +desktop_in = configure_file( + input: desktop + '.in.in', + output: desktop + '.in', + configuration: desktop_conf +) + +custom_target( + desktop, + input: desktop_in, + output: desktop, + command: intltool_desktop_cmd, + install: true, + install_dir: control_center_desktopdir +) + +cflags = ['-DGNOMELOCALEDIR="@0@"'.format(control_center_localedir)] + +libshell = static_library( + 'shell', + sources: 'cc-shell-model.c', + include_directories: [top_inc, common_inc], + dependencies: common_deps, + c_args: cflags +) + +common_sources = files( + 'cc-application.c', + 'cc-editable-entry.c', + 'cc-hostname-entry.c', + 'cc-panel-loader.c', + 'cc-panel.c', + 'cc-shell-category-view.c', + 'cc-shell-item-view.c', + 'cc-shell-log.c', + 'cc-shell.c', + 'hostname-helper.c', + 'list-box-helper.c', + 'main.c' +) + +resource_data = files( + 'help-overlay.ui', + 'panel-list.ui', + 'window.ui' +) + +common_sources += gnome.compile_resources( + 'resources', + meson.project_name() + '.gresource.xml', + dependencies: resource_data, + export: true +) + +sources = common_sources + files( + 'cc-panel-list.c', + 'cc-window.c' +) + +shell_deps = common_deps + [ + libdevice_dep, + libgd_dep, + liblanguage_dep, + polkit_gobject_dep, + x11_dep +] + +if enable_cheese + shell_deps += cheese_deps +endif + +if enable_wacom + shell_deps += wacom_deps +endif + +executable( + meson.project_name(), + sources, + include_directories: top_inc, + dependencies: shell_deps, + c_args: cflags, + link_with: panels_libs + [libshell], + install: true +) + +# Because it is confusing and somewhat problematic to directly add and compile +# cc-panel-loader.o by another directory (i.e. the shell search provider), we +# have to create a library and link it there, just like libshell.la. +libpanel_loader = static_library( + 'panel_loader', + sources: 'cc-panel-loader.c', + include_directories: top_inc, + dependencies: common_deps, + c_args: cflags + ['-DCC_PANEL_LOADER_NO_GTYPES'] +) + +test_unit = 'test-hostname' + +sources = files( + 'hostname-helper.c', + test_unit + '.c' +) + +cflags += [ + '-DTEST_SRCDIR="@0@"'.format(meson.current_source_dir()), + '-DTEST_TOPSRCDIR="@0@"'.format(meson.source_root()) +] + +exe = executable( + test_unit, + sources, + include_directories: top_inc, + dependencies: common_deps, + c_args: cflags +) + +test(test_unit, exe) |