flathub / org.freedesktop.appstream.cli

https://flathub.org/apps/details/org.freedesktop.appstream.cli
0 stars 1 forks source link

how to run appstreamcli from a manifest #1

Closed fedelibre closed 2 years ago

fedelibre commented 2 years ago

I want to run appstreamcli in a post-install section of my manifest and I'm wondering how can I launch it. Shouldn't appstreamcli be an SDK extension (org.freedesktop.Sdk.appstream.cli)?

$ flatpak run org.freedesktop.appstream.cli   appstreamcli --version
AppStream version: 0.15.2

$ flatpak run org.freedesktop.Sdk//21.08  appstreamcli --version
/bin/sh: appstreamcli: No such file or directory

$ flatpak run org.freedesktop.Platform//21.08  appstreamcli --version
/bin/sh: appstreamcli: No such file or directory
hfiguiere commented 2 years ago

why do you want to run it in a post install?

ximion commented 2 years ago

why do you want to run it in a post install?

appstreamcli is (also) a developer tool and can validate metadata in upstream projects as well as assemble metainfo files from other files. For example, projects may want to write its changelog in a NEWS file or a YAML file (which is a bit nicer to write than XML) and have appstreamcli create the final metainfo file with release information included from that source data at build-time. For that and validation projects may require appstreamcli to be present in order to build correctly.

fedelibre commented 2 years ago

why do you want to run it in a post install?

Ideally, this should be run upstream, but I was not able to add a working target in the Makefile (Denemo is using Automake and intltool). I had a private discussion with two Denemo developers about this matter, but the issue was not solved.

As I want to make a new flatpak release soon, I think I'll run appstreamcli on the sources and produce a patch for the flatpak manifest. But I don't want to do this for every release, so I prefer being able to run appstreamcli within the manifest.

In general, my experience with appstream by @ximion has always been way better than appstream-util (both validation and news-to-metainfo script). I wonder if org.freedesktop.Sdk should include it by default.. alternatively, it could be a org.freedesktop.Sdk extension?

fedelibre commented 2 years ago

I think I'll run appstreamcli on the sources and produce a patch for the flatpak manifest.

Question for @ximion : news-to-metainfo can't parse the <_summary> and <_p> tags used by intltool to mark a string as translatable, right? See this patch generated by appstreamcli. Flatpak build won't pass the validation.

Please don't tell me that the only way to fix this is porting Denemo from intltool to Gettext! :-) I know it would be a good thing, but...

ximion commented 2 years ago

Please don't tell me that the only way to fix this is porting Denemo from intltool to Gettext! :-) I know it would be a good thing, but...

Hmm, in that case I will not say it, but just leave this link here... https://wiki.gnome.org/MigratingFromIntltoolToGettext ;-)

fedelibre commented 2 years ago

I'm closing this issue because:

  1. I've learned that the recommended practice is building the metainfo when generating the tarball, so it's an upstream issue.
  2. appstreamcli will be available in Freedesktop 22.08, see this commit