summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2023-07-21 11:05:03 +0800
committerzhuyaliang <[email protected]>2023-07-21 11:05:03 +0800
commit6b49a8c0d49deae5d079a342b4843f8dcb856410 (patch)
tree38b635fadad4ecb7deaebf46329e6b18a73836c2
parentd39bd997538bcae87637a8f98f67296bd622b3e5 (diff)
downloadmate-netbook-6b49a8c0d49deae5d079a342b4843f8dcb856410.tar.bz2
mate-netbook-6b49a8c0d49deae5d079a342b4843f8dcb856410.tar.xz
Add meson compilation supportmeson
-rw-r--r--mate-window-picker-applet/meson.build62
-rw-r--r--maximus/maximus-bind.c3
-rw-r--r--maximus/meson.build39
-rw-r--r--meson.build63
-rw-r--r--po/meson.build1
5 files changed, 168 insertions, 0 deletions
diff --git a/mate-window-picker-applet/meson.build b/mate-window-picker-applet/meson.build
new file mode 100644
index 0000000..d138a2c
--- /dev/null
+++ b/mate-window-picker-applet/meson.build
@@ -0,0 +1,62 @@
+po_dir = join_paths(meson.source_root(), 'po')
+
+applet_sources = [
+ 'applet.c',
+ 'task-item.c',
+ 'task-list.c',
+ 'task-title.c',
+]
+
+executable('mate-window-picker-applet', applet_sources,
+ include_directories: config_inc,
+ dependencies: netbook_deps,
+ install_dir: privexecdir,
+ install: true)
+
+# .service files
+
+service_data = configuration_data()
+service_data.set('LOCATION', join_paths(prefix, get_option('libexecdir'), 'mate-window-picker-applet'))
+
+configure_file(
+ input : 'org.mate.panel.applet.MateWindowPickerFactory.service.in',
+ output : 'org.mate.panel.applet.MateWindowPickerFactory.service',
+ configuration : service_data,
+ install : true,
+ install_dir : join_paths(datadir, 'dbus-1/services')
+)
+
+# .gschema file
+
+schema_data = configuration_data()
+schema_data.set('GETTEXT_PACKAGE', meson.project_name())
+configure_file(
+ input : 'org.mate.panel.applet.mate-window-picker-applet.gschema.xml.in',
+ output : 'org.mate.panel.applet.mate-window-picker-applet.gschema.xml',
+ configuration : schema_data,
+ install : true,
+ install_dir : join_paths(datadir, 'glib-2.0', 'schemas')
+)
+
+# .desktop file
+
+desktop_data = configuration_data()
+desktop_data.set('LOCATION', join_paths(prefix, get_option('libexecdir'), 'mate-window-picker-applet'))
+desktop_in_file = configure_file(
+ input : 'org.mate.panel.MateWindowPicker.mate-panel-applet.desktop.in.in',
+ output : 'org.mate.panel.MateWindowPicker.mate-panel-applet.desktop.in',
+ configuration : desktop_data
+)
+
+i18n.merge_file(
+ input : desktop_in_file,
+ output : 'org.mate.panel.MateWindowPicker.mate-panel-applet.desktop',
+ type : 'desktop',
+ po_dir : po_dir,
+ install : true,
+ install_dir : join_paths(matedir, 'applets')
+)
+
+install_data('mate-window-picker-applet-menu.xml',
+ install_dir : join_paths(matedir, 'ui')
+)
diff --git a/maximus/maximus-bind.c b/maximus/maximus-bind.c
index cb4b860..893e889 100644
--- a/maximus/maximus-bind.c
+++ b/maximus/maximus-bind.c
@@ -18,6 +18,9 @@
*
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <string.h>
diff --git a/maximus/meson.build b/maximus/meson.build
new file mode 100644
index 0000000..349942c
--- /dev/null
+++ b/maximus/meson.build
@@ -0,0 +1,39 @@
+man1_dir = join_paths(maximus_mandir, 'man1')
+
+maximus_sources = [
+ 'eggaccelerators.c',
+ 'main.c',
+ 'maximus-app.c',
+ 'maximus-bind.c',
+ 'tomboykeybinder.c',
+ 'xutils.c'
+]
+
+executable('mate-maximus', maximus_sources,
+ include_directories: config_inc,
+ dependencies: netbook_deps,
+ install: true)
+
+# man files
+
+install_data('mate-maximus.1',
+ install_dir : man1_dir
+)
+
+# autostart file
+
+install_data('mate-maximus-autostart.desktop',
+install_dir: join_paths(get_option('prefix'), 'etc', 'xdg', 'autostart')
+)
+
+# .gschema file
+
+schema_data = configuration_data()
+schema_data.set('GETTEXT_PACKAGE', meson.project_name())
+configure_file(
+ input : 'org.mate.maximus.gschema.xml.in',
+ output : 'org.mate.maximus.gschema.xml',
+ configuration : schema_data,
+ install : true,
+ install_dir : join_paths(datadir, 'glib-2.0', 'schemas')
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..26ba20d
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,63 @@
+project('mate-netbook', 'c',
+ version: '1.27.0',
+ meson_version: '>= 0.50.0',
+ license: 'GPLv3.0+')
+
+i18n = import('i18n')
+
+prefix = get_option('prefix')
+gettext_package = meson.project_name()
+privexecdir = join_paths(prefix, get_option('libexecdir'))
+datadir = join_paths(prefix, get_option('datadir'))
+matedir = join_paths(prefix, get_option('datadir'), 'mate-panel')
+maximus_mandir = join_paths(prefix, get_option('mandir'))
+
+glib_req = '>= 2.50.0'
+gtk_req = '>= 3.22.0'
+libpanel_req = '>= 1.17.0'
+
+cc = meson.get_compiler('c')
+
+# config.h configuration data
+cdata = configuration_data()
+cdata.set_quoted('GETTEXT_PACKAGE', 'mate-netbook')
+cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
+cdata.set_quoted('PACKAGE_URL', 'https://mate-desktop.org/')
+cdata.set_quoted('SYSCONFDIR', join_paths(prefix, 'etc'))
+cdata.set_quoted('MATELOCALEDIR', join_paths(prefix, get_option('localedir')))
+cdata.set_quoted('MATEWINDOWPICKER_MENU_UI_DIR', join_paths(prefix, get_option('localedir'), 'mate-panel', 'ui'))
+
+add_project_arguments('-DHAVE_CONFIG_H', language: 'c')
+add_project_arguments('-O2', language: 'c')
+add_project_arguments('-Wmissing-prototypes', language: 'c')
+config_inc = include_directories('.')
+
+gtk_dep = dependency('gtk+-3.0', version: gtk_req)
+glib_dep = dependency('glib-2.0', version: glib_req)
+libwnck_dep = dependency('libwnck-3.0')
+xtst_dep = dependency('xtst')
+libfakekey_dep = dependency('libfakekey')
+libpanel_dep = dependency('libmatepanelapplet-4.0', version: libpanel_req)
+m_dep = cc.find_library('m', required : false)
+
+netbook_deps = [gtk_dep, glib_dep, libwnck_dep, xtst_dep, libfakekey_dep, libpanel_dep, m_dep]
+
+subdir('mate-window-picker-applet')
+subdir('po')
+subdir('maximus')
+
+# write config.h
+configure_file(output: 'config.h', configuration: cdata)
+# Summary
+
+summary = [
+ 'configuration summary:',
+ '',
+ ' project: @0@ @1@'.format(meson.project_name(), meson.project_version()),
+ ' prefix: @0@'.format(prefix),
+ ' compiler: @0@'.format('gcc'),
+ ' cflags: @0@'.format('-g -O2'),
+ ' warning flags: @0@'.format('-Wall -Wmissing-prototypes'),
+ ''
+]
+message('\n'.join(summary))
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..5159141
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(gettext_package, preset : 'glib')