summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/package-management.scm7
-rw-r--r--gnu/packages/patches/flatpak-fix-icon-validation.patch37
3 files changed, 45 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 9201230f35f..855f2accccd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1290,6 +1290,7 @@ dist_patch_DATA = \
%D%/packages/patches/flann-cmake-3.11.patch \
%D%/packages/patches/flatpak-fix-path.patch \
%D%/packages/patches/flatpak-fix-fonts-icons.patch \
+ %D%/packages/patches/flatpak-fix-icon-validation.patch \
%D%/packages/patches/flatpak-unset-gdk-pixbuf-for-sandbox.patch \
%D%/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch \
%D%/packages/patches/fluxbox-1.3.7-gcc.patch \
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index a8b95f450ab..663965367c0 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -2032,6 +2032,7 @@ the boot loader configuration.")
(patches
(search-patches "flatpak-fix-fonts-icons.patch"
"flatpak-fix-path.patch"
+ "flatpak-fix-icon-validation.patch"
"flatpak-unset-gdk-pixbuf-for-sandbox.patch"))))
;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to
@@ -2078,6 +2079,12 @@ cp -r /tmp/locale/*/en_US.*")))
(("if \\(g_find_program_in_path \\(\"p11-kit\"\\)\\)")
(string-append "if (g_find_program_in_path (\""
p11-path "\"))"))))))
+ (add-after 'unpack 'fix-icon-validation
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (store (dirname out)))
+ (substitute* "icon-validator/validate-icon.c"
+ (("@storeDir@") store)))))
;; Many tests fail for unknown reasons, so we just run a few basic
;; tests.
(replace 'check
diff --git a/gnu/packages/patches/flatpak-fix-icon-validation.patch b/gnu/packages/patches/flatpak-fix-icon-validation.patch
new file mode 100644
index 00000000000..b67ff68929f
--- /dev/null
+++ b/gnu/packages/patches/flatpak-fix-icon-validation.patch
@@ -0,0 +1,37 @@
+This fixes the "No such file or directory" error when invoking
+flatpak-validate-icon with the --sandbox argument.
+
+diff --git a/icon-validator/validate-icon.c b/icon-validator/validate-icon.c
+index 6c3d152..0d70e55 100644
+--- a/icon-validator/validate-icon.c
++++ b/icon-validator/validate-icon.c
+@@ -163,7 +163,7 @@ rerun_in_sandbox (const char *arg_width,
+ const char *arg_height,
+ const char *filename)
+ {
+- const char * const usrmerged_dirs[] = { "bin", "lib32", "lib64", "lib", "sbin" };
++ const char * const usrmerged_dirs[] = { };
+ int i;
+ g_autoptr(GPtrArray) args = g_ptr_array_new_with_free_func (g_free);
+ char validate_icon[PATH_MAX + 1];
+@@ -183,8 +183,7 @@ rerun_in_sandbox (const char *arg_width,
+ "--unshare-ipc",
+ "--unshare-net",
+ "--unshare-pid",
+- "--ro-bind", "/usr", "/usr",
+- "--ro-bind-try", "/etc/ld.so.cache", "/etc/ld.so.cache",
++ "--ro-bind", "@storeDir@", "@storeDir@",
+ "--ro-bind", validate_icon, validate_icon,
+ NULL);
+
+@@ -227,6 +226,10 @@ rerun_in_sandbox (const char *arg_width,
+ add_args (args, "--setenv", "G_MESSAGES_DEBUG", g_getenv ("G_MESSAGES_DEBUG"), NULL);
+ if (g_getenv ("G_MESSAGES_PREFIXED"))
+ add_args (args, "--setenv", "G_MESSAGES_PREFIXED", g_getenv ("G_MESSAGES_PREFIXED"), NULL);
++ if (g_getenv ("GDK_PIXBUF_MODULE_FILE"))
++ add_args (args, "--setenv", "GDK_PIXBUF_MODULE_FILE", g_getenv ("GDK_PIXBUF_MODULE_FILE"), NULL);
++ if (g_getenv ("XDG_DATA_DIRS"))
++ add_args (args, "--setenv", "XDG_DATA_DIRS", g_getenv ("XDG_DATA_DIRS"), NULL);
+
+ add_args (args, validate_icon, arg_width, arg_height, filename, NULL);
+ g_ptr_array_add (args, NULL);