meson.build 2.78 KB
Newer Older
1
project('passwordsafe', 'c',
2
  version: '3.32.0',
3
  meson_version: '>= 0.50.0'
4 5
)
i18n = import('i18n')
6
python = import('python')
7
project_id = 'org.gnome.PasswordSafe'
8
contributors = '\n'.join(['Falk Alexander Seidl <fseidl@gnome.org>', 'Uta Lemke'])
9 10

message('Looking for dependencies')
11
python_bin = python.find_installation('python3')
12 13 14 15 16 17 18 19
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.3')
21
dependency('pwquality')
22 23 24

env = environment()

25
python_dir = join_paths(get_option('prefix'), python_bin.get_install_dir())
26 27 28 29 30
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'))

31 32 33
# Python Module Check
pykeepass_dir = join_paths(python_dir, 'pykeepass')
construct_dir = join_paths(python_dir, 'construct')
34

35 36 37 38 39 40 41 42
if run_command('[', '-d', pykeepass_dir, ']').returncode() != 0
    error('Missing dependency pykeepass >= master')
endif

if run_command('[', '-d', construct_dir, ']').returncode() != 0
    error('Missing dependency python-construct >= 2.9.45')
endif

43 44 45 46 47 48 49 50 51 52
# Profiles
if get_option('profile') == 'development'
    profile = 'Devel'
    name_suffix = ' (Development)'
else
    profile = ''
    name_suffix = ''
endif


53
conf = configuration_data()
54
conf.set('PACKAGE_URL', 'https://gitlab.gnome.org/World/PasswordSafe')
55 56 57 58
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)
59
conf.set('PYTHON_EXEC_DIR', join_paths(get_option('prefix'), python_bin.get_path('stdlib')))
60 61
conf.set('PYTHON', python_bin.path())
conf.set('libexecdir', LIBEXEC_DIR)
62
if get_option('profile') == 'development'
63
    conf.set('VERSION', ''.join([run_command(['git', 'describe', '--long', '--tags']).stdout(), get_option('profile')]))
64 65 66
else
    conf.set('VERSION', meson.project_version())
endif
67
conf.set('CONTRIBUTORS', contributors)
68
conf.set_quoted('PROFILE', profile)
69

70 71 72 73 74 75
application_id = 'org.gnome.PasswordSafe'
if get_option('profile') == 'development'
  application_id = 'org.gnome.PasswordSafeDevel'
endif
conf.set('APPID', application_id)

76
subdir('data')
77
subdir('po')
78 79

install_subdir(
80
  'passwordsafe',
81 82 83 84 85
  install_dir: python_dir
)

message('Preparing init file')
configure_file(
86
  input: 'passwordsafe.in',
87
  output: 'gnome-passwordsafe',
88 89 90 91 92
  configuration: conf,
  install_dir: bindir
)

meson.add_install_script('meson_post_install.py')