diff --git a/NEWS b/NEWS index 4accbd8..1ec7b64 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,78 @@ +Version 1.0.5 +~~~~~~~~~~~~~ +Released: 2025-04-24 + +Features: + * qt: Expose markup conversion utils + * desktop-styles: Add android and iOS + * validator: Check for xml:lang="en" being used on description template elements + * validator: Flag cases of raw text in "description" elements + * metadata: Add more known extensions into as_metadata_file_guess_style() + +Specification: + * docs: Clarify that the style segment of a screenshot environment is optional + * docs: Explain consequences of defining an icon for desktop-app metainfo + * docs: Clarify that description content must be in p/li elements + +Bugfixes: + * validator: mark as_validator_issue_tag_list static + * docs: Add workaround for gi-docgen misnaming devhelp files + * compose: Do not permit SVG images as screenshots + * compose: Don't "forget" to scan remaining paths when re-encountering a dir + * pool: Try explicit singular term match if we only have low-quality tokens + * utils: Provide compatibility with Fedora icon tarballs when installing them + * utils: Remove leftover g_chmod() + * zstd-decompressor: Pass output/written data when decompression finished + * utils: Expect a dash in icons file name + * utils: Recognize .yml* and .yaml* file extension variants, and .zst extension + * utils: Rename the appstream file when re-saving it on install + +Contributors: + Alyssa Ross, Ismael Asensio, Kolja, Matthias Klumpp, Milan Crha + +Version 1.0.4 +~~~~~~~~~~~~~ +Released: 2024-12-08 + +Features: + * bundle: Add AS_BUNDLE_KIND_SYSUPDATE + * desktop-style-ids: Add dark support for Plasma + * desktop-style-ids: add pantheon:dark + * qt: Expose branding color + * sysinfo: Add memory size detection support for Illumos and Solaris + * sysinfo: Add memory size detection support for GNU/Hurd + * validator: Don't fail validation if a snapshot release is missing a time + +Specification: + * docs: Note that support for some legacy path was dropped in 1.0 + * docs: Update fd.o spec URLs + * docs: Better explain desktop applications + * Update ESRA website URL + +Bugfixes: + * validator: Make sure we read an initialised variable + * qt: Specify utc as the dates' timezone + * tests: Ignore some tests on Windows + * sysinfo: make uname() usage POSIX compliant + * Only emit legacy compat tag developer_name for catalog data + * compose: Allow file discovery even in symlinked directories + * Avoid a race condition when loading GResource data + * validator: Mention length limit in summary length warning message + * utils: Explicitly set permissions on installed metadata files + * as-vercmp: Fix gtkdoc to not start with '>' + +Miscellaneous: + * desktop-style-ids: Remove Endless + * ci: Fix FreeBSD build (update `py-gi-docgen`) + * ci: Update to Ubuntu 24.04 for Debian Testing builds + * utils: Assume 64px as size when installing an icon tarball of unknown size + +Contributors: + Adrien Plazas, Airat Makhmutov, Aleix Pol, Carl Schwan, + Cassidy James Blaede, Danielle Foré, Elliott Sales de Andrade, + James Addison, Marcel Telka, Matthias Klumpp, Roke Julian Lockhart, + Pino Toscano, sid + Version 1.0.3 ~~~~~~~~~~~~~~ Released: 2024-04-24 diff --git a/README.md b/README.md index 5af1945..dcb7d83 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ To help with the latter we provide the `autoformat.py` helper script to format c * libyaml * libcurl (>= 7.62) * libxmlb (>= 0.3.6) + * xsltproc & docbook-style-xsl Optional: * Vala Compiler (vapigen) (for Vala VAPI file) diff --git a/RELEASE b/RELEASE index 2123ca7..cb0cdab 100644 --- a/RELEASE +++ b/RELEASE @@ -2,15 +2,15 @@ AppStream Release Notes 1. Set variables -OLD_VERSION="1.0.2" -NEW_VERSION="1.0.3" +OLD_VERSION="1.0.4" +NEW_VERSION="1.0.5" 2. Write NEWS entries for AppStream in the same format as usual. git shortlog v$OLD_VERSION.. | grep -i -v -E '^\s*(trivial:|l10n:)' | grep -v Merge > NEWS.new -------------------------------------------------------------------------------- -Version 1.0.3 +Version 1.0.5 ~~~~~~~~~~~~~~ Released: 2024-xx-xx @@ -53,7 +53,7 @@ git push 10. Send an email to appstream@lists.freedesktop.org ================================================= -AppStream 1.0.3 released! +AppStream 1.0.5 released! Tarballs available here: https://www.freedesktop.org/software/appstream/releases/ diff --git a/compose/asc-compose.c b/compose/asc-compose.c index 0b746ad..cd04ada 100644 --- a/compose/asc-compose.c +++ b/compose/asc-compose.c @@ -1621,7 +1621,7 @@ asc_compose_process_task_cb (AscComposeTask *ctask, AscCompose *compose) } /* end launch entry loop */ } } /* end of desktop-entry support */ - } /* end of metadata parsing loop */ + } /* end of metadata parsing loop */ /* process the remaining .desktop files */ if (as_flags_contains (priv->flags, ASC_COMPOSE_FLAG_PROCESS_UNPAIRED_DESKTOP)) { @@ -2182,10 +2182,11 @@ asc_compose_run (AscCompose *compose, GCancellable *cancellable, GError **error) if (as_flags_contains (priv->flags, ASC_COMPOSE_FLAG_NO_PARTIAL_URLS) && priv->media_baseurl == NULL) { - g_set_error_literal (error, - ASC_COMPOSE_ERROR, - ASC_COMPOSE_ERROR_FAILED, - _("Partial URLs are not allowed, but no base URL is set to create full URLs.")); + g_set_error_literal ( + error, + ASC_COMPOSE_ERROR, + ASC_COMPOSE_ERROR_FAILED, + _("Partial URLs are not allowed, but no base URL is set to create full URLs.")); return NULL; } @@ -2232,9 +2233,6 @@ asc_compose_run (AscCompose *compose, GCancellable *cancellable, GError **error) temp_dir_created = TRUE; } - /* sanity check to ensure resources can be loaded */ - as_utils_ensure_resources (); - tasks = g_ptr_array_new_with_free_func ((GDestroyNotify) asc_compose_task_free); for (guint i = 0; i < priv->units->len; i++) { diff --git a/compose/asc-directory-unit.c b/compose/asc-directory-unit.c index 80698e8..5c60781 100644 --- a/compose/asc-directory-unit.c +++ b/compose/asc-directory-unit.c @@ -81,11 +81,12 @@ asc_directory_unit_class_init (AscDirectoryUnitClass *klass) } static gboolean -asc_directory_unit_find_files_recursive (GPtrArray *files, - const gchar *path_orig, - guint path_orig_len, - const gchar *path, - GError **error) +asc_directory_unit_find_files_recursive_internal (GPtrArray *files, + const gchar *path_orig, + guint path_orig_len, + const gchar *path, + GHashTable *visited_dirs, + GError **error) { const gchar *tmp; g_autoptr(GDir) dir = NULL; @@ -104,14 +105,38 @@ asc_directory_unit_find_files_recursive (GPtrArray *files, g_autofree gchar *path_new = NULL; path_new = g_build_filename (path, tmp, NULL); - /* search recursively, don't follow symlinks */ - if (g_file_test (path_new, G_FILE_TEST_IS_DIR) && - !g_file_test (path_new, G_FILE_TEST_IS_SYMLINK)) { - if (!asc_directory_unit_find_files_recursive (files, - path_orig, - path_orig_len, - path_new, - error)) + /* search recursively */ + if (g_file_test (path_new, G_FILE_TEST_IS_DIR)) { + if (g_file_test (path_new, G_FILE_TEST_IS_SYMLINK)) { + g_autofree gchar *real_path = realpath (path_new, NULL); + + if (!real_path) { + /* error if realpath fails (like memory allocation error or invalid path) */ + g_set_error (error, + G_FILE_ERROR, + g_file_error_from_errno (errno), + "Failed to resolve real path"); + return FALSE; + } + + /* don't visit paths twice to avoid loops */ + if (g_hash_table_contains (visited_dirs, real_path)) + continue; + + g_hash_table_add (visited_dirs, g_steal_pointer (&real_path)); + } else { + if (g_hash_table_contains (visited_dirs, path_new)) + continue; + + g_hash_table_add (visited_dirs, g_strdup (path_new)); + } + + if (!asc_directory_unit_find_files_recursive_internal (files, + path_orig, + path_orig_len, + path_new, + visited_dirs, + error)) return FALSE; } else { g_ptr_array_add (files, g_strdup (path_new + path_orig_len)); @@ -121,6 +146,27 @@ asc_directory_unit_find_files_recursive (GPtrArray *files, return TRUE; } +static gboolean +asc_directory_unit_find_files_recursive (GPtrArray *files, + const gchar *path_orig, + guint path_orig_len, + const gchar *path, + GError **error) +{ + g_autoptr(GHashTable) visited_dirs = NULL; + g_autofree gchar *absolute_lookup_path = NULL; + visited_dirs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + + absolute_lookup_path = g_build_filename (path_orig, path, NULL); + g_debug ("Indexing location: %s\n", absolute_lookup_path); + return asc_directory_unit_find_files_recursive_internal (files, + path_orig, + path_orig_len, + path, + visited_dirs, + error); +} + static gboolean asc_directory_unit_open (AscUnit *unit, GError **error) { diff --git a/compose/asc-globals.c b/compose/asc-globals.c index a77f394..4a8dcb2 100644 --- a/compose/asc-globals.c +++ b/compose/asc-globals.c @@ -57,6 +57,24 @@ G_DEFINE_TYPE_WITH_PRIVATE (AscGlobals, asc_globals, G_TYPE_OBJECT) static AscGlobals *g_globals = NULL; static GMutex g_globals_mutex; +/** + * asc_get_resource_safe: + * + * A threadsafe variant to obtain the buit-in #GResource. + */ +static GResource * +asc_get_resource_safe (void) +{ + static GResource *resource = NULL; + + if (g_once_init_enter (&resource)) { + GResource *res = asc_get_resource (); + g_once_init_leave (&resource, res); + } + + return resource; +} + /** * asc_compose_error_quark: * @@ -306,7 +324,7 @@ asc_globals_get_pangrams_for (const gchar *lang) return priv->pangrams_en; /* load array from resources */ - data = g_resource_lookup_data (asc_get_resource (), + data = g_resource_lookup_data (asc_get_resource_safe (), "/org/freedesktop/appstream-compose/pangrams/en.txt", G_RESOURCE_LOOKUP_FLAGS_NONE, NULL); diff --git a/compose/asc-hint-tags.c b/compose/asc-hint-tags.c index cf91318..385f15c 100644 --- a/compose/asc-hint-tags.c +++ b/compose/asc-hint-tags.c @@ -59,7 +59,7 @@ AscHintTagStatic asc_hint_tag_list[] = { { "ancient-metadata", AS_ISSUE_SEVERITY_WARNING, "The AppStream metadata should be updated to follow a more recent version of the specification.
" - "Please consult the XML quickstart guide for " + "Please consult the MetaInfo quickstart guides for " "more information." }, @@ -83,7 +83,7 @@ AscHintTagStatic asc_hint_tag_list[] = { AS_ISSUE_SEVERITY_ERROR, "Component does not contain a short summary. Ensure that the components MetaInfo file has a summary tag, or that its .desktop file " "has a Comment= field set.
" - "More information can be found in the Desktop Entry specification " + "More information can be found in the Desktop Entry specification " "and the MetaInfo specification." }, @@ -128,14 +128,14 @@ AscHintTagStatic asc_hint_tag_list[] = { AS_ISSUE_SEVERITY_WARNING, "The desktop-entry file `{{location}}` has the 'Hidden' property set. This is wrong for vendor-installed .desktop files, and " "nullifies all effects this .desktop file has (including MIME associations), which most certainly is not intentional. " - "See the specification for details." + "See the specification for details." }, { "desktop-entry-empty-onlyshowin", AS_ISSUE_SEVERITY_WARNING, "The desktop-entry file `{{location}}` has the 'OnlyShowIn' property set with an empty value. This might not be intended, as this will hide " "the application from all desktops. If you do want to hide the application from all desktops, using 'NoDisplay=true' is more explicit. " - "See the specification for details." + "See the specification for details." }, { "missing-launchable-desktop-file", @@ -193,6 +193,11 @@ AscHintTagStatic asc_hint_tag_list[] = { "This might be a temporary server issue, or the screenshot is no longer available." }, + { "screenshot-image-is-svg", + AS_ISSUE_SEVERITY_WARNING, + "The screenshot image at '{{url}}' is a vector graphic. Vector graphics are not allowed as screenshot images." + }, + { "screenshot-save-error", AS_ISSUE_SEVERITY_WARNING, "Unable to store screenshot for '{{url}}': {{error}}" @@ -289,14 +294,14 @@ AscHintTagStatic asc_hint_tag_list[] = { { "no-metainfo", AS_ISSUE_SEVERITY_WARNING, - "This software component is missing a MetaInfo file " + "This software component is missing a MetaInfo file " "as metadata source.
" "To synthesize suitable metadata anyway, we took some data from its desktop-entry file.
" "This has many disadvantages, like low-quality and incomplete metadata. Therefore clients may ignore this component entirely due to poor metadata.
" "Additionally, a lot of software from desktop-entry files should either not be installable and searchable via the software catalog " "(like desktop-specific settings applications) or be tagged accordingly via MetaInfo files.
" "Please consider to either hide this .desktop file from AppStream by adding a X-AppStream-Ignore=true field to it, or to write a MetaInfo file for this component.
" - "You can consult the MetaInfo quickstart guides for more information " + "You can consult the MetaInfo quickstart guides for more information " "on how to write a MetaInfo file, or file a bug with the upstream author of this software component." }, diff --git a/compose/asc-hint-tags.h b/compose/asc-hint-tags.h index a403579..ccd0380 100644 --- a/compose/asc-hint-tags.h +++ b/compose/asc-hint-tags.h @@ -46,5 +46,5 @@ typedef struct { extern AscHintTagStatic asc_hint_tag_list[]; -#pragma GCC visibility pop +#pragma GCC visibility pop G_END_DECLS diff --git a/compose/asc-utils-fonts.c b/compose/asc-utils-fonts.c index d506d17..307ce60 100644 --- a/compose/asc-utils-fonts.c +++ b/compose/asc-utils-fonts.c @@ -37,9 +37,9 @@ struct { gint width; gint height; } font_screenshot_sizes[] = { - {1024, 78}, - { 640, 48}, - { 0, 0 } + { 1024, 78 }, + { 640, 48 }, + { 0, 0 } }; /** diff --git a/compose/asc-utils-screenshots.c b/compose/asc-utils-screenshots.c index 569e3b7..ffa4f38 100644 --- a/compose/asc-utils-screenshots.c +++ b/compose/asc-utils-screenshots.c @@ -41,11 +41,11 @@ struct { gint width; gint height; } target_screenshot_sizes[] = { - {1248, 702}, - { 752, 423}, - { 624, 351}, - { 224, 126}, - { 0, 0 } + { 1248, 702 }, + { 752, 423 }, + { 624, 351 }, + { 224, 126 }, + { 0, 0 } }; static AscVideoInfo * @@ -449,6 +449,21 @@ asc_process_screenshot_images_lang (AscResult *cres, if (max_size_bytes == 0) store_screenshots = FALSE; + { + AscImageFormat image_format = asc_image_format_from_filename (orig_img_url); + + /* we do not allow vector graphics as screenshots */ + if (image_format == ASC_IMAGE_FORMAT_SVG || image_format == ASC_IMAGE_FORMAT_SVGZ) { + asc_result_add_hint (cres, + cpt, + "screenshot-image-is-svg", + "url", + orig_img_url, + NULL); + return FALSE; + } + } + /* download our image */ img_bytes = as_curl_download_bytes (acurl, orig_img_url, &error); if (img_bytes == NULL) { @@ -713,9 +728,9 @@ asc_process_screenshot_images (AscResult *cres, GHashTableIter ht_iter; gpointer ht_key, ht_value; g_autoptr(GHashTable) ht_lang_img = g_hash_table_new_full (g_str_hash, - g_str_equal, - g_free, - g_object_unref); + g_str_equal, + g_free, + g_object_unref); imgs = as_screenshot_get_images_all (scr); if (imgs->len == 0) { diff --git a/data/desktop-style-ids.txt b/data/desktop-style-ids.txt index 12dc9ca..f0d2ba3 100644 --- a/data/desktop-style-ids.txt +++ b/data/desktop-style-ids.txt @@ -1,21 +1,25 @@ # List of recognized GUI environments # ID Human-readable name # -cinnamon Cinnamon -dde Deepin -ede EDE -endless Endless -gnome GNOME -gnome:dark GNOME (Dark) -lxde LXDE -lxqt LXQt -macos macOS -mate Mate -pantheon Pantheon -plasma KDE Plasma -plasma-mobile Plasma Mobile -razor Razor -rox Rox -unity Unity -windows Microsoft Windows -xfce Xfce +android Android +cinnamon Cinnamon +dde Deepin +ede EDE +gnome GNOME +gnome:dark GNOME (Dark) +ios iOS +lxde LXDE +lxqt LXQt +macos macOS +mate Mate +pantheon Pantheon +pantheon:dark Pantheon (Dark) +plasma KDE Plasma +plasma-mobile Plasma Mobile +plasma-mobile:dark Plasma Mobile (Dark) +plasma:dark KDE Plasma (Dark) +razor Razor +rox Rox +unity Unity +windows Microsoft Windows +xfce Xfce diff --git a/data/iana-filtered-tld-list.txt b/data/iana-filtered-tld-list.txt index 9452b5b..01c2028 100644 --- a/data/iana-filtered-tld-list.txt +++ b/data/iana-filtered-tld-list.txt @@ -1,6 +1,6 @@ # IANA TLDs we recognize for AppStream IDs. # Derived from the full list at https://data.iana.org/TLD/tlds-alpha-by-domain.txt -# Last updated on 2024-04-24 +# Last updated on 2024-12-08 aaa aarp abb @@ -541,7 +541,6 @@ sexy sfr sg sh -shaw shia shop show diff --git a/data/xdg-category-names.txt b/data/xdg-category-names.txt index 4309eca..93d2953 100644 --- a/data/xdg-category-names.txt +++ b/data/xdg-category-names.txt @@ -19,6 +19,7 @@ Biology BlocksGame BoardGame Building +COSMIC Calculator Calendar CardGame diff --git a/debian/appstream.postrm b/debian/appstream.postrm index 8376aae..0df3b5f 100755 --- a/debian/appstream.postrm +++ b/debian/appstream.postrm @@ -5,7 +5,7 @@ set -e if [ "$1" = "purge" ]; then # remove the AppStream global cache rm -rf /var/cache/swcatalog/cache - rmdir /var/cache/swcatalog/ | true + rmdir /var/cache/swcatalog/ || true # remove the AppStream data fetched via APT rm -rf /var/lib/swcatalog diff --git a/debian/changelog b/debian/changelog index eead9f9..d9183f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,40 @@ +appstream (1.0.5-1deepin1) unstable; urgency=medium + + * Skip building doc package on architectures without compose support (e.g., sw64) + * appstream-doc includes appstream-compose API docs which are not generated + when ENABLE_COMPOSE=false + * Fixes dh_install error: missing files usr/share/gtk-doc/html/appstream-compose + + -- lichenggang Tue, 14 Jul 2026 16:48:04 +0800 + +appstream (1.0.5-1) unstable; urgency=medium + + [ Matthias Klumpp ] + * New upstream version: 1.0.5 + * Bump standards version: No changes needed + + [ Simon McVittie ] + * Revert "Add build-dep on gobject-introspection-bin for GIR debhelper" + (Closes: #1094613) + * d/control: Add ${gir:Depends} to -dev packages + * d/control: Add ${gir:Provides} to -dev packages + * d/control: Add gir1.2-*-dev Build-Depends as suggested by dh_girepository + * d/control, d/rules: Enable gir sequence declaratively + * d/control, d/rules: Only require gi-docgen for arch-indep builds + * d/control: Don't build API documentation under nodoc build-profile + + -- Matthias Klumpp Thu, 24 Apr 2025 17:54:04 +0200 + +appstream (1.0.4-1) unstable; urgency=medium + + [ Matthias Klumpp ] + * New upstream version 1.0.4 (Closes: #1078593) + + [ Adam Vodopjan ] + * Fix typo in debian/appstream.postrm + + -- Matthias Klumpp Sun, 08 Dec 2024 23:42:44 +0100 + appstream (1.0.3-1) unstable; urgency=medium * New upstream version: 1.0.3 diff --git a/debian/control b/debian/control index 51e4414..0ace95d 100644 --- a/debian/control +++ b/debian/control @@ -3,18 +3,19 @@ Section: admin Priority: optional Maintainer: Matthias Klumpp Build-Depends: debhelper-compat (= 13), + dh-sequence-gir, docbook-xsl, gettext, - gi-docgen, + gir1.2-gdkpixbuf-2.0-dev, + gir1.2-gio-2.0-dev, + gir1.2-gobject-2.0-dev, gobject-introspection, - gobject-introspection-bin, gperf, itstool, libcairo2-dev, - libcurl4-gnutls-dev | libcurl-dev (>= 7.62), + libcurl4-gnutls-dev | libcurl4-openssl-dev | libcurl-dev (>= 7.62), libfontconfig-dev, libgdk-pixbuf-2.0-dev, - libgirepository1.0-dev (>= 1.62), libglib2.0-dev (>= 2.62), libjs-highlight.js, libpango1.0-dev, @@ -29,8 +30,9 @@ Build-Depends: debhelper-compat (= 13), qtbase5-dev, valac, xsltproc +Build-Depends-Indep: gi-docgen , Rules-Requires-Root: no -Standards-Version: 4.6.2 +Standards-Version: 4.7.2 Homepage: https://www.freedesktop.org/wiki/Distributions/AppStream/ Vcs-Git: https://salsa.debian.org/pkgutopia-team/appstream.git Vcs-Browser: https://salsa.debian.org/pkgutopia-team/appstream @@ -105,7 +107,9 @@ Multi-Arch: same Depends: gir1.2-appstream-1.0 (= ${binary:Version}), libappstream5 (= ${binary:Version}), libglib2.0-dev, + ${gir:Depends}, ${misc:Depends} +Provides: ${gir:Provides} Description: Library to access AppStream services (development files) AppStream is a metadata specification which permits software components to provide information about themselves to automated systems and end-users @@ -233,7 +237,9 @@ Depends: gir1.2-appstreamcompose-1.0 (= ${binary:Version}), libappstream-compose0 (= ${binary:Version}), libappstream-dev (= ${binary:Version}), libgdk-pixbuf-2.0-dev, + ${gir:Depends}, ${misc:Depends} +Provides: ${gir:Provides} Suggests: appstream-generator Description: Building blocks to compose AppStream metadata (development files) AppStream is a metadata specification which permits software components to @@ -264,6 +270,7 @@ Description: Building blocks to compose AppStream metadata (introspection data) This package contains introspection data for the AppStream compose library. Package: appstream-doc +Build-Profiles: Architecture: all Multi-Arch: foreign Section: doc diff --git a/debian/libappstream5.symbols b/debian/libappstream5.symbols index c7e3a3c..eeecb91 100644 --- a/debian/libappstream5.symbols +++ b/debian/libappstream5.symbols @@ -802,7 +802,6 @@ libappstream.so.5 libappstream5 #MINVER# as_utils_data_id_valid@Base 1.0.0 as_utils_delete_dir_recursive@Base 1.0.0 as_utils_dns_to_rdns@Base 1.0.0 - as_utils_ensure_resources@Base 1.0.0 as_utils_error_get_type@Base 1.0.0 as_utils_error_quark@Base 1.0.0 as_utils_extract_tarball@Base 1.0.0 diff --git a/debian/rules b/debian/rules index c553e49..ebfde04 100755 --- a/debian/rules +++ b/debian/rules @@ -2,6 +2,8 @@ # -*- makefile -*- #export DH_VERBOSE=1 +built_binaries := $(shell dh_listpackages) + ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 loong64 mips64el mipsel ppc64el s390x powerpc ppc64 riscv64 sparc64 x32)) ENABLE_COMPOSE=true else @@ -18,8 +20,20 @@ ifneq ($(DEB_HOST_ARCH_OS), linux) AS_CONFIGURE_ARGS += -Dsystemd=false endif +ifeq ($(filter %-doc,$(built_binaries)),) + AS_CONFIGURE_ARGS += -Dapidocs=false +else ifneq ($(ENABLE_COMPOSE),true) + # On architectures without compose support (e.g., sw64), + # skip building the doc package entirely since appstream-doc + # includes compose API documentation not available there + AS_CONFIGURE_ARGS += -Dapidocs=false + export DH_OPTIONS += -Nappstream-doc +else + AS_CONFIGURE_ARGS += -Dapidocs=true +endif + %: - dh $@ --with gir + dh $@ override_dh_auto_configure: dh_auto_configure -- $(AS_CONFIGURE_ARGS) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides index 8903215..438c24e 100644 --- a/debian/source/lintian-overrides +++ b/debian/source/lintian-overrides @@ -5,3 +5,6 @@ appstream source: inconsistent-appstream-metadata-license tests/* # false positive: the sources are provided appstream source: source-is-missing [docs/html/*] + +# this is on purpose, for testing purposes +appstream source: absolute-symbolic-link-target-in-source /nonexistent [tests/*] diff --git a/docs/api/compose/meson.build b/docs/api/compose/meson.build index 3c8e2b6..b83c0b6 100644 --- a/docs/api/compose/meson.build +++ b/docs/api/compose/meson.build @@ -17,14 +17,14 @@ custom_target('doc-api-appstream-compose', ], output: 'compose-api', command: [ - gidocgen_exe, - 'generate', - '--quiet', + python_exe, + meson.current_source_dir() / '..' / 'gi-docgen-helper.py', + '--gidocgen=' + gidocgen_exe.full_path(), + '--namespace=appstream-compose', '--add-include-path=@0@'.format(meson.project_build_root() / 'compose'), '--add-include-path=@0@'.format(meson.project_build_root() / 'src'), '--config=@INPUT0@', '--output-dir=@OUTPUT@', - '--no-namespace-dir', '--content-dir=@0@'.format(meson.current_source_dir()), '@INPUT1@', ], diff --git a/docs/api/gi-docgen-helper.py b/docs/api/gi-docgen-helper.py new file mode 100755 index 0000000..8d34eb4 --- /dev/null +++ b/docs/api/gi-docgen-helper.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2024-2025 Matthias Klumpp +# +# Licensed under the GNU Lesser General Public License Version 2.1 +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 2.1 of the license, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +# +# This is a helper script for Meson and intended to be called by the +# AppStream buildsystem. You do not want to run this manually. +# + +import os +import argparse +import subprocess +import shutil + + +def run_gidocgen_generate(gidocgen_exe, output_dir, namespace, extra_args): + """Work around a quirk in gi-docgen that results in misnamed devhelp files.""" + cmd = [ + gidocgen_exe, + 'generate', + '--quiet', + '--no-namespace-dir', + ] + + post_rename = False + if namespace and output_dir: + post_rename = True + cmd.extend(['--output-dir', namespace]) + elif output_dir: + cmd.extend(['--output-dir', output_dir]) + cmd.extend(extra_args) + + ret = subprocess.call(cmd) + + if post_rename: + # unfortunately for some reason, gi-docgen takes the output directory + # name as namespace name, resulting in misnamed devhelp files. + # We work around this here. + if os.path.isdir(output_dir): + shutil.rmtree(output_dir) + shutil.move(namespace, output_dir) + + return ret == 0 + + +def main(args): + parser = argparse.ArgumentParser() + parser.add_argument('--gidocgen', action='store', default='gi-docgen') + parser.add_argument('--output-dir', action='store') + parser.add_argument('--namespace', action='store') + + options, extra_args = parser.parse_known_args(args) + + ret = run_gidocgen_generate(options.gidocgen, options.output_dir, options.namespace, extra_args) + if not ret: + sys.exit(1) + + return 0 + + +if __name__ == '__main__': + import sys + + sys.exit(main(sys.argv[1:])) diff --git a/docs/api/meson.build b/docs/api/meson.build index 5a5fbb5..e7a1e4b 100644 --- a/docs/api/meson.build +++ b/docs/api/meson.build @@ -25,13 +25,13 @@ custom_target('doc-api-appstream', ], output: 'api', command: [ - gidocgen_exe, - 'generate', - '--quiet', + python_exe, + meson.current_source_dir() / 'gi-docgen-helper.py', + '--gidocgen=' + gidocgen_exe.full_path(), + '--namespace=appstream', '--add-include-path=@0@'.format(meson.project_build_root() / 'src'), '--config=@INPUT0@', '--output-dir=@OUTPUT@', - '--no-namespace-dir', '--content-dir=@0@'.format(meson.current_source_dir()), '@INPUT1@', ], diff --git a/docs/html/chap-AppStream-API.html b/docs/html/chap-AppStream-API.html index 431bd66..38cc2c6 100644 --- a/docs/html/chap-AppStream-API.html +++ b/docs/html/chap-AppStream-API.html @@ -236,7 +236,7 @@ is selected. --allow-custom CUSTOM-KEY-NAMES By default, all custom entries set in MetaInfo input data are removed. - This flag allows to whitelist custom keys to be propagated to the final catalog output data. + This flag allows one to whitelist custom keys to be propagated to the final catalog output data. The custom-key names should be provided as a comma-separated list. --components COMPONENT-IDs Set a comma-separated list of AppStream component IDs that should be @@ -261,5 +261,5 @@ If you want to use the PackageKit API, look at the PackageKit reference manual (https://www.freedesktop.org/software/PackageKit/gtk-doc/).

\ No newline at end of file diff --git a/docs/html/chap-AppStream-About.html b/docs/html/chap-AppStream-About.html index 75b029e..109bb08 100644 --- a/docs/html/chap-AppStream-About.html +++ b/docs/html/chap-AppStream-About.html @@ -236,7 +236,7 @@ is selected. --allow-custom CUSTOM-KEY-NAMES By default, all custom entries set in MetaInfo input data are removed. - This flag allows to whitelist custom keys to be propagated to the final catalog output data. + This flag allows one to whitelist custom keys to be propagated to the final catalog output data. The custom-key names should be provided as a comma-separated list. --components COMPONENT-IDs Set a comma-separated list of AppStream component IDs that should be @@ -266,5 +266,5 @@

1.1.1 Architecture

\ No newline at end of file diff --git a/docs/html/chap-AppStream-ManualPages.html b/docs/html/chap-AppStream-ManualPages.html index 2a89143..7e1a5e7 100644 --- a/docs/html/chap-AppStream-ManualPages.html +++ b/docs/html/chap-AppStream-ManualPages.html @@ -236,7 +236,7 @@ is selected. --allow-custom CUSTOM-KEY-NAMES By default, all custom entries set in MetaInfo input data are removed. - This flag allows to whitelist custom keys to be propagated to the final catalog output data. + This flag allows one to whitelist custom keys to be propagated to the final catalog output data. The custom-key names should be provided as a comma-separated list. --components COMPONENT-IDs Set a comma-separated list of AppStream component IDs that should be @@ -252,5 +252,5 @@ This chapter lists the man pages for the command-line interface tools that AppStream provides.

\ No newline at end of file diff --git a/docs/html/chap-AppStream-Misc.html b/docs/html/chap-AppStream-Misc.html index b0dd60c..b3ba943 100644 --- a/docs/html/chap-AppStream-Misc.html +++ b/docs/html/chap-AppStream-Misc.html @@ -236,7 +236,7 @@ is selected. --allow-custom CUSTOM-KEY-NAMES By default, all custom entries set in MetaInfo input data are removed. - This flag allows to whitelist custom keys to be propagated to the final catalog output data. + This flag allows one to whitelist custom keys to be propagated to the final catalog output data. The custom-key names should be provided as a comma-separated list. --components COMPONENT-IDs Set a comma-separated list of AppStream component IDs that should be @@ -302,5 +302,5 @@ false: 2.4 >> 2.1 $ appstreamcli vercmp 1.2.4 gt 1.2.3 true: 1.2.4 >> 1.2.3
\ No newline at end of file diff --git a/docs/html/chap-CatalogData.html b/docs/html/chap-CatalogData.html index 487e32f..92a2b39 100644 --- a/docs/html/chap-CatalogData.html +++ b/docs/html/chap-CatalogData.html @@ -236,7 +236,7 @@ is selected. --allow-custom CUSTOM-KEY-NAMES By default, all custom entries set in MetaInfo input data are removed. - This flag allows to whitelist custom keys to be propagated to the final catalog output data. + This flag allows one to whitelist custom keys to be propagated to the final catalog output data. The custom-key names should be provided as a comma-separated list. --components COMPONENT-IDs Set a comma-separated list of AppStream component IDs that should be @@ -270,14 +270,13 @@ The XML files can either be plain files or be compressed with gzip. It is always a good idea to compress the files, because they tend to become quite large.

Important
Important: Legacy Path

- AppStream tools scan the paths /usr/share/app-info/(xml|xmls) / /var/lib/app-info/(xml|xmls) path for legacy - compatibility as well. If possible, the old locations and old layouts should not be used anymore. - Support for the legacy path will likely be dropped completely with a future AppStream 1.0 release. + Prior to version 1.0, AppStream tools scanned the paths /usr/share/app-info/(xml|xmls) and /var/lib/app-info/(xml|xmls) path for legacy + compatibility as well. Legacy path support was dropped in version 1.0. The old locations should not be used anymore. The modern locations are supported by both the AppStream 1.x as well as AppStream 0.16.x series.

3.1.3 General XML structure

The XML starts with a <components> tag as the root element. It has all the <component> tags of different types as children.

- Data to fill the different component elements is usually taken from their Desktop files (https://standards.freedesktop.org/desktop-entry-spec/latest/) + Data to fill the different component elements is usually taken from their Desktop files (https://specifications.freedesktop.org/desktop-entry-spec/latest/) and package data. However, if an upstream project ships metainfo files (see Chapter 2, Upstream Metadata), values defined there should override data from any other source.

@@ -334,7 +333,7 @@ A human-readable name for this software.

In case of a component of type desktop-application, the application name as defined in the application's - desktop file (https://standards.freedesktop.org/desktop-entry-spec/latest/) is used. + desktop file (https://specifications.freedesktop.org/desktop-entry-spec/latest/) is used.

<project_license/> 

The <project_license/> tag is indicating the license of the component. It should be a SPDX license expression (https://spdx.org/specifications). @@ -408,7 +407,7 @@ If targeting a hi-DPI screen, this icon type may have a scale property.

If specified, the scale property is defined as in the - Freedesktop Icon Theme Specification (https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#definitions). + Freedesktop Icon Theme Specification (https://specifications.freedesktop.org/icon-theme-spec/latest/#definitions). It’s an integer value ≥1 indicating how many pixels in the image represent a logical pixel on the display, in each dimension. This allows icons for hi-DPI screens to be displayed at the same logical size as on lower resolution screens, but without upscaling artifacts.

@@ -429,7 +428,7 @@ This tag can contain one or more <category> tags, describing the categories this component is located in. This tag is usually applied to components of type desktop-application, although it might be used by others later. This data is usually taken from Desktop files, a list of categories can be found in the - Freedesktop menu spec (https://standards.freedesktop.org/menu-spec/latest/apa.html). + Freedesktop menu spec (https://specifications.freedesktop.org/menu-spec/latest/category-registry.html). Example:

<categories>
     <category>Science</category>
@@ -576,7 +575,7 @@
 					

The type property of this tag indicates which 3rd-party software installation solution the bundle belongs to. Currently supported solutions are: -

+

Example:

<bundle type="limba">foobar-1.0.2</bundle>
<suggests/> 

@@ -669,5 +668,5 @@ </component> <!-- more components here! --> </components>

\ No newline at end of file diff --git a/docs/html/chap-Metadata.html b/docs/html/chap-Metadata.html index 1fd7d55..5f462b7 100644 --- a/docs/html/chap-Metadata.html +++ b/docs/html/chap-Metadata.html @@ -1,5 +1,5 @@ -Upstream Metadata | AppStream | AppStream 1.0 +Upstream Metadata | AppStream | AppStream 1.0