melawy-welcome/meson.build

93 lines
2.6 KiB
Meson
Raw Normal View History

2022-05-30 15:13:20 +05:00
project('cachyos-hello', 'rust',
2023-02-19 02:53:00 +05:00
version: '0.9.6',
2021-09-20 05:54:03 +05:00
license: 'GPLv3',
2022-05-30 15:13:20 +05:00
meson_version: '>=0.56.0',
default_options: ['buildtype=debugoptimized',
2021-09-21 04:46:45 +05:00
'warning_level=3',
2021-09-20 05:54:03 +05:00
'werror=true',
'b_ndebug=if-release'])
2022-05-30 15:13:20 +05:00
i18n = import('i18n')
gnome = import('gnome')
base_id = 'org.cachyos.hello'
dependency('glib-2.0', version: '>= 2.66')
dependency('gio-2.0', version: '>= 2.66')
2022-06-28 01:28:40 +05:00
dependency('gtk+-3.0', version: '>= 3.24.33')
2022-05-30 15:13:20 +05:00
glib_compile_resources = find_program('glib-compile-resources', required: true)
glib_compile_schemas = find_program('glib-compile-schemas', required: true)
desktop_file_validate = find_program('desktop-file-validate', required: false)
appstream_util = find_program('appstream-util', required: false)
cargo = find_program('cargo', required: true)
cargo_script = find_program('build-aux/cargo.py')
version = meson.project_version()
version_array = version.split('.')
major_version = version_array[0].to_int()
minor_version = version_array[1].to_int()
version_micro = version_array[2].to_int()
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()
2023-02-17 22:48:59 +05:00
resources = gnome.compile_resources(
'cachyos-welcome',
'cachyos-welcome.gresource.xml',
gresource_bundle: true,
source_dir: meson.current_build_dir(),
install: true,
install_dir: pkgdatadir,
)
2022-05-30 15:13:20 +05:00
if get_option('profile') == 'development'
profile = 'Devel'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').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
2021-09-20 05:54:03 +05:00
2022-05-30 15:13:20 +05:00
meson.add_dist_script(
'build-aux/dist-vendor.sh',
meson.project_build_root() / 'meson-dist' / meson.project_name() + '-' + version,
meson.project_source_root()
2021-09-20 05:54:03 +05:00
)
2022-05-30 15:13:20 +05:00
if get_option('profile') == 'development'
# Setup pre-commit hook for ensuring coding style is always consistent
message('Setting up git pre-commit hook..')
run_command('cp', '-f', 'hooks/pre-commit.hook', '.git/hooks/pre-commit')
2021-09-21 04:46:45 +05:00
endif
2022-05-30 15:13:20 +05:00
cargo_sources = files(
'Cargo.toml',
'Cargo.lock',
)
2021-09-21 04:46:45 +05:00
2022-06-02 23:24:49 +05:00
#subdir('po')
2022-05-30 15:13:20 +05:00
subdir('src')
2022-07-07 00:12:31 +05:00
subdir('icons')
2021-09-20 05:54:03 +05:00
2021-09-22 04:44:34 +05:00
install_data (
meson.project_name () + '.desktop',
install_dir: join_paths(get_option('datadir'), 'applications')
)
2022-06-02 23:24:49 +05:00
meson.add_install_script('postinstall.sh')