project( 'driftwood', 'rust', version: '0.1.0', license: 'GPL-3.0-or-later', meson_version: '>= 0.62.0', ) i18n = import('i18n') gnome = import('gnome') app_id = 'app.driftwood.Driftwood' prefix = get_option('prefix') bindir = prefix / get_option('bindir') datadir = prefix / get_option('datadir') localedir = prefix / get_option('localedir') iconsdir = datadir / 'icons' # Install desktop file install_data( 'data' / app_id + '.desktop', install_dir: datadir / 'applications', ) # Install AppStream metainfo install_data( 'data' / app_id + '.metainfo.xml', install_dir: datadir / 'metainfo', ) # Compile and install GSettings schema install_data( 'data' / app_id + '.gschema.xml', install_dir: datadir / 'glib-2.0' / 'schemas', ) gnome.post_install(glib_compile_schemas: true) # Build the Rust binary via Cargo cargo = find_program('cargo') cargo_build_type = get_option('buildtype') == 'release' ? '--release' : '' custom_target( 'driftwood-binary', output: 'driftwood', command: [ cargo, 'build', cargo_build_type, '--manifest-path', meson.project_source_root() / 'Cargo.toml', '--target-dir', meson.project_build_root() / 'cargo-target', ], env: { 'LOCALEDIR': localedir, 'GSETTINGS_SCHEMA_DIR': datadir / 'glib-2.0' / 'schemas', }, build_by_default: true, install: false, ) # Install the binary (from the cargo output directory) cargo_profile = get_option('buildtype') == 'release' ? 'release' : 'debug' install_data( meson.project_build_root() / 'cargo-target' / cargo_profile / 'driftwood', install_dir: bindir, install_mode: 'rwxr-xr-x', ) # Translations subdir('po')