Commit 907abe38 authored by Salamandar's avatar Salamandar

Added meson build files. Add LINGUAS and pot files for help translation.

parent 31d77800
# please keep this list sorted alphabetically
cs
de
el
es
fr
hu
ko
pl
pt
pt_BR
ro
sv
This diff is collapsed.
gnome.yelp(meson.project_name(),
sources: [
'commandline.page',
'cpu-check.page',
'cpu-mem-normal.page',
'cpu-multicore.page',
'fs-device.page',
'fs-diskusage.page',
'fs-info.page',
'fs-showall.page',
'index.page',
'legal.xml',
'mem-check.page',
'mem-swap.page',
'memory-map-use.page',
'net-bits.page',
'process-explain.page',
'process-files.page',
'process-identify-file.page',
'process-identify-hog.page',
'process-kill.page',
'process-many.page',
'process-priority-change.page',
'process-status.page',
'process-update-speed.page',
'solaris-mode.page',
'units.page',
],
media: [
'figures/monitorlogo.png',
],
)
# http://bugzilla.gnome.org/enter_bug.cgi?product=system-monitor
project('gnome-system-monitor',
'c', 'cpp',
default_options : [
'c_std=c11', 'cpp_std=c++11'
],
version: '3.27.90',
meson_version: '>=0.40.0',
)
gnome = import('gnome')
i18n = import('i18n')
cc = meson.get_compiler('c')
cx = meson.get_compiler('cpp')
gettext_package = meson.project_name()
conf = configuration_data()
conf.set_quoted('VERSION', meson.project_version())
conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
conf.set_quoted('GNOMELOCALEDIR',
join_paths(get_option('datadir'), 'locale')
)
conf.set_quoted('GSM_LIBEXEC_DIR',
join_paths(get_option('libexecdir'), meson.project_name())
)
dataconf = configuration_data()
dataconf.set('VERSION', meson.project_version())
dataconf.set('GETTEXT_PACKAGE', gettext_package)
dataconf.set('pkglibexecdir',
join_paths(get_option('prefix'),get_option('libexecdir'),meson.project_name())
)
################################################################################
# Dependencies
giomm = dependency('giomm-2.4', version: '>=2.46')
glib = dependency('glib-2.0', version: '>=2.55.0')
glibmm = dependency('glibmm-2.4', version: '>=2.46')
gmodule = dependency('gmodule-2.0')
gtk3 = dependency('gtk+-3.0', version: '>=3.22.0')
gtkmm = dependency('gtkmm-3.0', version: '>=3.3.18')
libgtop = dependency('libgtop-2.0', version: '>=2.37.0')
librsvg = dependency('librsvg-2.0', version: '>=2.35')
libxml = dependency('libxml-2.0', version: '>=2.0')
if get_option('wnck')
libwnck = dependency('libwnck-3.0', version: '>=2.91.0')
else
libwnck = dependency('', required: false)
endif
conf.set('HAVE_WNCK', libwnck.found())
if get_option('systemd')
libsystemd = dependency('libsystemd', version: '>=44')
else
libsystemd = dependency('', required: false)
endif
conf.set('HAVE_SYSTEMD', libsystemd.found())
################################################################################
# Compiler flags
extra_flags = [
'-Wall',
'-Wcast-align',
'-Wchar-subscripts',
'-Winline',
'-Wmissing-declarations',
'-Wpointer-arith',
'-Wsign-compare',
]
extra_cflags = [
'-Wmissing-prototypes',
'-Wnested-externs',
]
extra_cxxflags = [
# '-fvisibility=hidden',
# '-fvisibility-inlines-hidden',
]
add_project_arguments(cc.get_supported_arguments(extra_flags + extra_cflags),
language: 'c'
)
add_project_arguments(cx.get_supported_arguments(extra_flags + extra_cxxflags),
language: 'cpp'
)
conf.set('HAVE_LKSTRFTIME', cc.has_function('strftime'))
conf.set('CTIME_R_THREE_ARGS', cc.compiles('''
#include <time.h>
int main() {
char *buf;
time_t date;
ctime_r (&date, buf, 100);
}
'''))
configure_file(
output: 'config.h',
configuration: conf,
)
################################################################################
# Generate files
foreach file : [
'gnome-system-monitor.desktop',
'gnome-system-monitor-kde.desktop',
]
i18n.merge_file(
input : configure_file(
configuration: dataconf,
input : file + '.in.in',
output: file + '.in'
),
output: file,
po_dir: 'po',
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications'),
)
endforeach
i18n.merge_file(
input : 'gnome-system-monitor.appdata.xml.in',
output: 'gnome-system-monitor.appdata.xml',
po_dir: 'po',
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo'),
)
i18n.merge_file(
input : configure_file(
configuration: dataconf,
input : 'org.gnome.gnome-system-monitor.policy.in.in',
output: 'org.gnome.gnome-system-monitor.policy.in'
),
output: 'org.gnome.gnome-system-monitor.policy',
po_dir: 'po',
install: true,
install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions'),
)
# appdata_validate = find_program('appdata-validate')
# desktop_validate = find_program('desktop-file-validate')
rootInclude = include_directories('.')
subdir('po')
subdir('scripts')
subdir('src')
subdir('help')
message('\n'.join(['',
'Configuration:',
'',
' Source code location: @0@'.format(meson.source_root()),
' C Compiler: @0@'.format(cc.get_id()),
' C++ Compiler: @0@'.format(cx.get_id()),
' CFLAGS: @0@'.format(get_option('c_args')),
' CXXFLAGS: @0@'.format(get_option('cpp_args')),
' systemd support: @0@'.format(libsystemd.found()),
' wnck support: @0@ @1@'.format(libwnck.found(),
libwnck.found() ? '(this will likely make system-monitor segfault)' : ''),
]))
option('wnck', type: 'boolean', value: false,
description: 'enable wnck support, this will likely make system-monitor segfault'
)
option('systemd', type: 'boolean', value: true,
description: 'SystemD support'
)
i18n.gettext(meson.project_name())
commands = [
'renice',
'kill',
]
foreach command : commands
executable('gsm-' + command,
'gsm_execute_helper.c',
dependencies: [
glib,
],
c_args: '-DCOMMAND="@0@"'.format(command),
install: true,
install_dir: join_paths(get_option('libexecdir'), meson.project_name())
)
endforeach
libgsm_legacy_sources = [
'e_date.c',
'gsm_color_button.c',
'treeview.c',
]
libgsm_legacy = static_library('gsm_legacy',
libgsm_legacy_sources,
include_directories: rootInclude,
dependencies: [
glib,
gtk3,
librsvg,
],
)
subdir('legacy')
system_monitor_sources = [
'application.cpp',
'argv.cpp',
'cgroups.cpp',
'disks.cpp',
'gsm_gksu.cpp',
'gsm_gnomesu.cpp',
'gsm_pkexec.cpp',
'interface.cpp',
'load-graph.cpp',
'lsof.cpp',
'main.cpp',
'memmaps.cpp',
'openfiles.cpp',
'prefsdialog.cpp',
'prettytable.cpp',
'procactions.cpp',
'procdialogs.cpp',
'procproperties.cpp',
'proctable.cpp',
'selinux.cpp',
'smooth_refresh.cpp',
'systemd.cpp',
'util.cpp',
]
system_monitor_headers = [
'prettytable.h',
'procdialogs.h',
'cgroups.h',
'application.h',
'smooth_refresh.h',
'gsm_gnomesu.h',
'openfiles.h',
'procproperties.h',
'lsof.h',
'proctable.h',
'settings-keys.h',
'memmaps.h',
'procactions.h',
'systemd.h',
'argv.h',
'prefsdialog.h',
'selinux.h',
'util.h',
'gsm_gksu.h',
'interface.h',
'load-graph.h',
'disks.h',
'gsm_pkexec.h',
'defaulttable.h',
'legacy/treeview.h',
'legacy/e_date.h',
'legacy/gsm_color_button.h',
]
gsm_resource_dir = join_paths(get_option('datadir'), meson.project_name())
gsm_resource = gnome.compile_resources(
'gsm',
'gsm.gresource.xml',
gresource_bundle: true,
source_dir: meson.source_root(),
install: true,
install_dir: gsm_resource_dir,
)
gsm_schemas = configure_file(
input : 'org.gnome.gnome-system-monitor.gschema.xml.in',
output: 'org.gnome.gnome-system-monitor.gschema.xml',
configuration: dataconf,
install: true,
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas'),
)
gsm_gsettings = gnome.mkenums('org.gnome.gnome-system-monitor.enums.xml',
sources: system_monitor_headers,
# symbol_prefix: prefix to use for the symbols
comments: '<!-- @comment@ -->',
fhead: '<schemalist>',
vhead: ' <@type@ id=\'org.gnome.gnome-system-monitor.@EnumName@\'>',
vprod: ' <value nick=\'@valuenick@\' value=\'@valuenum@\'/>',
vtail: ' </@type@>',
ftail: '</schemalist>',
install_header: true,
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas'),
)
executable(meson.project_name(),
system_monitor_sources,
include_directories: rootInclude,
dependencies: [
gmodule,
gtkmm,
libgtop,
libsystemd,
libwnck,
],
link_with: libgsm_legacy,
cpp_args: [
'-DGSM_RESOURCE_FILE="@0@"'.format(join_paths(
get_option('prefix'), gsm_resource_dir, 'gsm.gresource')),
],
install: true,
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment