2017-11-08 11:44:55 +00:00
|
|
|
project(
|
|
|
|
'fractal', 'rust',
|
2018-08-03 08:57:02 +00:00
|
|
|
version: '3.29.6',
|
2017-11-08 11:44:55 +00:00
|
|
|
license: 'GPLv3',
|
|
|
|
)
|
|
|
|
|
2018-08-23 21:46:36 +00:00
|
|
|
if get_option('profile') == 'development'
|
|
|
|
profile = 'Devel'
|
|
|
|
name_suffix = ' (Development)'
|
|
|
|
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
|
|
|
|
else
|
|
|
|
profile = ''
|
|
|
|
name_suffix = ''
|
|
|
|
version_suffix = ''
|
|
|
|
endif
|
|
|
|
|
|
|
|
application_id = 'org.gnome.Fractal@0@'.format(profile)
|
|
|
|
|
2017-11-08 11:44:55 +00:00
|
|
|
fractal_version = meson.project_version()
|
|
|
|
version_array = fractal_version.split('.')
|
|
|
|
fractal_major_version = version_array[0].to_int()
|
|
|
|
fractal_minor_version = version_array[1].to_int()
|
|
|
|
fractal_version_micro = version_array[2].to_int()
|
|
|
|
|
|
|
|
fractal_prefix = get_option('prefix')
|
|
|
|
fractal_bindir = join_paths(fractal_prefix, get_option('bindir'))
|
2018-05-18 08:34:17 +00:00
|
|
|
fractal_localedir = join_paths(fractal_prefix, get_option('localedir'))
|
2017-11-08 11:44:55 +00:00
|
|
|
|
2017-12-17 18:10:26 +00:00
|
|
|
datadir = get_option('datadir')
|
|
|
|
|
2018-05-17 17:52:35 +00:00
|
|
|
i18n = import('i18n')
|
|
|
|
|
2018-08-23 18:13:14 +00:00
|
|
|
podir = join_paths (meson.source_root (), 'fractal-gtk', 'po')
|
|
|
|
|
2018-05-17 17:52:35 +00:00
|
|
|
subdir('fractal-gtk/po')
|
2017-12-17 18:10:26 +00:00
|
|
|
subdir('fractal-gtk/res')
|
2017-11-08 11:44:55 +00:00
|
|
|
|
2017-11-08 12:37:20 +00:00
|
|
|
cargo = find_program('cargo', required: false)
|
2017-11-11 09:45:57 +00:00
|
|
|
gresource = find_program('glib-compile-resources', required: false)
|
|
|
|
cargo_vendor = find_program('cargo-vendor', required: false)
|
2017-11-08 12:37:20 +00:00
|
|
|
cargo_script = find_program('scripts/cargo.sh')
|
2018-02-01 16:31:13 +00:00
|
|
|
grabber = find_program('scripts/grabber.sh')
|
2017-11-11 11:20:34 +00:00
|
|
|
cargo_release = find_program('scripts/release.sh')
|
2017-11-11 09:45:57 +00:00
|
|
|
|
2018-02-01 16:31:13 +00:00
|
|
|
c = run_command(grabber)
|
|
|
|
sources = c.stdout().strip().split('\n')
|
|
|
|
|
2017-11-08 11:44:55 +00:00
|
|
|
cargo_release = custom_target('cargo-build',
|
2017-11-08 12:37:20 +00:00
|
|
|
build_by_default: true,
|
2018-02-01 16:31:13 +00:00
|
|
|
input: sources,
|
2017-11-08 11:44:55 +00:00
|
|
|
output: ['fractal'],
|
2017-11-08 12:37:20 +00:00
|
|
|
install: true,
|
|
|
|
install_dir: fractal_bindir,
|
2018-08-23 21:46:36 +00:00
|
|
|
command: [cargo_script,
|
|
|
|
'@CURRENT_SOURCE_DIR@',
|
|
|
|
'@OUTPUT@',
|
|
|
|
fractal_localedir,
|
|
|
|
application_id,
|
|
|
|
name_suffix,
|
|
|
|
fractal_version + version_suffix,
|
|
|
|
profile
|
|
|
|
])
|
2017-11-09 19:57:21 +00:00
|
|
|
|
|
|
|
run_target('release', command: ['scripts/release.sh',
|
|
|
|
meson.project_name() + '-' + fractal_version
|
2017-11-10 13:11:37 +00:00
|
|
|
])
|
2018-05-10 11:38:05 +00:00
|
|
|
|
|
|
|
meson.add_install_script('scripts/meson_post_install.py')
|