2021-12-21 20:38:13 +01:00
|
|
|
project('loupe', 'rust',
|
2023-09-03 18:33:08 +02:00
|
|
|
version: '45.rc',
|
2022-08-04 23:49:20 -04:00
|
|
|
meson_version: '>= 0.59.0',
|
2020-12-26 02:05:34 -08:00
|
|
|
default_options: [ 'warning_level=2',
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
i18n = import('i18n')
|
|
|
|
|
gnome = import('gnome')
|
|
|
|
|
|
2023-09-03 18:33:08 +02:00
|
|
|
dependency('gtk4', version: '>=4.12.0')
|
2023-04-26 21:17:03 +02:00
|
|
|
dependency('libadwaita-1', version: '>=1.3.99')
|
decoder: Use image-rs, libheif-rs, librsvg
This adds proper support for a lot of image formats including SVGs.
It will be the basis for many features to come. The technical core
is an asynchronous renderer that can arrange textures in smaller tiles
which might be generated on demand.
Closes #34, #40, #41, #49
Basis for fixing the following issues #7, #27, #36, #43, #68, #71
2023-03-04 03:14:52 +01:00
|
|
|
dependency('gweather4', version: '>=4.0.0')
|
2023-07-12 22:25:59 +02:00
|
|
|
# Required by glycin crate
|
2023-04-12 04:13:30 +02:00
|
|
|
dependency('lcms2', version: '>=2.12.0')
|
2020-12-26 02:05:34 -08:00
|
|
|
|
2022-08-05 00:13:59 -04:00
|
|
|
cargo = find_program('cargo', required: true)
|
|
|
|
|
|
2020-12-26 02:05:34 -08:00
|
|
|
iv_prefix = get_option('prefix')
|
2022-08-05 00:21:23 -04:00
|
|
|
iv_bindir = iv_prefix / get_option('bindir')
|
|
|
|
|
iv_localedir = iv_prefix / get_option('localedir')
|
|
|
|
|
iv_datadir = iv_prefix / get_option('datadir')
|
|
|
|
|
iv_pkgdatadir = iv_datadir / meson.project_name()
|
2020-12-26 02:05:34 -08:00
|
|
|
|
|
|
|
|
profile = ''
|
|
|
|
|
version_suffix = ''
|
|
|
|
|
|
2023-03-01 08:42:22 -05:00
|
|
|
if get_option('profile') != 'release'
|
2020-12-26 02:05:34 -08:00
|
|
|
profile = '.Devel'
|
2022-11-07 16:19:27 +01:00
|
|
|
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
|
2020-12-26 02:05:34 -08:00
|
|
|
if vcs_tag == ''
|
|
|
|
|
version_suffix = '-devel'
|
|
|
|
|
else
|
|
|
|
|
version_suffix = '-@0@'.format(vcs_tag)
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2021-09-28 17:44:26 -07:00
|
|
|
app_id = 'org.gnome.Loupe@0@'.format(profile)
|
2020-12-26 02:05:34 -08:00
|
|
|
iv_version = meson.project_version() + version_suffix
|
|
|
|
|
|
|
|
|
|
cargo_sources = files(
|
|
|
|
|
'Cargo.toml',
|
|
|
|
|
'Cargo.lock',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
conf = configuration_data()
|
|
|
|
|
conf.set('APP_ID', app_id)
|
|
|
|
|
conf.set('PROFILE', profile)
|
|
|
|
|
conf.set('VERSION', iv_version)
|
2022-11-23 17:44:04 +01:00
|
|
|
conf.set('BIN_NAME', meson.project_name())
|
2020-12-26 02:05:34 -08:00
|
|
|
conf.set('bindir', iv_bindir)
|
|
|
|
|
conf.set('localedir', iv_localedir)
|
|
|
|
|
conf.set('pkgdatadir', iv_pkgdatadir)
|
|
|
|
|
|
|
|
|
|
subdir('data')
|
2023-06-21 09:15:37 -04:00
|
|
|
subdir('help')
|
2020-12-26 02:05:34 -08:00
|
|
|
subdir('src')
|
|
|
|
|
subdir('po')
|
|
|
|
|
|
2021-09-29 00:48:00 -07:00
|
|
|
# Pre-commit hook for rust formatting
|
|
|
|
|
if get_option('profile') == 'development'
|
|
|
|
|
message('Setting up git pre-commit hook..')
|
2022-11-07 16:19:27 +01:00
|
|
|
run_command('cp', '-f', 'hooks/pre-commit.hook', '.git/hooks/pre-commit', check: false)
|
2021-09-29 00:48:00 -07:00
|
|
|
endif
|
|
|
|
|
|
2022-08-04 23:49:20 -04:00
|
|
|
gnome.post_install(
|
|
|
|
|
gtk_update_icon_cache: true,
|
|
|
|
|
update_desktop_database: true,
|
|
|
|
|
)
|
2023-04-02 17:45:51 -04:00
|
|
|
|
|
|
|
|
meson.add_dist_script(
|
|
|
|
|
'build-aux/meson/dist-vendor.sh',
|
|
|
|
|
join_paths(meson.project_build_root(), 'meson-dist', meson.project_name() + '-' + meson.project_version()),
|
2023-04-04 23:20:42 +02:00
|
|
|
meson.project_source_root()
|
2023-04-02 17:45:51 -04:00
|
|
|
)
|