diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-03-23 20:52:55 +0100 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-04-05 00:31:21 +0200 |
| commit | ef32d65ac1852da581ac75d20f903dbcb2d0b5cd (patch) | |
| tree | 98cdb79c471babd906368d23171fe10168c18062 /meson.build | |
| parent | dae5942e2ad1ac59f6217ad0f8e0bd630d0b4747 (diff) | |
Use meson as a build system
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..1236895 --- /dev/null +++ b/meson.build @@ -0,0 +1,95 @@ +################################################################################ +# Project Settings +################################################################################ +# TODO: Consider whether I need to add version and license or if meson is smart +# enough to read that from Cargo.toml. +project('map', 'rust', version: '1.0.4', meson_version: '>= 1.0.0') + +base_id = 'systems.tranquil.Map' + +################################################################################ +# Imports +################################################################################ +i18n = import('i18n') +gnome = import('gnome') +rust = import('rust') + +################################################################################ +# Dependencies +################################################################################ + +dependency('glib-2.0', version: '>= 2.86.0') +dependency('gio-2.0', version: '>= 2.86.0') +dependency('gtk4', version: '>= 4.20.3') +dependency('libadwaita-1', version: '>= 1.8.4') +dependency('gtksourceview-5', version: '>= 5.18.0') + +################################################################################ +# Required Programs +################################################################################ +find_program('cargo') +find_program('glib-compile-resources') +find_program('glib-compile-schemas') +desktop_file_validate = find_program('desktop-file-validate') +appstream_util = find_program('appstream-util') +cargo = find_program('cargo') + +################################################################################ +# Directories +################################################################################ +prefix = get_option('prefix') +bindir = prefix / get_option('bindir') +localedir = prefix / get_option('localedir') +datadir = prefix / get_option('datadir') + +pkgdatadir = datadir / meson.project_name() +iconsdir = datadir / 'icons' +podir = meson.project_source_root() / 'po' + +################################################################################ +# Build Metadata +################################################################################ +version = meson.project_version() + +if get_option('profile') == 'development' + profile = 'Unstable' + vcs_tag = run_command('jj', 'log', '-r', '@', '--no-graph', '-T', 'change_id.short(8)', check: false).stdout().strip() + if vcs_tag == '' + version_suffix = '-unstable' + else + version_suffix = '-@0@'.format(vcs_tag) + endif + application_id = '@0@.@1@'.format(base_id, profile) +else + profile = '' + version_suffix = '' + application_id = base_id +endif + +gettext_domain = application_id + +subdir('src') +subdir('data') +subdir('po') + +summary({ + 'prefix': get_option('prefix'), + 'libdir': get_option('libdir'), + 'localedir': get_option('localedir'), + 'datadir': get_option('datadir'), + 'bindir': get_option('bindir'), + }, + section: 'Directories', +) + +summary({ + 'Profile': get_option('profile'), + }, + section: 'Build options', +) + +gnome.post_install( + gtk_update_icon_cache: true, + glib_compile_schemas: true, + update_desktop_database: true, +) |