| 1 | project('pitivi', 'c', version : '0.98', meson_version : '>= 0.36.0') |
|---|---|
| 2 | |
| 3 | python = find_program('python3') |
| 4 | intltool_merge = find_program('intltool-merge') |
| 5 | itstool = find_program('itstool') |
| 6 | msgfmt = find_program('msgfmt') |
| 7 | |
| 8 | python_dep = dependency('python3', version : '>= 3.3') |
| 9 | gst_dep = dependency('gstreamer-1.0', version : '>= 1.10.2') |
| 10 | cairo_dep = dependency('cairo') |
| 11 | pycairo_dep = dependency('py3cairo') |
| 12 | |
| 13 | gst_transcoder_dep = dependency('gst-transcoder-1.0', version : '>= 1.8.1', |
| 14 | fallback : ['gst-transcoder', 'gst_transcoder_dep']) |
| 15 | |
| 16 | pkgdatadir = join_paths(get_option('datadir'), meson.project_name()) |
| 17 | |
| 18 | git = find_program('git', required : false) |
| 19 | if git.found() |
| 20 | GITVERSION = run_command(git, 'describe', '--always').stdout().strip() |
| 21 | else |
| 22 | GITVERSION = '' |
| 23 | endif |
| 24 | |
| 25 | |
| 26 | geteenvvar = find_program('getenvvar.py') |
| 27 | cdata = configuration_data() |
| 28 | cdata.set('CONFIGURED_PYTHONPATH', |
| 29 | run_command(geteenvvar, 'PYTHONPATH').stdout().strip()) |
| 30 | cdata.set('CONFIGURED_GI_TYPELIB_PATH', |
| 31 | run_command(geteenvvar, 'GI_TYPELIB_PATH').stdout().strip()) |
| 32 | cdata.set('CONFIGURED_LD_LIBRARY_PATH', |
| 33 | run_command(geteenvvar, 'LD_LIBRARY_PATH').stdout().strip()) |
| 34 | cdata.set('CONFIGURED_GST_PLUGIN_PATH', |
| 35 | run_command(geteenvvar, 'GST_PLUGIN_PATH').stdout().strip()) |
| 36 | cdata.set('CONFIGURED_GST_PLUGIN_SYSTEM_PATH', |
| 37 | run_command(geteenvvar, 'GST_PLUGIN_SYSTEM_PATH').stdout().strip()) |
| 38 | cdata.set('LIBDIR', join_paths(get_option('prefix'), get_option('libdir'))) |
| 39 | cdata.set('DATADIR', join_paths(get_option('prefix'), get_option('datadir'))) |
| 40 | cdata.set('PACKAGE_NAME', 'Pitivi') |
| 41 | cdata.set('PACKAGE', 'pitivi') |
| 42 | cdata.set('GITVERSION', GITVERSION) |
| 43 | cdata.set('VERSION', meson.project_version()) |
| 44 | cdata.set('BUILDDIR', meson.current_build_dir()) |
| 45 | |
| 46 | coptimizations = shared_library('renderer', |
| 47 | 'pitivi/coptimizations/renderer.c', |
| 48 | dependencies: [gst_dep, python_dep, pycairo_dep, cairo_dep], |
| 49 | name_prefix : '', |
| 50 | install: true, |
| 51 | install_dir: get_option('libdir') + '/pitivi/python/pitivi/timeline') |
| 52 | |
| 53 | pitivi_install_dir = get_option('libdir') + '/pitivi/python/' |
| 54 | |
| 55 | run_command(python, '-m', 'compileall', meson.current_source_dir() + '/pitivi') |
| 56 | install_subdir('pitivi', install_dir: pitivi_install_dir) |
| 57 | |
| 58 | configure_file(input: 'pitivi/configure.py.in', |
| 59 | output: 'configure.py', |
| 60 | configuration: cdata) |
| 61 | |
| 62 | configure_file = '@0@/configure.py'.format(meson.current_build_dir()) |
| 63 | install_data(configure_file, install_dir: pitivi_install_dir + 'pitivi') |
| 64 | |
| 65 | # FIXME work around to get testsuite working |
| 66 | run_command('cp', configure_file, meson.current_source_dir() + '/pitivi') |
| 67 | |
| 68 | subdir('bin') |
| 69 | subdir('po') |
| 70 | subdir('data') |
| 71 | if not get_option('disable-help') |
| 72 | subdir('help') |
| 73 | endif |
| 74 | subdir('tests') |
| 75 | subdir('tests/validate-tests') |
| 76 | |
| 77 | archiver = find_program('git-archive-all', required : false) |
| 78 | if archiver.found() |
| 79 | prefix = 'pitivi-' + meson.project_version() |
| 80 | archive = 'pitivi-' + meson.project_version() + '.tar.gz' |
| 81 | run_target('dist', command : ['git-archive-all', '--prefix=' + prefix, archive]) |
| 82 | else |
| 83 | message('git-archive-all not found, you will not be able to run `ninja dist`') |
| 84 | message('Install git-archive-all:') |
| 85 | message(' - with pip:') |
| 86 | message(' $ pip3 install git-archive-all') |
| 87 | message(' - in the sandbox:') |
| 88 | message(' (ptv-flatpak) $ build/flatpak/py-configure --module=git-archive-all && make install') |
| 89 | endif |
rPTV/meson.build
rPTV/meson.build