meson.build 2.08 KB
Newer Older
1
project('com.github.bilelmoussaoui.Authenticator', 'c',
Bilal Elmoussaoui's avatar
Bilal Elmoussaoui committed
2
	version: '3.32.2',
3
  meson_version: '>= 0.50',
4
  license: 'GPL+-3.0'
Bilal Elmoussaoui's avatar
Bilal Elmoussaoui committed
5 6 7
)
gnome  = import('gnome')
i18n   = import('i18n')
8

9 10 11 12 13 14 15 16 17
# This doesn't work yet. It's doesn't find the python3 from the sandboxed env first
# python = import('python')
# python3 = python.find_installation('python3')
python = import('python3')
python3 = python.find_python()
if not python3.found()
    error('No valid python3 binary found')
else
    message('Found python3 binary')
18 19
endif

Bilal Elmoussaoui's avatar
Bilal Elmoussaoui committed
20

21

Bilal Elmoussaoui's avatar
Bilal Elmoussaoui committed
22 23 24
dependency('glib-2.0')
dependency('gobject-2.0')
dependency('gobject-introspection-1.0')
25
dependency('gtk+-3.0', version: '>=3.16')
26 27 28 29 30
dependency('libsecret-1')
dependency('zbar', version: '>= 0.20.1')
find_program('glib-compile-schemas', required: true)
find_program('gtk-update-icon-cache', required: false)
find_program('update-desktop-database', required: false)
31

32 33 34 35
gettext_package = 'Authenticator'
profile = get_option('profile')
profile_suffix = ''
name_suffix = ''
36
version_suffix = ''
37 38 39 40 41 42 43 44 45
if profile != 'default'
  gettext_package += profile
  if profile == 'beta'
    name_suffix = ' (Beta)'
    profile_suffix = 'Beta'
  else
    name_suffix = ' (Development)'
    profile_suffix = 'Devel'
  endif
46 47 48 49 50 51
  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
52
endif
Bilal Elmoussaoui's avatar
Bilal Elmoussaoui committed
53

Bilal Elmoussaoui's avatar
Bilal Elmoussaoui committed
54

55 56 57 58 59
application_id = 'com.github.bilelmoussaoui.Authenticator@0@'.format(profile_suffix)
localedir = get_option('prefix') / get_option('localedir')
pkgdatadir = get_option('prefix') / get_option('datadir') / meson.project_name()
libexecdir = get_option('prefix') / get_option('libexecdir')
pythondir = get_option('prefix') / python.sysconfig_path('purelib')
60

61
podir = meson.source_root() / 'po'
62

Bilal Elmoussaoui's avatar
Bilal Elmoussaoui committed
63 64 65 66 67 68 69
if profile != 'default'
    # 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')
endif


70 71
subdir('data')
subdir('po')
72
subdir('src')
73
meson.add_install_script('build-aux/meson_post_install.py')