meson.build 3.56 KB
Newer Older
Alexandru Băluț's avatar
Alexandru Băluț committed
1
project('pitivi', 'c', version : '1.90.0.1', meson_version : '>= 0.46.0')
2
host_system = host_machine.system()
Thibault Saunier's avatar
Thibault Saunier committed
3

Alexandru Băluț's avatar
Alexandru Băluț committed
4 5 6 7 8 9 10
pymod = import('python')
python = pymod.find_installation(get_option('python'))
pythonver = python.language_version()
# Workaround for https://github.com/mesonbuild/meson/issues/5629
# https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
python_dep = dependency('python-@0@-embed'.format(pythonver), version: '>= 3.3', required: false)
if not python_dep.found()
11
  python_dep = python.dependency(version: '>= 3.3')
Alexandru Băluț's avatar
Alexandru Băluț committed
12
endif
Thibault Saunier's avatar
Thibault Saunier committed
13

14 15 16 17 18 19 20 21 22 23 24 25
if get_option('build-gst')
    subproject('gst-build', default_options: ['enable_python=true',
        'disable_gstreamer_sharp=true', 'disable_rtsp_server=true',
        'gst-devtools:disable_gtkdoc=true',
        'gst-editing-services:disable_gtkdoc=true',
        'gst-plugins-base:disable_gtkdoc=true',
        'gstreamer:disable_gtkdoc=true',
        ])
endif

gst_dep = dependency('gstreamer-1.0', version : '>= 1.14.1',
    fallback : ['gstreamer', 'gst_dep'])
Thibault Saunier's avatar
Thibault Saunier committed
26 27 28
cairo_dep = dependency('cairo')
pycairo_dep = dependency('py3cairo')

Piotr Drąg's avatar
Piotr Drąg committed
29 30 31 32 33
gnome = import('gnome')
i18n = import('i18n')

podir = join_paths(meson.current_source_dir(), 'po')
itsdir = join_paths(meson.current_source_dir(), 'gettext')
34
pkgdatadir = join_paths(get_option('datadir'), meson.project_name())
Thibault Saunier's avatar
Thibault Saunier committed
35

36 37 38 39 40 41 42
git = find_program('git', required : false)
if git.found()
    GITVERSION = run_command(git, 'describe', '--always').stdout().strip()
else
    GITVERSION = ''
endif

43 44

geteenvvar = find_program('getenvvar.py')
Thibault Saunier's avatar
Thibault Saunier committed
45
cdata = configuration_data()
46 47 48 49 50 51 52 53 54 55
cdata.set('CONFIGURED_PYTHONPATH',
          run_command(geteenvvar, 'PYTHONPATH').stdout().strip())
cdata.set('CONFIGURED_GI_TYPELIB_PATH',
          run_command(geteenvvar, 'GI_TYPELIB_PATH').stdout().strip())
cdata.set('CONFIGURED_LD_LIBRARY_PATH',
          run_command(geteenvvar, 'LD_LIBRARY_PATH').stdout().strip())
cdata.set('CONFIGURED_GST_PLUGIN_PATH',
          run_command(geteenvvar, 'GST_PLUGIN_PATH').stdout().strip())
cdata.set('CONFIGURED_GST_PLUGIN_SYSTEM_PATH',
          run_command(geteenvvar, 'GST_PLUGIN_SYSTEM_PATH').stdout().strip())
56 57
cdata.set('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
cdata.set('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
Thibault Saunier's avatar
Thibault Saunier committed
58 59 60 61 62 63
cdata.set('PACKAGE_NAME', 'Pitivi')
cdata.set('PACKAGE', 'pitivi')
cdata.set('GITVERSION', GITVERSION)
cdata.set('VERSION', meson.project_version())
cdata.set('BUILDDIR', meson.current_build_dir())

64 65 66 67 68 69
module_suffix = []
# Python cannot import default .dylib, changed suffix to .so instead
if ['darwin', 'ios'].contains(host_system)
    module_suffix = 'so'
endif

Thibault Saunier's avatar
Thibault Saunier committed
70 71 72 73
coptimizations = shared_library('renderer',
    'pitivi/coptimizations/renderer.c',
    dependencies: [gst_dep, python_dep, pycairo_dep, cairo_dep],
    name_prefix : '',
74
    name_suffix: module_suffix,
Thibault Saunier's avatar
Thibault Saunier committed
75 76 77 78 79 80 81 82 83 84
    install: true,
    install_dir: get_option('libdir') + '/pitivi/python/pitivi/timeline')

pitivi_install_dir = get_option('libdir') + '/pitivi/python/'

run_command(python, '-m', 'compileall', meson.current_source_dir() + '/pitivi')
install_subdir('pitivi', install_dir: pitivi_install_dir)

configure_file(input: 'pitivi/configure.py.in',
               output: 'configure.py',
85 86
               configuration: cdata,
               install_dir: pitivi_install_dir + 'pitivi')
Thibault Saunier's avatar
Thibault Saunier committed
87 88 89 90 91 92 93 94 95 96 97 98 99

configure_file = '@0@/configure.py'.format(meson.current_build_dir())

# FIXME work around to get testsuite working
run_command('cp', configure_file, meson.current_source_dir() + '/pitivi')

subdir('bin')
subdir('po')
subdir('data')
if not get_option('disable-help')
    subdir('help')
endif
subdir('tests')
100
subdir('tests/validate-tests')