From unknown Fri Jun 20 07:26:02 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#70099 <70099@debbugs.gnu.org> To: bug#70099 <70099@debbugs.gnu.org> Subject: Status: [PATCH] gnu: flatpak: Pass system icons and fonts. Reply-To: bug#70099 <70099@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:26:02 +0000 retitle 70099 [PATCH] gnu: flatpak: Pass system icons and fonts. reassign 70099 guix-patches submitter 70099 Zheng Junjie severity 70099 normal tag 70099 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 31 02:43:50 2024 Received: (at submit) by debbugs.gnu.org; 31 Mar 2024 06:43:50 +0000 Received: from localhost ([127.0.0.1]:46494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqouz-0003QM-EL for submit@debbugs.gnu.org; Sun, 31 Mar 2024 02:43:50 -0400 Received: from lists.gnu.org ([2001:470:142::17]:51652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqouu-0003Pu-Ma for submit@debbugs.gnu.org; Sun, 31 Mar 2024 02:43:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqoum-0005W9-Or for guix-patches@gnu.org; Sun, 31 Mar 2024 02:43:36 -0400 Received: from smtp84.cstnet.cn ([159.226.251.84] helo=cstnet.cn) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1rqoui-0001OV-6o for guix-patches@gnu.org; Sun, 31 Mar 2024 02:43:36 -0400 Received: from m.taildaf0f.ts.net (unknown [183.247.5.22]) by APP-05 (Coremail) with SMTP id zQCowAC3RBIBBglmV6NeAA--.27966S2; Sun, 31 Mar 2024 14:43:14 +0800 (CST) From: Zheng Junjie To: guix-patches@gnu.org Subject: [PATCH] gnu: flatpak: Pass system icons and fonts. Date: Sun, 31 Mar 2024 14:43:07 +0800 Message-ID: <54bd7d232c3a231704463801bb605b106e0757ad.1711867387.git.zhengjunjie@iscas.ac.cn> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowAC3RBIBBglmV6NeAA--.27966S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYT7k0a2IF6F4UM7kC6x804xWl14x267AK xVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGw A2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26r1j 6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r1j6r4UM28EF7xvwVC2z280aVAFwI0_Gr 0_Cr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv 0487M2AExVAIFx02aVAFz4v204v7Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4kE6I8I3I0E14AKx2xKxVC2ax8xMxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ Jr0_Jr4lx4CE17CEb7AF67AKxVWUJVWUXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJV W8JbIYCTnIWIevJa73UjIFyTuYvjxU2_HUDUUUU X-Originating-IP: [183.247.5.22] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ Received-SPF: pass client-ip=159.226.251.84; envelope-from=zhengjunjie@iscas.ac.cn; helo=cstnet.cn X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, MIME_CHARSET_FARAWAY=2.45, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * gnu/packages/patches/flatpak-fix-fonts-icons.patch: New patch. * gnu/packages/package-management.scm(flatpak): Use it. * gnu/local.mk(dist_patch_DATA): Register it. Change-Id: I0359d0d9bf10120a8b784c910c50d0e4a9b7a616 --- gnu/local.mk | 1 + gnu/packages/package-management.scm | 4 +- .../patches/flatpak-fix-fonts-icons.patch | 89 +++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/flatpak-fix-fonts-icons.patch diff --git a/gnu/local.mk b/gnu/local.mk index f2b480bded..2c1d794ec9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1209,6 +1209,7 @@ dist_patch_DATA = \ %D%/packages/patches/firebird-riscv64-support-pt2.patch \ %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-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 a0ede07d54..5e47f6aa1e 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -24,6 +24,7 @@ ;;; Copyright © 2023 jgart ;;; Copyright © 2023 Mădălin Ionel Patrașcu ;;; Copyright © 2024 Arun Isaac +;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -2019,7 +2020,8 @@ (define-public flatpak (sha256 (base32 "16b7f7n2mms6zgm0lj3fn86ny11xjn8cd3mrk1slwhvwnv8dnd4a")) (patches - (search-patches "flatpak-fix-path.patch" + (search-patches "flatpak-fix-fonts-icons.patch" + "flatpak-fix-path.patch" "flatpak-unset-gdk-pixbuf-for-sandbox.patch")))) ;; Wrap 'flatpak' so that GIO_EXTRA_MODULES is set, thereby allowing GIO to diff --git a/gnu/packages/patches/flatpak-fix-fonts-icons.patch b/gnu/packages/patches/flatpak-fix-fonts-icons.patch new file mode 100644 index 0000000000..5b9d855b2e --- /dev/null +++ b/gnu/packages/patches/flatpak-fix-fonts-icons.patch @@ -0,0 +1,89 @@ +modify from https://github.com/NixOS/nixpkgs/pull/262462 + +diff --git a/common/flatpak-run.c b/common/flatpak-run.c +index 94ad013..5c9f55e 100644 +--- a/common/flatpak-run.c ++++ b/common/flatpak-run.c +@@ -871,6 +871,49 @@ out: + return res; + } + ++static void ++get_gnu_closure (GHashTable *closure, const gchar *source_path) ++{ ++ if (g_file_test (source_path, G_FILE_TEST_IS_SYMLINK)) ++ { ++ g_autofree gchar *path = g_malloc(PATH_MAX); ++ realpath(source_path, path); ++ if (g_str_has_prefix(path, "/gnu/store/")) ++ { ++ *strchr(path + strlen("/gnu/store/"), '/') = 0; ++ g_hash_table_add(closure, g_steal_pointer (&path)); ++ } ++ } ++ else if (g_file_test (source_path, G_FILE_TEST_IS_DIR)) ++ { ++ g_autoptr(GDir) dir = g_dir_open(source_path, 0, NULL); ++ const gchar *file_name; ++ while ((file_name = g_dir_read_name(dir))) ++ { ++ g_autofree gchar *path = g_build_filename (source_path, file_name, NULL); ++ get_gnu_closure (closure, path); ++ } ++ } ++} ++ ++static void ++add_gnu_store_symlink_targets (FlatpakBwrap *bwrap, const gchar *source_path) ++{ ++ GHashTable *closure = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); ++ ++ get_gnu_closure(closure, source_path); ++ ++ GHashTableIter iter; ++ gpointer path; ++ g_hash_table_iter_init(&iter, closure); ++ while (g_hash_table_iter_next(&iter, &path, NULL)) ++ { ++ flatpak_bwrap_add_args (bwrap, "--ro-bind", path, path, NULL); ++ } ++ ++ g_hash_table_destroy(closure); ++} ++ + static void + add_font_path_args (FlatpakBwrap *bwrap) + { +@@ -898,6 +946,18 @@ add_font_path_args (FlatpakBwrap *bwrap) + "\t/run/host/fonts\n", + SYSTEM_FONTS_DIR); + } ++ else if (g_file_test ("/run/current-system/profile/share/fonts", G_FILE_TEST_EXISTS)) ++ { ++ add_gnu_store_symlink_targets (bwrap, "/run/current-system/profile/share/fonts"); ++ flatpak_bwrap_add_args (bwrap, ++ "--ro-bind", ++ "/run/current-system/profile/share/fonts", ++ "/run/host/fonts", ++ NULL); ++ g_string_append_printf (xml_snippet, ++ "\t/run/host/fonts\n", ++ "/run/current-system/profile/share/fonts"); ++ } + + if (g_file_test ("/usr/local/share/fonts", G_FILE_TEST_EXISTS)) + { +@@ -998,6 +1058,13 @@ add_icon_path_args (FlatpakBwrap *bwrap) + "--ro-bind", "/usr/share/icons", "/run/host/share/icons", + NULL); + } ++ else if (g_file_test ("/run/current-system/profile/share/icons", G_FILE_TEST_IS_DIR)) ++ { ++ add_gnu_store_symlink_targets (bwrap, "/run/current-system/profile/share/icons"); ++ flatpak_bwrap_add_args (bwrap, ++ "--ro-bind", "/run/current-system/profile/share/icons", "/run/host/share/icons", ++ NULL); ++ } + + user_icons_path = g_build_filename (g_get_user_data_dir (), "icons", NULL); + user_icons = g_file_new_for_path (user_icons_path); base-commit: f5558ee0cc1a11a8b61d3f4d43f05dd79d53ac77 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 10:15:29 2024 Received: (at 70099) by debbugs.gnu.org; 28 Jun 2024 14:15:30 +0000 Received: from localhost ([127.0.0.1]:46010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNCNt-0004mW-5P for submit@debbugs.gnu.org; Fri, 28 Jun 2024 10:15:29 -0400 Received: from w1.tutanota.de ([81.3.6.162]:53360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNBRv-0002fn-Qo for 70099@debbugs.gnu.org; Fri, 28 Jun 2024 09:15:36 -0400 Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w1.tutanota.de (Postfix) with ESMTP id 747A0FBFA30 for <70099@debbugs.gnu.org>; Fri, 28 Jun 2024 13:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1719580529; s=s1; d=tutanota.com; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=6ZDU1vXNdKUmOuYQ8jEE71TYqCAgovzUJHUmGjlTIN0=; b=PGXhoGmSmWxi7aZPxNeVBhKUz+ngWD/CHpckeCJeMaPBSzovNzIc4fUEYWo1QDHE Ufut+oWTc3xMX3Uq/iMPdUMrFmVLqNbXYjTAUu8pjPTvKWHQDVveTWL1/0OrtZNYIz9 1bKcmsi7klhf9bhDWnBnY+p4tmVw310vXUrw3tpcqEZZbOrYBO2xd+OikjpE3JDqmgI rao97gvFa5rhN2uelXRSvA9cCNw60ZWTfFcyUpeDupVhjs66il5BTzMpcfoHGqBANlJ aJBoAGJZF2Zhi0rknnXDHIwvOQKmy5Yle0fyETtuvr2bbMqPxfUwXbFNL4A50y7bfyY pFfPVRkUXA== Date: Fri, 28 Jun 2024 15:15:29 +0200 (GMT+02:00) From: kasper.andersson@tutanota.com To: 70099 <70099@debbugs.gnu.org> Message-ID: Subject: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16979_995904017.1719580529469" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Tried the patch on my system, works well for me. :) Best regards, Kasper Tried the patch on my system, works well for me. :) Best regards, Kasper Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [81.3.6.162 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 HTML_MESSAGE BODY: HTML included in message 2.0 BLANK_SUBJECT Subject is present but empty 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 70099 X-Mailman-Approved-At: Fri, 28 Jun 2024 10:15:27 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) ------=_Part_16979_995904017.1719580529469 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Tried the patch on my system, works well for me. :) Best regards, Kasper ------=_Part_16979_995904017.1719580529469 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Tried the patch on my system, works well for me. :)
Best regards, Kasper
------=_Part_16979_995904017.1719580529469-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 00:48:00 2024 Received: (at 70099) by debbugs.gnu.org; 29 Jun 2024 04:48:00 +0000 Received: from localhost ([127.0.0.1]:36676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNQ0G-00028L-4c for submit@debbugs.gnu.org; Sat, 29 Jun 2024 00:48:00 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:60290 helo=cstnet.cn) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNQ0D-000280-Vl for 70099@debbugs.gnu.org; Sat, 29 Jun 2024 00:47:58 -0400 Received: from m (unknown [111.0.51.128]) by APP-01 (Coremail) with SMTP id qwCowAD32E31kX9mq9uKAA--.2655S2; Sat, 29 Jun 2024 12:47:50 +0800 (CST) From: Zheng Junjie To: "kasper.andersson--- via Guix-patches" via Subject: Re: [bug#70099] In-Reply-To: (kasper andersson's message of "Fri, 28 Jun 2024 15:15:29 +0200 (GMT+02:00)") References: <54bd7d232c3a231704463801bb605b106e0757ad.1711867387.git.zhengjunjie@iscas.ac.cn> User-Agent: mu4e 1.12.4; emacs 30.0.50 Date: Sat, 29 Jun 2024 12:47:49 +0800 Message-ID: <87ed8giccq.fsf@iscas.ac.cn> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-CM-TRANSID: qwCowAD32E31kX9mq9uKAA--.2655S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYb7k0a2IF6FyUM7kC6x804xWl14x267AK xVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGw A2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26r1j 6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7xvwVC2z280aVAFwI0_Cr 0_Gr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvE ncxIr21le4C267I2x7xF54xIwI1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IY64vIr41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4 xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1Y6r17 MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I 0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWU JVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jOVy xUUUUU= X-Originating-IP: [111.0.51.128] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 70099 Cc: 70099-done <70099@debbugs.gnu.org>, kasper.andersson@tutanota.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain "kasper.andersson--- via Guix-patches" via writes: > Tried the patch on my system, works well for me. :) > Best regards, Kasper thanks, push. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmZ/kfUACgkQO1qpk+Gi 3/AOsg/9GKUtUc4jUpBrIN9mfTFBZITo5lFKUB+IqDqW+GFyF9fDBsRMkDukoQEU bofN8pHmURH4pMivV6ndZOKw2SuVpFtBpKFSWTyIC4PPq8QzKSrGYWygw+JaI7fA qukoUbxvHMmhhYAXpXqS0acTfgLuL40RdUs5v1hpqoupDrnNUDQvwp5LCIJ1FDoJ yyZFpqJqWzIZtigw8zL9Q4GBZq+jXrPLVvGdR5JHthID709ypPPkvvsjvy94O17o C8gvtpHnekwXDwzu2uXCoIayG73vER85DOPO14sPxzaphUI1UkVxMXeYU9Gp/60/ bOxjMRY5rc16zr9N0yxrGW4T3jn9m7z/hyVHiRVAnK65woTmT9F/pM0Is4xbAyjl Tgq+8ja8cPcEHZDbf0Vkp7MMrTnvkns7zeIx3GWRs1X+evOt9eyYx5hwCGzhYPxs gmLoDv1kVC1urLwFvrmMe/NTWE0w4PlINY4xB7zegf2u5pk/Bma4bT+wo5YvCC4u 2UC8dm8KRs0iEw0h1W7ySjYKVU+IifSEju02KHZvS8R9tWsm9XtR05L76P46iY0x y7PmThs2NwKo7TbEGv9u+cptjUHjA5o3OqHQqM4I/OP8CF5GT7gIOx5GnWZ1OdDA xs/u1NYbSmltBvY34XTJs87nyHgKpSAtbG0Yo/5QNrT8Rk1ClKo= =h0jH -----END PGP SIGNATURE----- --=-=-=--