Use app ID for release/dev version of app in metadata and desktop files

This commit is contained in:
Avery
2023-11-18 18:13:30 -05:00
parent 79e2dea0fe
commit 7d63fee5f7
4 changed files with 29 additions and 20 deletions

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>cafe.avery.Delfin</id>
<id>@APP_ID@</id>
<name>Delfin</name>
<summary>Stream movies and TV shows from Jellyfin</summary>
<metadata_license>CC-BY-SA-4.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<project_license>GPL-3.0-only</project_license>
<content_rating type="oars-1.1" />
@@ -21,9 +21,9 @@
</p>
</description>
<launchable type="desktop-id">cafe.avery.Delfin.desktop</launchable>
<launchable type="desktop-id">@APP_ID@.desktop</launchable>
<icon type="stock">cafe.avery.Delfin</icon>
<icon type="stock">@APP_ID@</icon>
<categories>
<category>AudioVideo</category>

View File

@@ -2,7 +2,13 @@ subdir('icons')
ascli_exe = find_program('appstreamcli')
metainfo_file = 'cafe.avery.Delfin.metainfo.xml'
metainfo_file = configure_file(
input: 'cafe.avery.Delfin.metainfo.xml.in',
output: '@0@.metainfo.xml'.format(app_id),
configuration: {
'APP_ID': app_id,
},
)
# Validate MetaInfo file
if ascli_exe.found()
@@ -15,11 +21,18 @@ if ascli_exe.found()
)
endif
install_data(
metainfo_file,
install_dir: datadir / meson.project_name(),
)
desktop_file = '@0@.desktop'.format(app_id)
# Create desktop-entry file from metainfo
custom_target('gen-desktop-entry',
input : [metainfo_file],
output : ['cafe.avery.Delfin.desktop'],
output : [desktop_file],
command : [ascli_exe, 'make-desktop-file', '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: join_paths (get_option ('datadir'), 'applications')
install_dir: appsdir,
)

View File

@@ -13,8 +13,9 @@ run_command(
check: true
)
cargo_options = []
cargo = find_program('cargo', required: true)
cargo_options = ['--target-dir', meson.project_build_root() / 'delfin']
rust_target = 'debug'
if get_option('profile') == 'release'
@@ -22,11 +23,6 @@ if get_option('profile') == 'release'
rust_target = 'release'
endif
cargo_options += ['--target-dir', meson.project_build_root() / 'delfin']
prefix = get_option('prefix')
bindir = prefix / get_option('bindir')
custom_target(
'cargo-build',
build_by_default: true,
@@ -37,6 +33,6 @@ custom_target(
cargo, 'build', cargo_options,
'&&', 'cp', 'delfin' / rust_target / meson.project_name(), '@OUTPUT@',
],
install: get_option('flatpak'),
install: true,
install_dir: bindir,
)

View File

@@ -6,16 +6,12 @@ project(
subproject_dir: 'video_player_mpv',
)
gnome = import('gnome')
base_id = 'cafe.avery.Delfin'
cargo = find_program('cargo', required: true)
dependency('gtk4', version: '>= 4.0.0')
dependency('libadwaita-1', version: '>= 1.4')
dependency('mpv', version: '>= 2.1.0')
base_id = 'cafe.avery.Delfin'
if get_option('profile') == 'dev'
app_id = '@0@.@1@'.format(base_id, 'Devel')
else
@@ -31,13 +27,17 @@ if get_option('flatpak')
endif
prefix = get_option('prefix')
bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
appsdir = datadir / 'applications'
iconsdir = datadir / 'icons'
subproject('sys')
subdir('delfin')
subdir('data')
gnome = import('gnome')
gnome.post_install(
gtk_update_icon_cache: true,
update_desktop_database: true,
)