2020-04-08 09:34:58 +00:00
|
|
|
project(
|
|
|
|
'lutris',
|
2022-04-03 23:28:00 +00:00
|
|
|
license: 'GPL-3.0-or-later',
|
|
|
|
meson_version: '>=0.46.0',
|
2020-04-08 09:34:58 +00:00
|
|
|
)
|
2019-07-01 09:05:11 +00:00
|
|
|
|
2020-06-18 13:12:35 +00:00
|
|
|
# Find Python installation
|
|
|
|
python = import('python').find_installation()
|
2019-07-01 09:05:11 +00:00
|
|
|
|
2020-04-08 09:34:58 +00:00
|
|
|
# Set folders
|
2020-06-18 02:15:45 +00:00
|
|
|
prefix = get_option('prefix')
|
2020-04-08 09:34:58 +00:00
|
|
|
bindir = get_option('bindir')
|
2020-06-18 13:12:35 +00:00
|
|
|
pylibdir = python.get_install_dir()
|
2020-04-08 09:34:58 +00:00
|
|
|
datadir = get_option('datadir')
|
|
|
|
localedir = get_option('localedir')
|
2020-06-18 13:12:35 +00:00
|
|
|
mandir = get_option('mandir')
|
2020-06-17 19:51:45 +00:00
|
|
|
lutrisdir = join_paths(pylibdir, 'lutris')
|
2020-11-04 10:34:26 +00:00
|
|
|
podir = join_paths(meson.source_root(), 'po')
|
2020-06-17 19:51:45 +00:00
|
|
|
|
|
|
|
# Generate configuration files
|
|
|
|
config = configuration_data()
|
|
|
|
config.set('localedir_path', join_paths(prefix, localedir))
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
input: 'optional_settings.py.in',
|
|
|
|
output: 'optional_settings.py',
|
|
|
|
configuration: config,
|
|
|
|
install_dir: lutrisdir,
|
|
|
|
)
|
2020-04-08 09:34:58 +00:00
|
|
|
|
2020-06-18 13:12:35 +00:00
|
|
|
# Translations
|
2020-04-08 09:34:58 +00:00
|
|
|
subdir('po')
|
|
|
|
|
2019-07-01 09:05:11 +00:00
|
|
|
# Do installation
|
2020-06-18 13:12:35 +00:00
|
|
|
install_data(
|
|
|
|
files('bin/lutris'),
|
2020-04-08 09:34:58 +00:00
|
|
|
install_dir: bindir,
|
|
|
|
install_mode: 'rwxr-xr-x',
|
|
|
|
)
|
2020-06-18 13:12:35 +00:00
|
|
|
|
2020-04-08 09:34:58 +00:00
|
|
|
install_subdir(
|
|
|
|
'lutris',
|
|
|
|
install_dir: pylibdir,
|
|
|
|
)
|
2020-06-18 13:12:35 +00:00
|
|
|
|
|
|
|
install_subdir(
|
|
|
|
'share/icons',
|
|
|
|
install_dir: join_paths(datadir, 'icons'),
|
|
|
|
strip_directory: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
install_subdir(
|
|
|
|
'share/lutris',
|
|
|
|
install_dir: join_paths(datadir, 'lutris'),
|
|
|
|
strip_directory: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
install_man(
|
2020-07-14 07:20:35 +00:00
|
|
|
files('share/man/man1/lutris.1'),
|
2020-06-18 13:12:35 +00:00
|
|
|
install_dir: join_paths(mandir, 'man1'),
|
|
|
|
)
|
|
|
|
|
2022-03-15 10:06:32 +00:00
|
|
|
desktop_file = i18n.merge_file(
|
2020-11-04 10:34:26 +00:00
|
|
|
input: files('share/applications/net.lutris.Lutris.desktop'),
|
|
|
|
output: 'net.lutris.Lutris.desktop',
|
|
|
|
type: 'desktop',
|
|
|
|
po_dir: podir,
|
|
|
|
install: true,
|
|
|
|
install_dir: join_paths(datadir, 'applications'),
|
|
|
|
)
|
|
|
|
|
2022-03-15 10:06:32 +00:00
|
|
|
# Validate the desktop file
|
|
|
|
desktop_file_validate = find_program('desktop-file-validate', required:false)
|
|
|
|
if desktop_file_validate.found()
|
|
|
|
test (
|
|
|
|
'Validate desktop file',
|
|
|
|
desktop_file_validate,
|
|
|
|
args: [ desktop_file.full_path() ],
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
|
|
|
metainfo_file = i18n.merge_file(
|
2020-11-04 10:34:26 +00:00
|
|
|
input: files('share/metainfo/net.lutris.Lutris.metainfo.xml'),
|
|
|
|
output: 'net.lutris.Lutris.metainfo.xml',
|
|
|
|
type: 'xml',
|
|
|
|
po_dir: podir,
|
|
|
|
install: true,
|
2020-06-18 13:12:35 +00:00
|
|
|
install_dir: join_paths(datadir, 'metainfo'),
|
2020-04-08 09:34:58 +00:00
|
|
|
)
|
2022-03-15 10:06:32 +00:00
|
|
|
|
|
|
|
# Validate the metainfo file
|
|
|
|
appstreamcli = find_program('appstream-util', required: false)
|
|
|
|
if appstreamcli.found()
|
|
|
|
test (
|
|
|
|
'Validate metainfo file',
|
|
|
|
appstreamcli,
|
|
|
|
args: ['validate-relax', '--nonet', metainfo_file.full_path() ]
|
|
|
|
)
|
|
|
|
endif
|
2022-03-15 10:16:37 +00:00
|
|
|
|
|
|
|
meson.add_install_script('utils/meson_post_install.py')
|