-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use Flathub's patched flatpak-builder
Build the same version of flatpak-builder run on Flathub, to support backported features and CI-specific behaviours.
- Loading branch information
1 parent
440df4a
commit e45534f
Showing
12 changed files
with
647 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
build-aux/patches/appstream-compose-default-propagate-custom.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/compose/asc-compose.c b/compose/asc-compose.c | ||
index 0b746ad9..a3050b0e 100644 | ||
--- a/compose/asc-compose.c | ||
+++ b/compose/asc-compose.c | ||
@@ -101,7 +101,7 @@ asc_compose_init (AscCompose *compose) | ||
priv->flags = ASC_COMPOSE_FLAG_USE_THREADS | ASC_COMPOSE_FLAG_ALLOW_NET | | ||
ASC_COMPOSE_FLAG_VALIDATE | ASC_COMPOSE_FLAG_STORE_SCREENSHOTS | | ||
ASC_COMPOSE_FLAG_ALLOW_SCREENCASTS | ASC_COMPOSE_FLAG_PROCESS_FONTS | | ||
- ASC_COMPOSE_FLAG_PROCESS_TRANSLATIONS; | ||
+ ASC_COMPOSE_FLAG_PROCESS_TRANSLATIONS | ASC_COMPOSE_FLAG_PROPAGATE_CUSTOM; | ||
|
||
/* the icon policy will initialize with default settings */ | ||
priv->icon_policy = asc_icon_policy_new (); |
107 changes: 107 additions & 0 deletions
107
build-aux/patches/appstream-compose-lang-symlinks.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
From 6f6986c333ed9d56c28e5ff419b33fb4eb158bc2 Mon Sep 17 00:00:00 2001 | ||
From: Matthias Klumpp <matthias@tenstral.net> | ||
Date: Wed, 5 Jun 2024 21:44:01 +0200 | ||
Subject: [PATCH] compose: Allow file discovery even in symlinked directories | ||
|
||
This was discovered to be an issue on Flathub with some component | ||
localizations being placed in symlinked directories. | ||
|
||
CC: https://github.com/flathub/flathub/issues/5272 | ||
--- | ||
compose/asc-directory-unit.c | 69 +++++++++++++++---- | ||
5 files changed, 65 insertions(+), 21 deletions(-) | ||
|
||
diff --git a/compose/asc-directory-unit.c b/compose/asc-directory-unit.c | ||
index 80698e873..10c9c3de1 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)) | ||
+ return TRUE; | ||
+ | ||
+ g_hash_table_add (visited_dirs, g_steal_pointer (&real_path)); | ||
+ } else { | ||
+ if (g_hash_table_contains (visited_dirs, path_new)) | ||
+ return TRUE; | ||
+ | ||
+ 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,24 @@ 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; | ||
+ visited_dirs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); | ||
+ | ||
+ 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) | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/src/as-validator.c b/src/as-validator.c | ||
index 849338c7..c4da24af 100644 | ||
--- a/src/as-validator.c | ||
+++ b/src/as-validator.c | ||
@@ -653,6 +653,15 @@ as_validator_add_override (AsValidator *validator, | ||
"developer-id-missing", | ||
/* allow in case a component really doesn't have an active homepage */ | ||
"url-homepage-missing", | ||
+ /* flathub apps often instruct users to follow some additional steps for sandbox-breaking apps */ | ||
+ "description-has-plaintext-url", | ||
+ /* we have our own validation for these fields */ | ||
+ "component-name-too-long", | ||
+ "summary-too-long", | ||
+ /* this is a breaking change as 1.0.0 allowed this field to be anything */ | ||
+ "developer-id-invalid", | ||
+ /* this has not been the case with appstream-glib */ | ||
+ "cid-domain-not-lowercase", | ||
NULL | ||
}; | ||
|
92 changes: 92 additions & 0 deletions
92
build-aux/patches/asc-hint-tags-silence-some-vague-validation-errors.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
From cd5dd2c083e34456744d0fe7778efccadac67b18 Mon Sep 17 00:00:00 2001 | ||
From: bbhtt <bbhtt.zn0i8@slmail.me> | ||
Date: Sat, 20 Apr 2024 07:56:19 +0530 | ||
Subject: [PATCH] asc-hint-tags: Silence some vague validation errors during | ||
compose | ||
|
||
These are either covered by `appstreamcli validate` or by the linter's | ||
own checks and provide better and clearer error messages. | ||
|
||
The following are lowered to INFO: | ||
|
||
* ancient-metadata | ||
* metainfo-unknown-type | ||
* icon-not-found | ||
* metainfo-screenshot-but-no-media | ||
* gui-app-without-icon | ||
* no-metainfo | ||
* no-valid-category | ||
--- | ||
compose/asc-hint-tags.c | 14 +++++++------- | ||
1 file changed, 7 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/compose/asc-hint-tags.c b/compose/asc-hint-tags.c | ||
index cf91318e..2dc0feef 100644 | ||
--- a/compose/asc-hint-tags.c | ||
+++ b/compose/asc-hint-tags.c | ||
@@ -57,7 +57,7 @@ AscHintTagStatic asc_hint_tag_list[] = { | ||
}, | ||
|
||
{ "ancient-metadata", | ||
- AS_ISSUE_SEVERITY_WARNING, | ||
+ AS_ISSUE_SEVERITY_INFO, | ||
"The AppStream metadata should be updated to follow a more recent version of the specification.<br/>" | ||
"Please consult <a href=\"http://freedesktop.org/software/appstream/docs/chap-Quickstart.html\">the XML quickstart guide</a> for " | ||
"more information." | ||
@@ -99,7 +99,7 @@ AscHintTagStatic asc_hint_tag_list[] = { | ||
}, | ||
|
||
{ "metainfo-unknown-type", | ||
- AS_ISSUE_SEVERITY_ERROR, | ||
+ AS_ISSUE_SEVERITY_INFO, | ||
"The component has an unknown type. Please make sure this component type is mentioned in the specification, and that the" | ||
"<code>type=</code> property of the component root-node in the MetaInfo XML file does not contain a spelling mistake." | ||
}, | ||
@@ -158,7 +158,7 @@ AscHintTagStatic asc_hint_tag_list[] = { | ||
}, | ||
|
||
{ "icon-not-found", | ||
- AS_ISSUE_SEVERITY_ERROR, | ||
+ AS_ISSUE_SEVERITY_INFO, | ||
"The icon <em>{{icon_fname}}</em> was not found in the archive. This issue can have multiple reasons, " | ||
"like the icon being in a wrong directory or not being available in a suitable size (at least 64x64px). " | ||
"To make the icon easier to find, place it in <code>/usr/share/icons/hicolor/<size>/apps</code> and ensure the <code>Icon=</code> value" | ||
@@ -182,7 +182,7 @@ AscHintTagStatic asc_hint_tag_list[] = { | ||
}, | ||
|
||
{ "metainfo-screenshot-but-no-media", | ||
- AS_ISSUE_SEVERITY_WARNING, | ||
+ AS_ISSUE_SEVERITY_INFO, | ||
"A screenshot has been found for this component, but apparently it does not have any images or videos defined. " | ||
"The screenshot entry has been ignored." | ||
}, | ||
@@ -255,7 +255,7 @@ AscHintTagStatic asc_hint_tag_list[] = { | ||
}, | ||
|
||
{ "gui-app-without-icon", | ||
- AS_ISSUE_SEVERITY_ERROR, | ||
+ AS_ISSUE_SEVERITY_INFO, | ||
"The component is a GUI application (application which has a .desktop file for the XDG menu and <code>Type=Application</code>), " | ||
"but we could not find a matching icon for this application." | ||
}, | ||
@@ -278,7 +278,7 @@ AscHintTagStatic asc_hint_tag_list[] = { | ||
}, | ||
|
||
{ "no-valid-category", | ||
- AS_ISSUE_SEVERITY_ERROR, | ||
+ AS_ISSUE_SEVERITY_INFO, | ||
"This software component is no member of any valid category (note that custom categories and toolkit categories like 'Qt' or 'GTK' are ignored)." | ||
}, | ||
|
||
@@ -288,7 +288,7 @@ AscHintTagStatic asc_hint_tag_list[] = { | ||
}, | ||
|
||
{ "no-metainfo", | ||
- AS_ISSUE_SEVERITY_WARNING, | ||
+ AS_ISSUE_SEVERITY_INFO, | ||
"This software component is missing a <a href=\"https://freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent\">MetaInfo file</a> " | ||
"as metadata source.<br/>" | ||
"To synthesize suitable metadata anyway, we took some data from its desktop-entry file.<br/>" | ||
-- | ||
2.44.0 | ||
|
Oops, something went wrong.