meson.build 2.33 KB
Newer Older
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
1
project('timetrack', 'c',
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
2
  version: '1.2.1',
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
3
  meson_version: '>= 0.48.0'
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
4 5 6
)
i18n = import('i18n')
python = import('python3')
7
project_id = 'net.danigm.timetrack'
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
8 9 10 11 12 13 14 15 16 17 18 19
contributors = 'Daniel García Moreno <danigm@gnome.org>'

message('Looking for dependencies')
python_bin = python.find_python()
if not python_bin.found()
    error('No valid python3 binary found')
else
    message('Found python3 binary')
endif
dependency('glib-2.0')
dependency('gobject-introspection-1.0', version: '>=1.35.9')
dependency('gtk+-3.0', version :'>=3.20')
20
dependency('libhandy-0.0', version :'>=0.0.7')
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

env = environment()

python_dir = join_paths(get_option('prefix'), python.sysconfig_path('purelib'))
LIBEXEC_DIR = join_paths(get_option('prefix'), get_option('libexecdir'))
EXTENSION_DIR = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name())
DATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
bindir = join_paths(get_option('prefix'), get_option('bindir'))

# Profiles
if get_option('profile') == 'development'
    profile = 'Devel'
    name_suffix = ' (Development)'
else
    profile = ''
    name_suffix = ''
endif


conf = configuration_data()
conf.set('PACKAGE_URL', 'https://gitlab.gnome.org/danigm/timetrack')
conf.set('DATA_DIR', DATA_DIR)
conf.set('EXTENSION_DIR', EXTENSION_DIR)
conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
conf.set('PYTHON_DIR', python_dir)
conf.set('PYTHON_EXEC_DIR', join_paths(get_option('prefix'), python.sysconfig_path('stdlib')))
conf.set('PYTHON', python_bin.path())
conf.set('libexecdir', LIBEXEC_DIR)
if get_option('profile') == 'development'
    conf.set('VERSION', ''.join([run_command(['git', 'describe', '--long', '--tags']).stdout(), get_option('profile')]))
else
    conf.set('VERSION', meson.project_version())
endif
conf.set('CONTRIBUTORS', contributors)
conf.set_quoted('PROFILE', profile)

57
application_id = 'net.danigm.timetrack'
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
58
if get_option('profile') == 'development'
59
  application_id = 'net.danigm.timetrackDevel'
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73
endif
conf.set('APPID', application_id)

subdir('data')
subdir('po')

install_subdir(
  'timetrack',
  install_dir: python_dir
)

message('Preparing init file')
configure_file(
  input: 'timetrack.in',
74
  output: 'timetrack',
Daniel Garcia Moreno's avatar
Daniel Garcia Moreno committed
75 76 77 78 79
  configuration: conf,
  install_dir: bindir
)

meson.add_install_script('meson_post_install.py')