2023-04-17 23:50:18 +02:00
|
|
|
mime_types = []
|
|
|
|
|
|
|
|
|
|
# image-rs
|
|
|
|
|
mime_types += [
|
|
|
|
|
'image/jpeg',
|
|
|
|
|
'image/png',
|
|
|
|
|
'image/gif',
|
|
|
|
|
'image/webp',
|
|
|
|
|
'image/tiff',
|
|
|
|
|
# TGA
|
|
|
|
|
'image/x-tga',
|
|
|
|
|
# DDS
|
|
|
|
|
'image/vnd-ms.dds',
|
|
|
|
|
'image/x-dds',
|
|
|
|
|
'image/bmp',
|
|
|
|
|
# .ico
|
|
|
|
|
'image/vnd.microsoft.icon',
|
|
|
|
|
# HDR
|
|
|
|
|
'image/vnd.radiance',
|
|
|
|
|
# OpenEXR
|
|
|
|
|
'image/x-exr',
|
|
|
|
|
# PNM
|
|
|
|
|
'image/x-portable-bitmap',
|
|
|
|
|
'image/x-portable-graymap',
|
|
|
|
|
'image/x-portable-pixmap',
|
|
|
|
|
'image/x-portable-anymap',
|
|
|
|
|
# Qoi's MIME type is being worked on.
|
|
|
|
|
# See: https://github.com/phoboslab/qoi/issues/167
|
|
|
|
|
'image/x-qoi',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# SVG
|
|
|
|
|
mime_types += [
|
|
|
|
|
'image/svg+xml',
|
|
|
|
|
'image/svg+xml-compressed',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# HEIF
|
|
|
|
|
mime_types += [
|
|
|
|
|
'image/avif',
|
|
|
|
|
'image/heic',
|
|
|
|
|
]
|
|
|
|
|
|
2023-07-24 16:30:52 +02:00
|
|
|
# JXL
|
|
|
|
|
mime_types += [
|
|
|
|
|
'image/jxl',
|
|
|
|
|
]
|
|
|
|
|
|
2024-09-27 20:52:07 +02:00
|
|
|
conf = configuration_data()
|
|
|
|
|
conf.set('APP_ID', app_id)
|
|
|
|
|
conf.set('BIN_NAME', meson.project_name())
|
|
|
|
|
conf.set('BINDIR', bindir)
|
2023-04-17 23:50:18 +02:00
|
|
|
conf.set('MIME_TYPES', ';'.join(mime_types) + ';')
|
|
|
|
|
|
2020-12-26 02:05:34 -08:00
|
|
|
desktop_file = i18n.merge_file(
|
|
|
|
|
input: configure_file(
|
2021-09-28 17:44:26 -07:00
|
|
|
input: 'org.gnome.Loupe.desktop.in.in',
|
|
|
|
|
output: 'org.gnome.Loupe.desktop.in',
|
2020-12-26 02:05:34 -08:00
|
|
|
configuration: conf,
|
|
|
|
|
),
|
|
|
|
|
output: '@0@.desktop'.format(app_id),
|
|
|
|
|
type: 'desktop',
|
|
|
|
|
po_dir: '../po',
|
|
|
|
|
install: true,
|
2024-09-27 20:52:07 +02:00
|
|
|
install_dir: datadir / 'applications',
|
2020-12-26 02:05:34 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
configure_file(
|
2024-09-27 20:52:07 +02:00
|
|
|
input: 'org.gnome.Loupe.service.in',
|
|
|
|
|
output: '@0@.service'.format(app_id),
|
|
|
|
|
configuration: conf,
|
|
|
|
|
install: true,
|
|
|
|
|
install_dir: datadir / 'dbus-1' / 'services',
|
2020-12-26 02:05:34 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
desktop_utils = find_program('desktop-file-validate', required: false)
|
|
|
|
|
if desktop_utils.found()
|
2024-09-27 20:52:07 +02:00
|
|
|
test('Validate desktop file', desktop_utils, args: [desktop_file])
|
2020-12-26 02:05:34 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
appstream_file = i18n.merge_file(
|
|
|
|
|
input: configure_file(
|
2022-10-06 16:22:38 +02:00
|
|
|
input: 'org.gnome.Loupe.metainfo.xml.in.in',
|
|
|
|
|
output: 'org.gnome.Loupe.metainfo.xml.in',
|
2020-12-26 02:05:34 -08:00
|
|
|
configuration: conf,
|
|
|
|
|
),
|
2022-10-06 16:22:38 +02:00
|
|
|
output: '@0@.metainfo.xml'.format(app_id),
|
2020-12-26 02:05:34 -08:00
|
|
|
po_dir: '../po',
|
|
|
|
|
install: true,
|
2024-09-27 20:52:07 +02:00
|
|
|
install_dir: datadir / 'metainfo',
|
2020-12-26 02:05:34 -08:00
|
|
|
)
|
|
|
|
|
|
2023-12-22 04:12:53 +03:00
|
|
|
# Validate Appdata
|
|
|
|
|
appstreamcli = find_program('appstreamcli', required: false)
|
|
|
|
|
if (appstreamcli.found())
|
2024-09-27 20:52:07 +02:00
|
|
|
test(
|
|
|
|
|
'Validate metainfo file',
|
2023-12-22 04:12:53 +03:00
|
|
|
appstreamcli,
|
|
|
|
|
args: ['validate', '--no-net', appstream_file],
|
2024-09-27 20:52:07 +02:00
|
|
|
workdir: meson.current_build_dir(),
|
2023-12-22 04:12:53 +03:00
|
|
|
)
|
|
|
|
|
endif
|
|
|
|
|
|
2023-04-02 01:39:23 +02:00
|
|
|
subdir('icons')
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2023-12-05 17:24:53 +01:00
|
|
|
# GSchema
|
|
|
|
|
gschema_conf = configuration_data()
|
|
|
|
|
gschema_conf.set('app-id', app_id)
|
|
|
|
|
gschema_conf.set('gettext-package', meson.project_name())
|
|
|
|
|
configure_file(
|
2024-09-27 21:22:52 +02:00
|
|
|
input: 'org.gnome.Loupe.gschema.xml.in',
|
2023-12-05 17:24:53 +01:00
|
|
|
output: '@0@.gschema.xml'.format(app_id),
|
|
|
|
|
configuration: gschema_conf,
|
|
|
|
|
install: true,
|
2024-09-27 20:52:07 +02:00
|
|
|
install_dir: datadir / 'glib-2.0' / 'schemas',
|
2023-12-05 17:24:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Validate GSchema
|
|
|
|
|
test(
|
2024-09-27 20:52:07 +02:00
|
|
|
'validate-gschema',
|
|
|
|
|
glib_compile_schemas,
|
|
|
|
|
args: ['--strict', '--dry-run', meson.current_source_dir()],
|
|
|
|
|
)
|