diff options
author | Vika <vika@fireburn.ru> | 2024-09-01 18:10:26 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-09-04 19:51:50 +0300 |
commit | f8d61d957d4a2d086f4b97f2e3d7d19d0bb35f13 (patch) | |
tree | 740988c295d5e3c53b93bd09bad0ce73211b2f40 /meson.build | |
parent | 7718901fb8346a75bd203f04e4303d0df007dcd1 (diff) | |
download | bowl-f8d61d957d4a2d086f4b97f2e3d7d19d0bb35f13.tar.zst |
Mesonify build
This took a while and had me scratching my head often. But I managed to combine the best parts of Crane and Meson together, allowing me to have blazing fast Nix builds. This also adds initial scaffolding for gettext and other cool things.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..9010236 --- /dev/null +++ b/meson.build @@ -0,0 +1,68 @@ +project( + 'bowl', + 'rust', + version: '0.1.0', + meson_version: '>= 1.1', + license: 'AGPLv3', +) + +i18n = import('i18n') +gnome = import('gnome') + +base_id = 'xyz.vikanezrimaya.kittybox.Bowl' + + +dependency('glib-2.0', version: '>= 2.66') +dependency('gio-2.0', version: '>= 2.66') +dependency('gtk4', version: '>= 4.14.0') +dependency('libsecret-1', version: '>= 0.21.2') +dependency('libsoup-3.0', version: '>= 3.0') + +find_program('glib-compile-resources') +glib_compile_schemas = find_program('glib-compile-schemas') +desktop_file_validate = find_program('desktop-file-validate', required: false) +appstreamcli = find_program('appstreamcli', required: false) +cargo = find_program('cargo') + +version = meson.project_version() + +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' +gettext_package = meson.project_name() + +if get_option('profile') == 'development' + profile = 'Devel' + vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() + if vcs_tag == '' + version_suffix = '-devel' + 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 + +meson.add_dist_script( + 'build-aux/dist-vendor.sh', + meson.project_build_root() / 'meson-dist' / meson.project_name() + '-' + version, + meson.project_source_root() +) + +subdir('src') +subdir('po') +subdir('data') + +gnome.post_install( + gtk_update_icon_cache: false, + glib_compile_schemas: false, + update_desktop_database: true, +) |