Newer
Older
# Copyright © 2019-2020 Collabora Ltd.
#
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
conf_data = configuration_data()
conf_data.set_quoted('VERSION', version)
configure_file(
input : 'config.h.in',
output : '_pressure-vessel-config.h',
configuration : conf_data,
)
pv_dir = 'lib/pressure-vessel/relocatable'
pv_bindir = pv_dir + '/bin'
pv_rpath = bin_rpath
pv_c_args = ['-include', '_pressure-vessel-config.h']
# This trips some warnings in the libglnx subproject but not in
# pressure-vessel itself
pv_warning_cflags = [
'-Wsign-compare',
]
scripts = [
'pressure-vessel-locale-gen',
'pressure-vessel-test-ui',
'pressure-vessel-unruntime',
]
foreach script : scripts
install_data(
script,
)
endforeach
# Headers to scan for enum/flags types.
headers = [
'mtree.h',
launcher1 = gnome.gdbus_codegen(
'launcher1',
sources : 'com.steampowered.PressureVessel.Launcher1.xml',
interface_prefix : 'com.steampowered.PressureVessel.',
namespace : 'Pv',
)
systemd_dbus = gnome.gdbus_codegen(
'flatpak-systemd-dbus-generated',
sources : 'org.freedesktop.systemd1.xml',
interface_prefix : 'org.freedesktop.systemd1.',
namespace : 'Systemd',
)
enums = gnome.mkenums_simple(
'enumtypes',
sources : headers,
)
pressure_vessel_utils = static_library(
'pressure-vessel-utils',
sources : [
'bwrap-lock.c',
'bwrap-lock.h',
'flatpak-bwrap.c',
'flatpak-bwrap-private.h',
'flatpak-utils-base.c',
'flatpak-utils-base-private.h',
'flatpak-utils.c',
'flatpak-utils-private.h',
'mtree.c',
'mtree.h',
'tree-copy.c',
'tree-copy.h',
] + enums,
c_args : pv_c_args,
libsteamrt_static_dep,
include_directories : pv_include_dirs,
pressure_vessel_utils_dep = declare_dependency(
link_with : pressure_vessel_utils,
sources : launcher1[1],
)
launcher_codegen = static_library(
'pressure-vessel-launcher-codegen',
sources : launcher1,
dependencies : [
gio_unix,
],
c_args : silence_gdbus_codegen_warnings + pv_c_args,
include_directories : pv_include_dirs,
install: false,
)
launcher_codegen_dep = declare_dependency(
link_with : launcher_codegen,
sources : launcher1[1],
)
systemd_codegen = static_library(
'pressure-vessel-systemd-codegen',
sources : systemd_dbus,
dependencies : [
gio_unix,
],
c_args : silence_gdbus_codegen_warnings + pv_c_args,
include_directories : pv_include_dirs,
install: false,
)
systemd_codegen_dep = declare_dependency(
link_with : systemd_codegen,
sources : systemd_dbus[1],
)
'pressure-vessel-adverb',
'supported-architectures.c',
'supported-architectures.h',
'wrap-interactive.c',
'wrap-interactive.h',
c_args : pv_c_args,
pressure_vessel_utils_dep,
threads,
include_directories : pv_include_dirs,
install_dir : pv_bindir,
build_rpath : pv_rpath,
install_rpath : pv_rpath,
)
executable(
'pressure-vessel-launch',
sources: [
'launch.c',
],
c_args : pv_c_args,
dependencies : [
pressure_vessel_utils_dep,
threads,
gio_unix,
include_directories : pv_include_dirs,
install : true,
install_dir : pv_bindir,
build_rpath : pv_rpath,
install_rpath : pv_rpath,
)
executable(
'pressure-vessel-launcher',
sources: [
'launcher.c',
'portal-listener.c',
'portal-listener.h',
c_args : pv_c_args,
dependencies : [
launcher_codegen_dep,
pressure_vessel_utils_dep,
threads,
gio_unix,
include_directories : pv_include_dirs,
install : true,
install_dir : pv_bindir,
build_rpath : pv_rpath,
install_rpath : pv_rpath,
pressure_vessel_wrap_lib = static_library(
'pressure-vessel-wrap-lib',
sources : [
'bwrap.c',
'bwrap.h',
'environ.c',
'environ.h',
'exports.c',
'exports.h',
'flatpak-common-types-private.h',
'flatpak-context.c',
'flatpak-context-private.h',
'flatpak-exports.c',
'flatpak-exports-private.h',
'flatpak-run.c',
'flatpak-run-private.h',
'graphics-provider.c',
'graphics-provider.h',
'supported-architectures.c',
'supported-architectures.h',
'wrap-flatpak.c',
'wrap-flatpak.h',
'wrap-pipewire.c',
'wrap-pipewire.h',
'wrap-setup.c',
'wrap-setup.h',
c_args : pv_c_args,
pressure_vessel_utils_dep,
systemd_codegen_dep,
include_directories : pv_include_dirs,
)
pressure_vessel_wrap_lib_dep = declare_dependency(
link_with : pressure_vessel_wrap_lib,
sources : [launcher1[1], systemd_dbus[1]],
)
executable(
'pressure-vessel-wrap',
sources : [
'wrap.c',
],
c_args : pv_c_args,
dependencies : [
gio_unix,
libglnx_dep,
pressure_vessel_wrap_lib_dep,
],
include_directories : pv_include_dirs,
install_dir : pv_bindir,
build_rpath : pv_rpath,
install_rpath : pv_rpath,
)
executable(
'pressure-vessel-try-setlocale',
sources : [
'try-setlocale.c',
],
c_args : pv_c_args,
include_directories : pv_include_dirs,
install_dir : pv_bindir,
# We'd like to use bubblewrap as a Meson subproject, but then we wouldn't
# be able to set its RPATH, which we need...
executable(
'pv-bwrap',
'bwrap-main.c',
c_args : [
'-DPACKAGE_STRING="modified bubblewrap from ' + meson.project_name() + ' ' + meson.project_version() + '"',
],
dependencies: [libcap_dep, libselinux_dep],
include_directories : project_include_dirs,
install : true,
install_dir : pv_bindir,
build_rpath : pv_rpath,
install_rpath : pv_rpath,
)
if get_option('srcdir') != ''
conf_data = configuration_data()
conf_data.set('prefix', get_option('prefix'))
conf_data.set('pv_dir', pv_dir)
conf_data.set('python', python.path())
conf_data.set('sh', sh.path())
conf_data.set('srcdir', get_option('srcdir'))
conf_data.set('version', version)
install_data(
configure_file(
input : 'build-relocatable-install.in',
output : 'pressure-vessel-build-relocatable-install',
configuration : conf_data,
),
install_dir : pv_bindir,
install_mode : 'rwxr-xr-x',
)
meson.add_install_script(
python.path(),
meson.current_source_dir() / 'copy-source-code.py',
'--srcdir', meson.source_root(),
'--prefix', get_option('prefix'),
'--pressure-vessel-dir', pv_dir,
'--set-version', version,
get_option('srcdir'),
)
endif
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
if get_option('man')
foreach tool : [
'adverb',
'launch',
'launcher',
'locale-gen',
'test-ui',
'try-setlocale',
'unruntime',
'wrap',
]
custom_target(
tool + '.1',
build_by_default : true,
command : [
pandoc,
'-s',
'-o', '@OUTPUT@',
'-f', pandoc_markdown_nosmart,
'-t', 'man',
'@INPUT@',
],
input : tool + '.1.md',
output : 'pressure-vessel-' + tool + '.1',
install : true,
install_dir : join_paths(
get_option('prefix'),
get_option('mandir'),
'man1',
),
)
endforeach
endif