Add flatpak metadata and improve meson system

This commit is contained in:
Bnyro 2023-06-26 13:32:03 +02:00
parent eb8a01c27e
commit 7494340afb
11 changed files with 88 additions and 17 deletions

View File

@ -1,5 +1,5 @@
{
"C_Cpp.default.compileCommands": "builddir/vscode_compile_commands.json",
"C_Cpp.default.compileCommands": "_build/vscode_compile_commands.json",
"files.watcherExclude": {
"**/.dart_tool": true,
".flatpak/**": true,

View File

@ -10,9 +10,10 @@
"command": "lemoa",
"finish-args": [
"--share=ipc",
"--share=network",
"--device=dri",
"--socket=fallback-x11",
"--socket=wayland",
"--device=dri",
"--env=RUST_LOG=lemoa=debug",
"--env=G_MESSAGES_DEBUG=none",
"--env=RUST_BACKTRACE=1"
@ -40,7 +41,7 @@
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"-Dprofile=development"
"-Dprofile=default"
],
"sources": [
{

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<schemalist>
<schema path="/com/lemmygtk/lemoa" id="@BASE_ID@">
</schema>
</schemalist>

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>@BASE_ID@</id>
<metadata_license>CC0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>@NAME@</name>
<summary>Gtk client for Lemmy</summary>
<description>
<p>A native Gtk client for the Lemmyverse</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/lemmy-gtk/lemoa/main/data/screenshots/posts.png</image>
<caption>Posts view</caption>
</screenshot>
<screenshot>
<image>https://raw.githubusercontent.com/lemmy-gtk/lemoa/main/data/screenshots/community.png</image>
<caption>Community view</caption>
</screenshot>
</screenshots>
<url type="homepage">https://github.com/lemmy-gtk/lemoa</url>
<url type="bugtracker">https://github.com/lemmy-gtk/lemoa/issues</url>
<content_rating type="oars-1.0" />
<releases>
<release version="0.1.0" date="2023-06-26">
<description>
<ul>
<li>Initial release</li>
</ul>
</description>
</release>
</releases>
<kudos>
<!--
GNOME Software kudos:
https://gitlab.gnome.org/GNOME/gnome-software/blob/master/doc/kudos.md
-->
<kudo>ModernToolkit</kudo>
<kudo>HiDpiIcon</kudo>
</kudos>
<developer_name>Bnyro</developer_name>
<update_contact>bnyro@tutanota.com</update_contact>
<launchable type="desktop-id">@app-id@.desktop</launchable>
<platform>GTK 4</platform>
</component>

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

13
data/icons/meson.build Normal file
View File

@ -0,0 +1,13 @@
# Scalable icon
install_data(
'@0@.svg'.format(base_id),
install_dir: iconsdir / 'hicolor' / 'scalable' / 'apps',
rename: '@0@.svg'.format(application_id)
)
# Symbolic icon
install_data(
'@0@-symbolic.svg'.format(base_id),
install_dir: iconsdir / 'hicolor' / 'symbolic' / 'apps',
rename: '@0@-symbolic.svg'.format(application_id)
)

View File

@ -2,6 +2,7 @@ desktop_conf = configuration_data()
desktop_conf.set('NAME', meson.project_name())
desktop_conf.set('ICON', application_id)
desktop_conf.set('APP_ID', application_id)
desktop_conf.set('BASE_ID', base_id)
desktop_conf.set('EXEC', meson.project_name())
# Desktop file
@ -10,19 +11,24 @@ configure_file(
output: '@BASENAME@',
install: true,
configuration: desktop_conf,
install_dir: applicationsdir
install_dir: metainfodir
)
# Scalable icon
install_data(
'@0@.svg'.format(base_id),
install_dir: iconsdir / 'hicolor' / 'scalable' / 'apps',
rename: '@0@.svg'.format(application_id)
# Metainfo file
configure_file(
input: '@0@.metainfo.xml.in'.format(base_id),
output: '@BASENAME@',
install: true,
configuration: desktop_conf,
install_dir: metainfodir
)
# Symbolic icon
install_data(
'@0@-symbolic.svg'.format(base_id),
install_dir: iconsdir / 'hicolor' / 'symbolic' / 'apps',
rename: '@0@-symbolic.svg'.format(application_id)
configure_file(
input: '@0@.gschema.xml.in'.format(base_id),
output: '@0@.gschema.xml'.format(application_id),
configuration: desktop_conf,
install: true,
install_dir: datadir / 'glib-2.0' / 'schemas'
)
subdir('icons')

View File

@ -28,6 +28,7 @@ bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
iconsdir = datadir / 'icons'
applicationsdir = datadir / 'applications'
metainfodir = datadir / 'metainfo'
pkgdatadir = datadir / meson.project_name()
# Add a version suffix for devel builds

View File

@ -1,4 +1,4 @@
pub const NAME: &str = "lemoa";
pub const APP_ID: &str = "com.lemmygtk.lemoa.Devel";
pub const APP_ID: &str = "com.lemmygtk.lemoa";
pub const PKGDATADIR: &str = "/app/share/lemoa";
pub const VERSION: &str = "0.1.0-8e019361";
pub const VERSION: &str = "0.1.0";

View File

@ -1,6 +1,6 @@
# Configuration file
conf = configuration_data()
conf.set_quoted('NAME', meson.projet_name())
conf.set_quoted('NAME', meson.project_name())
conf.set_quoted('APP_ID', application_id)
conf.set_quoted('PKGDATADIR', pkgdatadir)
conf.set_quoted('VERSION', version + version_suffix)