meson.build 2.46 KB
Newer Older
Felipe Borges's avatar
Felipe Borges committed
1 2
project ('gnome-boxes',
         ['vala', 'c'],
Felipe Borges's avatar
Felipe Borges committed
3
         version: '3.34.1',
Felipe Borges's avatar
Felipe Borges committed
4
         license: 'LGPLv2+',
5
         meson_version: '>= 0.46.0',
Felipe Borges's avatar
Felipe Borges committed
6 7 8 9 10
)

gnome = import ('gnome')
i18n = import ('i18n')

11 12 13
cc = meson.get_compiler ('c')
valac = meson.get_compiler ('vala')

14
libarchive_dep = dependency ('libarchive', version: '>= 3.0.0')
Felipe Borges's avatar
Felipe Borges committed
15

16 17 18
src_dir = join_paths (meson.source_root (), 'src')
vapi_dir = join_paths (meson.source_root (), 'vapi')

19
config_dep = valac.find_library ('config', dirs: src_dir)
Felipe Borges's avatar
Felipe Borges committed
20 21 22 23 24

pkglibdir = join_paths (get_option ('libdir'), meson.project_name ())

po_dir = join_paths (meson.source_root (), 'po')
data_dir = join_paths (get_option ('prefix'), get_option ('datadir'))
25
locale_dir = join_paths (get_option ('prefix'), get_option ('localedir'))
26
pkgdatadir = join_paths (data_dir, meson.project_name ())
Felipe Borges's avatar
Felipe Borges committed
27 28

conf = configuration_data ()
29 30
conf.set_quoted ('DISTRIBUTOR_NAME', get_option ('distributor_name'))
conf.set_quoted ('DISTRIBUTOR_VERSION', get_option ('distributor_version'))
Felipe Borges's avatar
Felipe Borges committed
31 32 33 34 35 36 37 38
conf.set_quoted ('PACKAGE_NAME', meson.project_name ())
conf.set_quoted ('PACKAGE_TARNAME', meson.project_name ())
conf.set_quoted ('PACKAGE_VERSION', meson.project_version ())
conf.set_quoted ('GETTEXT_PACKAGE', meson.project_name ())
conf.set('PACKAGE_URL', '"https://wiki.gnome.org/Apps/Boxes"')
conf.set_quoted ('DATADIR', data_dir)
conf.set_quoted ('CACHEDIR', '/var/cache')
conf.set_quoted ('LOCALEDIR', locale_dir)
39
conf.set('PACKAGE_BUGREPORT', '"http://gitlab.gnome.org/gnome/gnome-boxes/issues"')
Felipe Borges's avatar
Felipe Borges committed
40

41 42 43 44 45 46 47 48 49 50
if get_option ('profile') == 'development'
  profile = 'Devel'
  name_suffix = ' (Development Snapshot)'
else
  profile = ''
  name_suffix = ''
endif

application_id = 'org.gnome.Boxes@0@'.format (profile)
conf.set_quoted ('PROFILE', profile)
51 52
conf.set_quoted ('APPLICATION_ID', application_id)
conf.set_quoted ('NAME_SUFFIX', name_suffix)
53
conf.set_quoted ('VERSION', '@0@-@VCS_TAG@'.format (meson.project_version()))
54 55 56 57 58 59 60 61 62 63 64 65 66 67

config_h = declare_dependency (
  sources: vcs_tag (
    command: ['git', 'rev-parse', '--short', 'HEAD'],
    fallback: get_option('profile') != 'default'? 'devel' : 'stable',
    input: configure_file (
      output: 'config.h.in',
      configuration: conf
    ),
    output: 'config.h'

  )
)

68
#configure_file (output: 'config.h', configuration: conf)
Felipe Borges's avatar
Felipe Borges committed
69 70
config_h_dir = include_directories ('.')

71
meson.add_install_script (join_paths ('build-aux', 'post_install.py'), data_dir)
Felipe Borges's avatar
Felipe Borges committed
72 73 74 75 76

subdir ('data')
subdir ('help')
subdir ('po')
subdir ('src')
77 78 79 80

if get_option ('installed_tests')
  subdir ('tests')
endif