diff options
author | Marty E. Plummer <[email protected]> | 2019-05-21 17:01:18 -0500 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-05-22 10:30:33 +0200 |
commit | a30185610beb815648854207cb2a29d0fa9303dc (patch) | |
tree | 02b0804e1644da72d6ddb3f2e01facaee0fa81a9 | |
parent | e98858d43feb08d52ba6e1f39532f618b1a2cc01 (diff) | |
download | mate-desktop-a30185610beb815648854207cb2a29d0fa9303dc.tar.bz2 mate-desktop-a30185610beb815648854207cb2a29d0fa9303dc.tar.xz |
treewide: add meson build
Signed-off-by: Marty E. Plummer <[email protected]>
-rw-r--r-- | config.meson.h | 50 | ||||
-rw-r--r-- | docs/reference/mate-desktop/meson.build | 7 | ||||
-rw-r--r-- | icons/meson.build | 17 | ||||
-rw-r--r-- | libmate-desktop/mate-desktop.map | 6 | ||||
-rw-r--r-- | libmate-desktop/meson.build | 145 | ||||
-rw-r--r-- | man/meson.build | 5 | ||||
-rw-r--r-- | mate-about/meson.build | 39 | ||||
-rw-r--r-- | meson.build | 114 | ||||
-rw-r--r-- | meson_options.txt | 20 | ||||
-rw-r--r-- | po/meson.build | 1 | ||||
-rw-r--r-- | schemas/meson.build | 41 | ||||
-rw-r--r-- | tools/meson.build | 18 | ||||
-rw-r--r-- | utils/post_install.py | 21 |
13 files changed, 484 insertions, 0 deletions
diff --git a/config.meson.h b/config.meson.h new file mode 100644 index 0000000..fd5679a --- /dev/null +++ b/config.meson.h @@ -0,0 +1,50 @@ +/* always defined to indicate that i18n is enabled */ +#mesondefine ENABLE_NLS + +/* The gettext translation domain */ +#mesondefine GETTEXT_PACKAGE + +/* Define if the xrandr-$XRANDR_REQUIRED library is present */ +#mesondefine HAVE_RANDR + +/* Building with startup notification support */ +#mesondefine HAVE_STARTUP_NOTIFICATION + +/* Enable additional debugging at the expense of performance and size */ +#mesondefine MATE_ENABLE_DEBUG + +/* Define to the major version */ +#mesondefine MATE_MAJOR + +/* Define to the minor version */ +#mesondefine MATE_MINOR + +/* Define to the micro version */ +#mesondefine MATE_MICRO + +/* Name of package */ +#mesondefine PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#mesondefine PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#mesondefine PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#mesondefine PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#mesondefine PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#mesondefine PACKAGE_URL + +/* Define to the version of this package. */ +#mesondefine PACKAGE_VERSION + +/* Version number of package */ +#mesondefine VERSION + +/* Define to 1 if the X Window System is missing or not being used. */ +#mesondefine X_DISPLAY_MISSING diff --git a/docs/reference/mate-desktop/meson.build b/docs/reference/mate-desktop/meson.build new file mode 100644 index 0000000..44e249e --- /dev/null +++ b/docs/reference/mate-desktop/meson.build @@ -0,0 +1,7 @@ +gnome.gtkdoc( + 'mate-desktop', + src_dir: 'libmate-desktop', + main_sgml: 'mate-desktop-docs.sgml', + scan_args: '--deprecated-guards="MATE_DISABLE_DEPRECATED"', + mkdb_args: ['--sgml-mode', '--output-format=xml'], +) diff --git a/icons/meson.build b/icons/meson.build new file mode 100644 index 0000000..a731eb1 --- /dev/null +++ b/icons/meson.build @@ -0,0 +1,17 @@ +icons = [ + '16x16/apps/mate-desktop.png', + '22x22/apps/mate-desktop.png', + '24x24/apps/mate-desktop.png', + '32x32/apps/mate-desktop.png', + '48x48/apps/mate-desktop.png', + '128x128/apps/mate-desktop.png', + 'scalable/apps/mate-desktop.svg', + 'scalable/apps/mate-desktop-symbolic.svg', +] + +foreach i : icons + dir = i.split('/') + install_data(i, + install_dir: join_paths('share/icons/hicolor', dir[0], dir[1]), + ) +endforeach diff --git a/libmate-desktop/mate-desktop.map b/libmate-desktop/mate-desktop.map new file mode 100644 index 0000000..4e3cb37 --- /dev/null +++ b/libmate-desktop/mate-desktop.map @@ -0,0 +1,6 @@ +{ +global: + mate_*; +local: + *; +}; diff --git a/libmate-desktop/meson.build b/libmate-desktop/meson.build new file mode 100644 index 0000000..77007a6 --- /dev/null +++ b/libmate-desktop/meson.build @@ -0,0 +1,145 @@ +libmdt_inc = include_directories('.') + +headers = files( + 'mate-desktop.h', + 'mate-desktop-utils.h', + 'mate-desktop-item.h', + 'mate-dconf.h', + 'mate-gsettings.h', + 'mate-bg.h', + 'mate-bg-crossfade.h', + 'mate-desktop-thumbnail.h', + 'mate-rr.h', + 'mate-languages.h', + 'mate-rr-config.h', + 'mate-rr-labeler.h', + 'mate-colorbutton.h', + 'mate-colorsel.h', + 'mate-hsv.h', + 'mate-colorseldialog.h', +) + +install_headers( + headers, + subdir: 'mate-desktop-2.0/libmate-desktop', +) + +sources = files( + 'mate-desktop-item.c', + 'mate-desktop-utils.c', + 'mate-desktop-thumbnail.c', + 'mate-thumbnail-pixbuf-utils.c', + 'mate-dconf.c', + 'mate-gsettings.c', + 'mate-bg.c', + 'mate-bg-crossfade.c', + 'display-name.c', + 'mate-rr.c', + 'mate-languages.c', + 'mate-rr-config.c', + 'mate-rr-output-info.c', + 'mate-rr-labeler.c', + 'mate-colorbutton.c', + 'mate-colorsel.c', + 'mate-hsv.c', + 'mate-colorseldialog.c', + 'edid-parse.c', +) + +deps = [ + x11_dep, + gtk_dep, + m_dep, + libmdt_dep, + dconf_dep, +] + +if get_option('pnp-ids-path') == 'internal' + pnp_ids_path = join_paths(matedt_pkgdatadir, 'pnp.ids') + install_data('pnp.ids', install_dir: matedt_pkgdatadir) +else + pnp_ids_path = get_option('pnp-ids-path') +endif + +cflags = [ + '-DMATELOCALEDIR="@0@"'.format(matedt_localedir), + '-DG_LOG_DOMAIN="MateDesktop"', + '-DISO_CODES_PREFIX="@0@"'.format(iso_codes_prefix), + '-DPNP_IDS="@0@"'.format(pnp_ids_path), +] + +symbol_map = join_paths(meson.current_source_dir(), meson.project_name() + '.map') + +test_ldflag = '-Wl,--version-script,' + symbol_map +ldflags = [] + +if cc.has_link_argument(test_ldflag) + ldflags += test_ldflag +endif + +libmate_desktop = shared_library( + 'mate-desktop-2', + sources: sources, + version: libversion, + include_directories: top_inc, + dependencies: deps, + c_args: cflags, + link_args: ldflags, + link_depends: symbol_map, + install: true, + install_dir: matedt_libdir, +) + +libmate_desktop_dep = declare_dependency( + link_with: libmate_desktop, + include_directories: libmdt_inc, + dependencies: deps, +) + +pkg.generate( + libraries: libmate_desktop, + version: matedt_version, + name: matedt_api_name, + description: 'Utility library for loading .desktop files', + filebase: matedt_api_name, + subdirs: matedt_api_name, + requires: [ + 'gtk+-3.0', + ], + requires_private: 'dconf', + variables: 'exec_prefix=' + matedt_libexecdir, + install_dir: join_paths(get_option('libdir'), 'pkgconfig') +) + +if enable_gir + gir_sources = sources + headers + + gir_incs = [ + 'GObject-2.0', + 'Gtk-3.0', + ] + + gir_extra_args = [ + '--warn-all', + '--add-include-path=@0@'.format(meson.current_source_dir()), + '-DMATE_DESKTOP_USE_UNSTABLE_API', + ] + + gir_dir = join_paths(matedt_datadir, 'gir-1.0') + typelib_dir = join_paths(matedt_libdir, 'girepository-1.0') + + gnome.generate_gir( + libmate_desktop, + sources: gir_sources, + nsversion: matedt_api_version, + namespace: matedt_gir_ns, + symbol_prefix: 'mate_', + identifier_prefix: 'Mate', + export_packages: matedt_api_name, + includes: gir_incs, + extra_args: gir_extra_args, + install: true, + install_dir_gir: gir_dir, + install_dir_typelib: typelib_dir, + ) +endif diff --git a/man/meson.build b/man/meson.build new file mode 100644 index 0000000..f64de2a --- /dev/null +++ b/man/meson.build @@ -0,0 +1,5 @@ +install_man([ + 'mate-about.1', + 'mate-color-select.1', + ] +) diff --git a/mate-about/meson.build b/mate-about/meson.build new file mode 100644 index 0000000..0ef8318 --- /dev/null +++ b/mate-about/meson.build @@ -0,0 +1,39 @@ +date_exe = find_program('date') +mate_date = run_command(date_exe, '+%Y-%m-%d').stdout().strip() + +mate_data = configuration_data() + +mate_data.set('MATE_DATE', mate_date) +mate_data.set('MATE_DATE_COMMENT_START', '<!--') +mate_data.set('MATE_DATE_COMMENT_END', '-->') +mate_data.set('MATE_PLATFORM', mate_platform) +mate_data.set('MATE_MINOR', mate_minor) +mate_data.set('MATE_MICRO', mate_micro) + +executable('mate-about', + 'mate-about.c', + c_args: [ + '-DLOCALE_DIR="@0@"'.format(join_paths(get_option('prefix'), get_option('localedir'))), + '-DPIXMAPS_DIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'), 'pixmaps')), + ], + dependencies : gtk_dep, + include_directories: top_inc, + install: true, +) + +i18n.merge_file( + input: 'mate-about.desktop.in', + output: 'mate-about.desktop', + type: 'desktop', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications'), +) + +mate_version_xml_in = configure_file( + input: 'mate-version.xml.in', + output: 'mate-version.xml', + configuration: mate_data, + install: true, + install_dir: join_paths(get_option('datadir'), 'mate-about'), +) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..cdd701a --- /dev/null +++ b/meson.build @@ -0,0 +1,114 @@ +project( + 'mate-desktop', + 'c', + version: '1.22.0', + license: [ 'GPL-2', 'FDL-1.1', 'LGPL-2' ], +) + +matedt_version = meson.project_version() +version_array = matedt_version.split('.') +mate_major_version = version_array[0].to_int() +mate_minor_version = version_array[0].to_int() +mate_micro_version = version_array[0].to_int() +mate_platform = 1 +mate_minor = 22 +mate_micro = 0 + +matedt_api_version = '2.0' +matedt_api_name = '@0@-@1@'.format(meson.project_name(), matedt_api_version) + +matedt_gir_ns = 'MateDesktop' +matedt_gir_version = '2.0' + +matedt_gettext_package = meson.project_name() + +matedt_prefix = get_option('prefix') +matedt_bindir = join_paths(matedt_prefix, get_option('bindir')) +matedt_datadir = join_paths(matedt_prefix, get_option('datadir')) +matedt_includedir = join_paths(matedt_prefix, get_option('includedir')) +matedt_libdir = join_paths(matedt_prefix, get_option('libdir')) +matedt_libexecdir = join_paths(matedt_prefix, get_option('libexecdir')) +matedt_localedir = join_paths(matedt_prefix, get_option('localedir')) +matedt_mandir = join_paths(matedt_prefix, get_option('mandir')) + +matedt_pkgdatadir = join_paths(matedt_datadir, 'libmate-desktop') + +# options +enable_gir = get_option('introspection') +enable_gtk_doc = get_option('gtk-doc') +enable_startup_notification = get_option('startup-notification') + +# Before making a release, the LT_VERSION string should be modified. +# The string is of the form C:R:A. +# - If interfaces have been changed or added, but binary compatibility has +# been preserved, change to C+1:0:A+1 +# - If binary compatibility has been broken (eg removed or changed interfaces) +# change to C+1:0:0 +# - If the interface is the same as the previous version, change to C:R+1:A +current = 17 +revision = 4 +age = 1 + +libversion = '@0@.@1@.@2@'.format(current, age, revision) + +cc = meson.get_compiler('c') + +config_h = configuration_data() + +# i18n +config_h.set_quoted('GETTEXT_PACKAGE', matedt_gettext_package) +config_h.set_quoted('LOCALEDIR', matedt_localedir) + +common_flags = [ + '-DHAVE_CONFIG_H', + '-DPACKAGE_VERSION="@0@"'.format(matedt_version), +] + +add_project_arguments(common_flags, language: 'c') + +gtk_dep = dependency('gtk+-3.0', version: '>= 3.22.0') +m_dep = cc.find_library('m', required: false) +dconf_dep = dependency('dconf', version: '>= 0.13.4') +x11_dep = dependency('x11', required: true) +randr_dep = dependency('xrandr', version: '>= 1.3', required: false) +config_h.set('HAVE_RANDR', randr_dep.found()) +iso_codes = dependency('iso-codes') +iso_codes_prefix = iso_codes.get_pkgconfig_variable('prefix') +libmdt_dep = [ + dependency('gdk-pixbuf-2.0'), + dependency('gobject-2.0'), + dependency('glib-2.0', version: '>= 2.50.0'), + dependency('gio-2.0', version: '>= 2.26.0'), + dependency('libstartup-notification-1.0', version: '>= 0.5', + required: enable_startup_notification ), + randr_dep, + iso_codes, +] + +gnome = import('gnome') +i18n = import('i18n') +pkg = import('pkgconfig') + +po_dir = join_paths(meson.source_root(), 'po') + +top_inc = include_directories('.') + +subdir('icons') +subdir('libmate-desktop') +subdir('man') +if enable_gtk_doc + subdir('docs/reference/mate-desktop') +endif +subdir('po') +subdir('tools') +subdir('schemas') +if get_option('mate-about') + subdir('mate-about') +endif + +configure_file( + output: 'config.h', + configuration: config_h, +) + +meson.add_install_script('utils/post_install.py') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..7eea7cd --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,20 @@ +option('gtk-doc', + type: 'boolean', + value: 'false', +) +option('introspection', + type: 'boolean', + value: 'false', +) +option('mate-about', + type: 'boolean', + value: 'true', +) +option('startup-notification', + type: 'boolean', + value: 'false', +) +option('pnp-ids-path', + type: 'string', + value: 'internal', +) diff --git a/po/meson.build b/po/meson.build new file mode 100644 index 0000000..22532da --- /dev/null +++ b/po/meson.build @@ -0,0 +1 @@ +i18n.gettext(matedt_gettext_package, preset: 'glib') diff --git a/schemas/meson.build b/schemas/meson.build new file mode 100644 index 0000000..6397445 --- /dev/null +++ b/schemas/meson.build @@ -0,0 +1,41 @@ +schemas_data = configuration_data() +schemas_data.set('GETTEXT_PACKAGE', meson.project_name()) +schemas_data.set('datadir', matedt_datadir) + +schemas_in = [ + 'org.mate.background.gschema.xml', +] + +schemas = [] +foreach s: schemas_in + schemas += configure_file( + input: '@[email protected]'.format(s), + output: '@0@'.format(s), + configuration: schemas_data, + ) +endforeach + +schemas += [ + 'org.mate.accessibility-keyboard.gschema.xml', + 'org.mate.accessibility-startup.gschema.xml', + 'org.mate.applications-at-mobility.gschema.xml', + 'org.mate.applications-at-visual.gschema.xml', + 'org.mate.applications-browser.gschema.xml', + 'org.mate.applications-calculator.gschema.xml', + 'org.mate.applications-office.gschema.xml', + 'org.mate.applications-terminal.gschema.xml', + 'org.mate.debug.gschema.xml', + 'org.mate.file-views.gschema.xml', + 'org.mate.interface.gschema.xml', + 'org.mate.lockdown.gschema.xml', + 'org.mate.peripherals-keyboard.gschema.xml', + 'org.mate.peripherals-mouse.gschema.xml', + 'org.mate.sound.gschema.xml', + 'org.mate.thumbnail-cache.gschema.xml', + 'org.mate.thumbnailers.gschema.xml', + 'org.mate.typing-break.gschema.xml', +] + +install_data(schemas, + install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas'), +) diff --git a/tools/meson.build b/tools/meson.build new file mode 100644 index 0000000..86fc703 --- /dev/null +++ b/tools/meson.build @@ -0,0 +1,18 @@ +executable('mate-color-select', + 'mate-color-select.c', + c_args: [ + '-DLOCALE_DIR="@0@"'.format(join_paths(get_option('prefix'), get_option('localedir'))), + ], + dependencies: [ gtk_dep, libmate_desktop_dep, ], + include_directories: top_inc, + install: true, +) + +i18n.merge_file( + input: 'mate-color-select.desktop.in', + output: 'mate-color-select.desktop', + type: 'desktop', + po_dir: '../po', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications'), +) diff --git a/utils/post_install.py b/utils/post_install.py new file mode 100644 index 0000000..cc5e2a6 --- /dev/null +++ b/utils/post_install.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +import os +import subprocess + +prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') +datadir = os.path.join(prefix, 'share') + +# Packaging tools define DESTDIR and this isn't needed for them +if 'DESTDIR' not in os.environ: + print('Compiling gsettings schemas...') + subprocess.call(['glib-compile-schemas', + os.path.join(datadir, 'glib-2.0', 'schemas')]) + + print('Updating icon cache...') + subprocess.call(['gtk-update-icon-cache', '-qtf', + os.path.join(datadir, 'icons', 'hicolor')]) + + print('Updating desktop database...') + subprocess.call(['update-desktop-database', '-q', + os.path.join(datadir, 'applications')]) |