meson.build 2.34 KB
Newer Older
1 2
project(
  'fractal', 'rust',
Daniel García Moreno's avatar
Daniel García Moreno committed
3
  version: '3.30.0',
4 5 6
  license: 'GPLv3',
)

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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)

24 25 26 27 28 29 30 31
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'))
32
fractal_localedir = join_paths(fractal_prefix, get_option('localedir'))
33

34 35
datadir = get_option('datadir')

36 37
i18n = import('i18n')

38 39
podir = join_paths (meson.source_root (), 'fractal-gtk', 'po')

40
subdir('fractal-gtk/po')
41
subdir('fractal-gtk/res')
42

43
cargo = find_program('cargo', required: false)
44 45
gresource = find_program('glib-compile-resources', required: false)
cargo_vendor = find_program('cargo-vendor', required: false)
46
cargo_script = find_program('scripts/cargo.sh')
47
grabber = find_program('scripts/grabber.sh')
48
cargo_release = find_program('scripts/release.sh')
49

50 51 52
c = run_command(grabber)
sources = c.stdout().strip().split('\n')

53
cargo_release = custom_target('cargo-build',
54
                        build_by_default: true,
55
                        input: sources,
56
                        output: ['fractal'],
57 58
                        install: true,
                        install_dir: fractal_bindir,
59 60 61 62 63 64 65 66 67
                        command: [cargo_script,
                                  '@CURRENT_SOURCE_DIR@',
                                  '@OUTPUT@',
                                  fractal_localedir,
                                  application_id,
                                  name_suffix,
                                  fractal_version + version_suffix,
                                  profile
                                 ])
68 69 70

run_target('release', command: ['scripts/release.sh',
                                meson.project_name() + '-' + fractal_version
71
                               ])
72 73

meson.add_install_script('scripts/meson_post_install.py')