Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support repo's Appstream data download and install #1844

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mcrha
Copy link
Contributor

@mcrha mcrha commented Nov 8, 2024

Repositories can provide Appstream data for the packages they contain. This Appstream data is consumed by applications like gnome-software or KDE Discover, thus the users can see the packages (apps) in them.

This is to be in pair with PackageKit, which does download and install the repo's Appstream data.

As this adds a dependency on the appstream library, there is also a CMake option WITH_APPSTREAM to be able to turn the support off. The support is enabled by default.


That is, the /var/cache/libdnf5/$REPO_NAME/repodata/ directory can have downloaded also files with appstream in their name and, when installed, the data is stored under /var/cache/swcatalog/xml/.

CC @m-blaha @jan-kolarik

Repositories can provide Appstream data for the packages they contain.
This Appstream data is consumed by applications like gnome-software or
KDE Discover, thus the users can see the packages (apps) in them.

This is to be in pair with PackageKit, which does download and install
the repo's Appstream data.

As this adds a dependency on the `appstream` library, there is also
a CMake option WITH_APPSTREAM to be able to turn the support off.
The support is enabled by default.
@mcrha
Copy link
Contributor Author

mcrha commented Nov 8, 2024

Hrm, the CI either needs to add appstream-devel (or better pkgconfig(appstream)>=1.0) dependency or turn off build of these bits with -DWITH_APPSTREAM=OFF to the cmake command. No idea how to do it, but if you could guide me I'll change it either way.

void Repo::install_appstream() {
#ifdef WITH_APPSTREAM
std::string repo_id = p_impl->config.get_id();
const char * as_basenames[] = {"appstream", "appstream-icons", NULL};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might not necessarily work when the appstream data is generated by the appstream-generator (instead of the appstream-builder), but I cannot test what the generator does in Fedora, because it's simply broken there.

Ideally, the get_metadata_path() might return a list of the repo files, which contain certain string, like in this case I'd call it appstream and any *appstream* files would be processed here, instead of knowing beforehand what file "types" can be used by whichever Appstream library and/or its version.

For example, the appstream-generator might create multiple appstream-icons files, each containing the icon size in its name, which is very bad approach, because the consumers need to be updated when the icon sizes change, to keep the list of the possible icon sizes in sync with the others.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that appdata and appdata-icons are also used (by e.g. SUSE distributions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants