From patchwork Mon Jan 27 13:21:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: iyzsong--- via Guix-patches via X-Patchwork-Id: 37780 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6A94327BBE9; Mon, 27 Jan 2025 13:19:54 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7826227BBEA for ; Mon, 27 Jan 2025 13:19:53 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcP1j-0000zE-24; Mon, 27 Jan 2025 08:19:46 -0500 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 1tcP16-0000eR-8J for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcP15-0002r8-Nu for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=yokAar2H3c9cPLWaNK8YphafksKNhrv4hiwLY1Wy7F0=; b=Ax3BNucuEZWLzZGysVJj8AfPB5eIHZBIqGl7ZQku6S7u1jUT3AVF1m+F8Kw4sAfANARcNAvgwjj5HOzET9oS7OUwl4ZFmfgT3qRB48MdvSwVYxojYFJAzeviEm8SpSZfr7UsYEOqEfOGLWOwGwITsI/dSJ+ciaH7btgEq4LrE/cDo0B7VZYl15h7gSg4KBxwnp+61f676cK7QHNOrz6VullFO5LFVo7nPUjzYvu0fILkGG9w3TJuUoFMVezB036PYP3PK4wai9mWNYnC81deJcdnxAsV7oz6Ei8MvPE2bapKavPKalazbn9LOiXOl4SowHxIJGVSSChfczDqIDgQgA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tcP13-0002OW-SE; Mon, 27 Jan 2025 08:19:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75688] [PATCH v3 1/4] gnu: glib: Support load search paths from etc/search-paths.d files. References: In-Reply-To: Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, vivien@planete-kraus.eu, guix-patches@gnu.org Resent-Date: Mon, 27 Jan 2025 13:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75688 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75688@debbugs.gnu.org Cc: =?utf-8?b?5a6L5paH5q2m?= , Liliana Marie Prikler , Maxim Cournoyer , Vivien Kraus X-Debbugs-Original-Xcc: Liliana Marie Prikler , Maxim Cournoyer , Vivien Kraus Received: via spool by 75688-submit@debbugs.gnu.org id=B75688.17379838949114 (code B ref 75688); Mon, 27 Jan 2025 13:19:01 +0000 Received: (at 75688) by debbugs.gnu.org; 27 Jan 2025 13:18:14 +0000 Received: from localhost ([127.0.0.1]:59921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tcP0I-0002Mu-1C for submit@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:14 -0500 Received: from mail.envs.net ([5.199.136.28]:51064) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tcP07-0002MG-QJ for 75688@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:05 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 4ABB538A3DBF; Mon, 27 Jan 2025 13:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1737983882; bh=yokAar2H3c9cPLWaNK8YphafksKNhrv4hiwLY1Wy7F0=; h=From:To:Cc:Subject:Date:From; b=iUAD7Q2wZdw7aD7nrUDNeg1LQ0OalSEBoO8mtkfbDGPonL7KZL/fr2FwK/TN8W1MJ ew+nuX6ri7Te1BH/CNl/DEyrG33tgLO1OpwOiTTCy0EJPEVgTt0KzGZurXszmIUm1U v2ymzgH4jpnerKyjybyv6X7zeRVuCJWKhzFGctHcoN99aPkhbsuP/MsHupljtUQvn8 I/0gt125JXE7gix/6A0EOwKfrGsHqmyv6/dd3cgiL6KyInoa1qq7Ajf/bt+F+kx5M9 Dv/AHjXlQ/yLxyUZExsKne4/DOgUfilTefJdHYQVGOQRwd6DH8w7UiuSiaCg1Ky+AT R93UM3yWp4/FatS00zD3TzpCbpG7lCZ3d0vshScOmj98WJ7lzd7k3x5WQza12RQrT0 Aa7qZX5Tr6IB3wKkNBH3usesO0hkFIDyzr0pA336NTE0GyAaDc/KK7fB8xQIUqFNRx UnISSN9EoKNjX+lgvODWArnx5q3pNDRUBA1ZSMeS9NW5LHqcGpcXsE0lbYESX2/gNz aZVr0l7e0UCoJfZdYJo1hY8MttQazoDIvNrm5UqjnP8hqPN/+8KC2JDFUWIx5wsLxp pn2vwcQ/SIlRYksVtSv9zWe/dI/Hn+8yaBLPMAgfow/PIr58nOs/YGU4Uj3oJXPeWX fyJ1qVyeCX9d1oZSJxymgQOs= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PBqqLHXG40tn; Mon, 27 Jan 2025 13:17:58 +0000 (UTC) Received: from localhost (unknown [112.44.100.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Mon, 27 Jan 2025 13:17:58 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id e247316f; Mon, 27 Jan 2025 13:21:33 +0000 (UTC) Date: Mon, 27 Jan 2025 21:21:20 +0800 Message-ID: <1df5c051d9d5e61894a49761415f69f7503451d0.1737983975.git.iyzsong@member.fsf.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: iyzsong@envs.net X-ACL-Warn: , iyzsong--- via Guix-patches X-Patchwork-Original-From: iyzsong--- via Guix-patches via From: iyzsong--- via Guix-patches via Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: 宋文武 Add a new function "g_build_guix_search_path_dirs" to GLIB, which in addition to environment variables, reads search path values from the etc/search-paths.d directory of the current executable. This can be used to replace wrapper scripts. Use it for GUIX_GSETTINGS_SCHEMA_DIR, GUIX_GIO_EXTRA_MODULES, GUIX_XDG_DATA_DIRS and GUIX_XDG_CONFIG_DIRS. * gnu/packages/patches/glib-guix-search-paths.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/glib.scm (glib)[source]: Add patch. [native-search-paths]: Add GUIX_GSETTINGS_SCHEMA_DIR. Replace GIO_EXTRA_MODULES with GUIX_GIO_EXTRA_MODULES. Change-Id: I1d6d113fc38b20ebd4dce195f6d9c58ce85967e4 Reviewed-by: Maxim Cournoyer --- gnu/local.mk | 1 + gnu/packages/glib.scm | 9 +- .../patches/glib-guix-search-paths.patch | 162 ++++++++++++++++++ 3 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/glib-guix-search-paths.patch base-commit: 77603927fba0edc2c4d9de122aa132b968a051e5 diff --git a/gnu/local.mk b/gnu/local.mk index 6961b8816c..7ae66dd57d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1438,6 +1438,7 @@ dist_patch_DATA = \ %D%/packages/patches/git-filter-repo-generate-doc.patch \ %D%/packages/patches/gklib-suitesparse.patch \ %D%/packages/patches/glib-appinfo-watch.patch \ + %D%/packages/patches/glib-guix-search-paths.patch \ %D%/packages/patches/glib-skip-failing-test.patch \ %D%/packages/patches/glibc-2.33-riscv64-miscompilation.patch \ %D%/packages/patches/glibc-2.39-git-updates.patch \ diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index e04eedb7ba..0704ba2c53 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -258,7 +258,8 @@ (define glib (base32 "0c3vagxl77wma85qinbj974jvw96n5bvch2m7hqcwxq8fa5spsj4")) (patches (search-patches "glib-appinfo-watch.patch" - "glib-skip-failing-test.patch")) + "glib-skip-failing-test.patch" + "glib-guix-search-paths.patch")) (modules '((guix build utils))) (snippet '(begin @@ -516,9 +517,13 @@ (define glib (search-path-specification (variable "XDG_DATA_DIRS") (files '("share"))) + ;; To load gsettings schemas from GTK, etc. + (search-path-specification + (variable "GUIX_GSETTINGS_SCHEMA_DIR") + (files '("share/glib-2.0/schemas"))) ;; To load extra gio modules from glib-networking, etc. (search-path-specification - (variable "GIO_EXTRA_MODULES") + (variable "GUIX_GIO_EXTRA_MODULES") (files '("lib/gio/modules"))))) (search-paths native-search-paths) (synopsis "Low-level core library for GNOME projects") diff --git a/gnu/packages/patches/glib-guix-search-paths.patch b/gnu/packages/patches/glib-guix-search-paths.patch new file mode 100644 index 0000000000..565c045a55 --- /dev/null +++ b/gnu/packages/patches/glib-guix-search-paths.patch @@ -0,0 +1,162 @@ +diff --git a/gio/giomodule.c b/gio/giomodule.c +index 76c2028..7afa8ef 100644 +--- a/gio/giomodule.c ++++ b/gio/giomodule.c +@@ -1330,6 +1330,13 @@ _g_io_modules_ensure_loaded (void) + g_io_modules_scan_all_in_directory_with_scope (module_dir, scope); + g_free (module_dir); + ++ /* Load modules from GUIX_GIO_EXTRA_MODULES. */ ++ gchar **guix_giomodule_dirs = g_build_guix_search_path_dirs ("GUIX_GIO_EXTRA_MODULES"); ++ for (int i = 0; guix_giomodule_dirs[i] != NULL; i++) { ++ g_io_modules_scan_all_in_directory_with_scope (guix_giomodule_dirs[i], scope); ++ } ++ g_strfreev (guix_giomodule_dirs); ++ + g_io_module_scope_free (scope); + + /* Initialize types from built-in "modules" */ +diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c +index e8ccc8c..6ac0f32 100644 +--- a/gio/gsettingsschema.c ++++ b/gio/gsettingsschema.c +@@ -354,6 +354,13 @@ initialise_schema_sources (void) + while (i--) + try_prepend_data_dir (dirs[i]); + ++ /* Load schemas from GUIX_GSETTINGS_SCHEMA_DIR. */ ++ char **guix_schema_dirs = g_build_guix_search_path_dirs ("GUIX_GSETTINGS_SCHEMA_DIR"); ++ i = g_strv_length(guix_schema_dirs); ++ while (i--) ++ try_prepend_dir (guix_schema_dirs[i]); ++ g_strfreev (guix_schema_dirs); ++ + try_prepend_data_dir (g_get_user_data_dir ()); + + /* Disallow loading extra schemas if running as setuid, as that could +diff --git a/glib/gutils.c b/glib/gutils.c +index 8628a56..0f71890 100644 +--- a/glib/gutils.c ++++ b/glib/gutils.c +@@ -2708,6 +2708,16 @@ g_build_system_data_dirs (void) + data_dir_vector = g_strsplit (data_dirs, G_SEARCHPATH_SEPARATOR_S, 0); + #endif + ++ /* Use data files from GUIX_XDG_DATA_DIRS. */ ++ GStrvBuilder *builder = g_strv_builder_new (); ++ g_strv_builder_addv (builder, (const gchar **) data_dir_vector); ++ g_strfreev (data_dir_vector); ++ data_dir_vector = g_build_guix_search_path_dirs ("GUIX_XDG_DATA_DIRS"); ++ g_strv_builder_addv (builder, (const gchar **) data_dir_vector); ++ g_strfreev (data_dir_vector); ++ data_dir_vector = g_strv_builder_end (builder); ++ g_strv_builder_unref (builder); ++ + return g_steal_pointer (&data_dir_vector); + } + +@@ -2800,6 +2810,16 @@ g_build_system_config_dirs (void) + conf_dir_vector = g_strsplit (conf_dirs, G_SEARCHPATH_SEPARATOR_S, 0); + #endif + ++ /* Use config files from GUIX_XDG_CONFIG_DIRS. */ ++ GStrvBuilder *builder = g_strv_builder_new (); ++ g_strv_builder_addv (builder, (const gchar **) conf_dir_vector); ++ g_strfreev (conf_dir_vector); ++ conf_dir_vector = g_build_guix_search_path_dirs ("GUIX_XDG_CONFIG_DIRS"); ++ g_strv_builder_addv (builder, (const gchar **) conf_dir_vector); ++ g_strfreev (conf_dir_vector); ++ conf_dir_vector = g_strv_builder_end (builder); ++ g_strv_builder_unref (builder); ++ + return g_steal_pointer (&conf_dir_vector); + } + +@@ -2849,6 +2869,73 @@ g_get_system_config_dirs (void) + return system_config_dirs; + } + ++gchar ** ++g_build_guix_search_path_dirs (const gchar *variable) ++{ ++ gchar **dirs = NULL; ++ char *value = NULL; ++ GStrvBuilder *builder = g_strv_builder_new (); ++ ++ /* First add paths from the etc/search-paths.d, which can be used to replace wrapper script. */ ++ gchar *out_path = NULL; ++ gchar *search_paths_d = NULL; ++ gchar *exe_path = g_file_read_link ("/proc/self/exe", NULL); ++ ++ /* For scripts, we use GUIX_MAIN_SCRIPT_PATH to find its location. */ ++ if (g_strcmp0 (exe_path, g_getenv ("GUIX_INTERPRETER_PATH")) == 0) { ++ g_free (exe_path); ++ exe_path = g_getenv ("GUIX_MAIN_SCRIPT_PATH"); ++ } ++ ++ /* We install executables under "bin" or "libexec", can also be a subdirectory of "libexec". */ ++ if (exe_path && (g_str_match_string("/bin/", exe_path, FALSE) || ++ g_str_match_string("/libexec/", exe_path, FALSE))) { ++ /* Find output directory, which is the parent directory of "bin" or "libexec". */ ++ out_path = g_path_get_dirname (exe_path); ++ while (g_str_match_string("/bin/", out_path, FALSE) || ++ g_str_match_string("/libexec/", out_path, FALSE)) { ++ gchar *dir_path = out_path; ++ out_path = g_path_get_dirname (dir_path); ++ g_free (dir_path); ++ } ++ ++ /* Now add paths from etc/search-paths.d/VARIABLE file. */ ++ search_paths_d = g_build_filename (out_path, "etc", "search-paths.d", NULL); ++ if (g_file_test (search_paths_d, G_FILE_TEST_EXISTS)) { ++ gchar *var_path = g_build_filename (search_paths_d, variable, NULL); ++ if (g_file_get_contents (var_path, &value, NULL, NULL)) { ++ dirs = g_strsplit (value, G_SEARCHPATH_SEPARATOR_S, 0); ++ g_strv_builder_addv (builder, (const gchar **) dirs); ++ g_strfreev (dirs); ++ g_free (value); ++ } ++ g_free (var_path); ++ } ++ } ++ ++ free (exe_path); ++ g_free (out_path); ++ g_free (search_paths_d); ++ ++ /* Then add paths from the environment variable. */ ++ gboolean is_setuid = GLIB_PRIVATE_CALL (g_check_setuid) (); ++ if (is_setuid) /* we don't want to access arbitrary files when running as setuid. */ ++ value = NULL; ++ else ++ value = g_strdup (g_getenv (variable)); ++ ++ if (value && value[0]) { ++ dirs = g_strsplit (value, G_SEARCHPATH_SEPARATOR_S, 0); ++ g_strv_builder_addv (builder, (const gchar **) dirs); ++ g_strfreev (dirs); ++ } ++ g_free (value); ++ ++ dirs = g_strv_builder_end (builder); ++ g_strv_builder_unref (builder); ++ return dirs; ++} ++ + /** + * g_nullify_pointer: + * @nullify_location: (not nullable): the memory address of the pointer. +diff --git a/glib/gutils.h b/glib/gutils.h +index efc6914..710cf27 100644 +--- a/glib/gutils.h ++++ b/glib/gutils.h +@@ -36,6 +36,9 @@ + + G_BEGIN_DECLS + ++GLIB_AVAILABLE_IN_ALL ++gchar **g_build_guix_search_path_dirs (const gchar *variable); ++ + GLIB_AVAILABLE_IN_ALL + const gchar * g_get_user_name (void); + GLIB_AVAILABLE_IN_ALL From patchwork Mon Jan 27 13:21:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: iyzsong--- via Guix-patches via X-Patchwork-Id: 37781 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D894C27BBE9; Mon, 27 Jan 2025 13:19:54 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D953627BBE2 for ; Mon, 27 Jan 2025 13:19:52 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcP1m-0000zf-Sk; Mon, 27 Jan 2025 08:19:48 -0500 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 1tcP1E-0000op-JN for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:18 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcP1D-0002sC-Pp; Mon, 27 Jan 2025 08:19:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=/KaaSOUKFB75BirDp0KvHjFv/N+Owkslf9p/0YF3b6o=; b=lt7vjI8M+zyIJNqf30H2B9SAoFNdO//kkHxsOL2e6tUofn8h7g2CyMz1+NlgoJY4ZdvRRPBgFGRWh7BtQQX4ZqY5am74DQZAFaDIBxnwmwfP0cOFdkyLhe83ZhNGk6CvJO4oRIJPFGxBofE2Ii8OW4zEV4bmk5bNWkomaKaKKgjioLt4xEgZugrjiwmGRU1gSmVG8a8W632P3T3HPpEOYsBQ10oPiPtNvvksEGlmL8bmwyaB+rpBbgebiQP+eOEIzwZZFzXED0GDQpZ4m+ZOjpHh5VBsdnM9s0j/E/v/2Moa5ZCIVM2rD1fnwx+q2Ph3ArVAR5Y7EcQKdQU2+GkFpA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tcP14-0002Od-Ep; Mon, 27 Jan 2025 08:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75688] [PATCH v3 2/4] gnu: python: Set GUIX_INTERPRETER_PATH and GUIX_MAIN_SCRIPT_PATH. Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, marius@gnu.org, me@bonfacemunyoki.com, sharlatanus@gmail.com, tanguy@bioneland.org, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Mon, 27 Jan 2025 13:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75688 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75688@debbugs.gnu.org Cc: =?utf-8?b?5a6L5paH5q2m?= , Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , Tanguy Le Carrour , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , Tanguy Le Carrour , jgart Received: via spool by 75688-submit@debbugs.gnu.org id=B75688.17379838959122 (code B ref 75688); Mon, 27 Jan 2025 13:19:02 +0000 Received: (at 75688) by debbugs.gnu.org; 27 Jan 2025 13:18:15 +0000 Received: from localhost ([127.0.0.1]:59923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tcP0I-0002Mx-Pc for submit@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:15 -0500 Received: from mail.envs.net ([5.199.136.28]:52478) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tcP0B-0002MR-U1 for 75688@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:08 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 0E69938A2C3E; Mon, 27 Jan 2025 13:18:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1737983887; bh=/KaaSOUKFB75BirDp0KvHjFv/N+Owkslf9p/0YF3b6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UV6lc+f5NMMUWyLEewpRoKvH9frRmuCHQpIZrogNzC+3rEBtjFNuxtn6xYe8C24pk bn620gJ2UKeHKmaeW9XqGvh1t815AkftpvmolHOfm0ZNGbgPuF9L20qzZSHfDTFKcn 7jWgiKqQb1Te1Pr40F+v4LzOYogTHf3nGimwRoZQlhypar1qU6ANKeyHElstkG0uE1 OzNcCg7PseArnEZcmO8jg4LpwxmJw/OEK7e/J7+NMEtGfBhmRUAkEfroRlhLIJ3m6B ycf0mvcC5lcSEO1wWTRWiJ3IbUL1Oyl+NWCSf8RaeYxf7fOBbGRUJ3EoRfjLbD9fkp mu7JDWJTPbsuJJPx7bCBXnXkF2nCcQ+aaLd1sn2ozfiNFeuVemRAhhRqZbYDexkpwn va9JKj+Xg5OdLr8wwnTbStb4U481qr7hO3pdSv/cEodJCoeVI1zS5Tj0ON0qq43+zH XJqBHULJAF4TuDoBDiOy4enOJRKLsy925DTnzcIf6KR/PmZoIlWLW12WRnp5wOusb5 2w7yJriiT/aOHcXxNBN/hEsUqKxFYf6ucEm0ciX3D/z2ZHoZuLEFf/Sr3UQkrsn1UM l+PePE/YShUSdrFy89wo7kN47hdzwmAhtfhnvX/BueZYmD5m6hATW5mwgrwomjohr+ Tede3l9S/OElHuPi+j8S5PNQ= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lw6k0LLY4GB6; Mon, 27 Jan 2025 13:18:03 +0000 (UTC) Received: from localhost (unknown [112.44.100.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Mon, 27 Jan 2025 13:18:02 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id d692a47c; Mon, 27 Jan 2025 13:21:33 +0000 (UTC) Date: Mon, 27 Jan 2025 21:21:21 +0800 Message-ID: <74079e8d389a7c278bdbbecac5075c4170446edf.1737983975.git.iyzsong@member.fsf.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <1df5c051d9d5e61894a49761415f69f7503451d0.1737983975.git.iyzsong@member.fsf.org> References: <1df5c051d9d5e61894a49761415f69f7503451d0.1737983975.git.iyzsong@member.fsf.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: iyzsong@envs.net X-ACL-Warn: , iyzsong--- via Guix-patches X-Patchwork-Original-From: iyzsong--- via Guix-patches via From: iyzsong--- via Guix-patches via Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: 宋文武 This is used by 'g_build_guix_search_path_dirs' in our patched GLIB. * gnu/packages/patches/python-3-set-GUIX_INTERPRETER_PATH.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/python.scm (python-3.10)[source]: Add it. Change-Id: I4588cbd087a783da1ad8c94fccda7ebf5e9f39ad --- gnu/local.mk | 1 + .../python-3-set-GUIX_INTERPRETER_PATH.patch | 28 +++++++++++++++++++ gnu/packages/python.scm | 3 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-3-set-GUIX_INTERPRETER_PATH.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7ae66dd57d..ba355dabf8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2085,6 +2085,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-3-arm-alignment.patch \ %D%/packages/patches/python-3-deterministic-build-info.patch \ %D%/packages/patches/python-3-search-paths.patch \ + %D%/packages/patches/python-3-set-GUIX_INTERPRETER_PATH.patch \ %D%/packages/patches/python-3-fix-tests.patch \ %D%/packages/patches/python-3-hurd-configure.patch \ %D%/packages/patches/python-angr-check-exec-deps.patch \ diff --git a/gnu/packages/patches/python-3-set-GUIX_INTERPRETER_PATH.patch b/gnu/packages/patches/python-3-set-GUIX_INTERPRETER_PATH.patch new file mode 100644 index 0000000000..2f173c68c8 --- /dev/null +++ b/gnu/packages/patches/python-3-set-GUIX_INTERPRETER_PATH.patch @@ -0,0 +1,28 @@ +The 'g_build_guix_search_path_dirs' function in our patched GLIB requires +2 environment variables (GUIX_INTERPRETER_PATH and GUIX_MAIN_SCRIPT_PATH) to +check if the current executable is a script launched by an interpreter, and +find the script path if it is. +--- +diff --git a/Modules/main.c b/Modules/main.c +index 5bb1de2..83ada3d 100644 +--- a/Modules/main.c ++++ b/Modules/main.c +@@ -636,6 +636,18 @@ pymain_run_python(int *exitcode) + prepended to sys.path. + + Otherwise, main_importer_path is left unchanged. */ ++ ++ /* Set environment variables to support 'search-paths.d'. */ ++ char *exe_path = realpath("/proc/self/exe", NULL); ++ PyObject *filename = PyUnicode_FromWideChar(config->run_filename, -1); ++ const char *main_script_path = PyUnicode_AsUTF8(filename); ++ if (exe_path != NULL && main_script_path != NULL) { ++ setenv("GUIX_INTERPRETER_PATH", exe_path, 1); ++ setenv("GUIX_MAIN_SCRIPT_PATH", main_script_path, 1); ++ } ++ free(exe_path); ++ Py_DECREF(filename); ++ + if (pymain_get_importer(config->run_filename, &main_importer_path, + exitcode)) { + return; diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index c5f98c3a46..7701d111c4 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -463,7 +463,8 @@ (define-public python-3.10 "python-3-fix-tests.patch" "python-3-hurd-configure.patch" "python-3-reproducible-build.patch" - "python-3-search-paths.patch")) + "python-3-search-paths.patch" + "python-3-set-GUIX_INTERPRETER_PATH.patch")) (sha256 (base32 "0j6wvh2ad5jjq5n7sjmj1k66mh6lipabavchc3rb4vsinwaq9vbf")) From patchwork Mon Jan 27 13:21:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: iyzsong--- via Guix-patches via X-Patchwork-Id: 37779 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4EDF327BBEA; Mon, 27 Jan 2025 13:19:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 823B027BBE2 for ; Mon, 27 Jan 2025 13:19:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcP1f-0000uV-2q; Mon, 27 Jan 2025 08:19:39 -0500 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 1tcP16-0000ek-D5 for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcP16-0002rA-3t for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=zWu41/CBIoo2ICxmGaAKoDqJ5EwUYXH6Z0OSbiCeVzY=; b=vBAXZFZl2ZB2yrZ+aXXfo4/3cCQN18reZhNUnsGfxeXvVbx+iiVgfk5Une+pHg5DqJHexQOAGZYvSjmMSI3bSBnmTn1jaQpQJwvvNmnn5ET+83d1VjeylbkgpoJAtw0A3KEnqMUe/NVIyrvdYT/3cFJRYkj8LJz8rf33LKc/O7Pl/Y8I19sFBgrAUs8BEqAb4gQE6d8gj2HCSJE3JA6vBsSb4MoudOpLc0TPhhhHGepydvO6u9xhZBih5IrGSVEvSnmmFLWpGvN3NBOTw488Rn76GP1zy+t/Ou/Nuud7dGG2Ca6Wbokh68RP+PnhervUTSBHjD4ogSYoztY6tUkLjw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tcP14-0002Ol-Ul for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75688] [PATCH v3 3/4] gnu: gtk: Add search-paths.d support for GUIX_GTK{2, 3, 4}_PATH. Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 27 Jan 2025 13:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75688 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75688@debbugs.gnu.org Cc: =?utf-8?b?5a6L5paH5q2m?= Received: via spool by 75688-submit@debbugs.gnu.org id=B75688.17379838969128 (code B ref 75688); Mon, 27 Jan 2025 13:19:02 +0000 Received: (at 75688) by debbugs.gnu.org; 27 Jan 2025 13:18:16 +0000 Received: from localhost ([127.0.0.1]:59925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tcP0J-0002N4-7V for submit@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:15 -0500 Received: from mail.envs.net ([5.199.136.28]:52480) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tcP0E-0002Mc-Qg for 75688@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:11 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id E877338A3DBF; Mon, 27 Jan 2025 13:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1737983889; bh=zWu41/CBIoo2ICxmGaAKoDqJ5EwUYXH6Z0OSbiCeVzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mTr/tvoPCuk6YnoASk6pwbHEvqatDScjDtAa4ISjH1eUuMmEPd46TQVCWWqHNx7JY E8nUjz7/yJK9NVYNjPY42iOZpoxqJHPn0Mjx44XF3BVjsDwh72/2YCrKQlnFg4f6Wq FcmJuSSga1OUc602zL5+N6FJaeOmuZOBOs434UwfaQmgxbl/LganlMOBBmJdDW9FiT i9KGbSsel+T7E7oUty1ORsCIi8kpLahktRtWDk2YRsceutSTlRnWK3XYzxv72H7T0Z FF0zcEsGKkwJgkitUxxQ9m8af60GIxKUXVzfXTOO7zU/FFJsPy23/IdZsQxkDeoEG3 bQ3BJLF4EcCP+GN3YMrD7BDWaTZFLtgWouaCY2vKBmWmXUFwERIrvA26qpnMwzP8MP gf8uPuGYOuraMfPZl6xhL7TAVgBuL6g72LgV1z1XZyQVVxcavOWFoPCYYSxCxl6QDJ q06BDi3sS6jLXv8Lfp/IOjKqf4krq08/zrrfmTLGF34KClAb2YEQdSP5yIk45Ak4qY lj6GxT+PlydzYcVt3HwKfmBluyor7d9PLxgml6LGRK/qGxQhUY1KwiNt9WOEFFt54W loYfgTeew9akRpNtOwqDTR++E/85nJc7PhM1RxipX8xaaNjGGRdgwhC8EGqNQiRH81 r0PrQ0NG64wGAyYiHsPTKc2g= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id B5V5E7U3uvOA; Mon, 27 Jan 2025 13:18:06 +0000 (UTC) Received: from localhost (unknown [112.44.100.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Mon, 27 Jan 2025 13:18:06 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b482d01f; Mon, 27 Jan 2025 13:21:34 +0000 (UTC) Date: Mon, 27 Jan 2025 21:21:22 +0800 Message-ID: <08a25b1c35ccc1fa3869bc1cdf3b6e8f883de4d6.1737983975.git.iyzsong@member.fsf.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <1df5c051d9d5e61894a49761415f69f7503451d0.1737983975.git.iyzsong@member.fsf.org> References: <1df5c051d9d5e61894a49761415f69f7503451d0.1737983975.git.iyzsong@member.fsf.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: iyzsong@envs.net X-ACL-Warn: , iyzsong--- via Guix-patches X-Patchwork-Original-From: iyzsong--- via Guix-patches via From: iyzsong--- via Guix-patches via Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: 宋文武 * gnu/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch, gnu/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch, gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch: Rewrite in terms of 'g_build_guix_search_path_dirs'. Change-Id: Ib0748c39e56fd598f30f40b9ac3bb0f012f14c31 Reviewed-by: Maxim Cournoyer --- .../patches/gtk2-respect-GUIX_GTK2_PATH.patch | 64 ++++++------------- .../patches/gtk3-respect-GUIX_GTK3_PATH.patch | 55 ++++++---------- .../patches/gtk4-respect-GUIX_GTK4_PATH.patch | 62 +++++------------- 3 files changed, 54 insertions(+), 127 deletions(-) diff --git a/gnu/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch b/gnu/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch index 93a8ddc242..fb6c7809f9 100644 --- a/gnu/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch +++ b/gnu/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch @@ -1,46 +1,20 @@ -This patch makes GTK+ look for additional modules in a list of directories -specified by the environment variable "GUIX_GTK2_PATH". This can be used -instead of "GTK_PATH" to make GTK+ find modules that are incompatible with -other major versions of GTK+. +diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c +index 50729b61a5..2d4c2c2a85 100644 +--- a/gtk/gtkmodules.c ++++ b/gtk/gtkmodules.c +@@ -96,5 +96,15 @@ get_module_path (void) + result = pango_split_file_list (module_path); + g_free (module_path); ---- a/gtk/gtkmodules.c 2014-09-29 22:02:17.000000000 +0200 -+++ b/gtk/gtkmodules.c 2015-12-02 18:41:53.306396938 +0100 -@@ -55,6 +55,7 @@ - get_module_path (void) - { - const gchar *module_path_env; -+ const gchar *module_guix_gtk2_path_env; - const gchar *exe_prefix; - const gchar *home_dir; - gchar *home_gtk_dir = NULL; -@@ -70,6 +71,7 @@ - home_gtk_dir = g_build_filename (home_dir, ".gtk-2.0", NULL); - - module_path_env = g_getenv ("GTK_PATH"); -+ module_guix_gtk2_path_env = g_getenv ("GUIX_GTK2_PATH"); - exe_prefix = g_getenv ("GTK_EXE_PREFIX"); - - if (exe_prefix) -@@ -77,9 +79,21 @@ - else - default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL); - -- if (module_path_env && home_gtk_dir) -+ if (module_guix_gtk2_path_env && module_path_env && home_gtk_dir) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk2_path_env, module_path_env, home_gtk_dir, default_dir, NULL); -+ else if (module_guix_gtk2_path_env && home_gtk_dir) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk2_path_env, home_gtk_dir, default_dir, NULL); -+ else if (module_guix_gtk2_path_env && module_path_env) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk2_path_env, module_path_env, default_dir, NULL); -+ else if (module_path_env && home_gtk_dir) - module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, - module_path_env, home_gtk_dir, default_dir, NULL); -+ else if (module_guix_gtk2_path_env) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk2_path_env, default_dir, NULL); - else if (module_path_env) - module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, - module_path_env, default_dir, NULL); ++ /* GUIX: Load additional modules from GUIX_GTK2_PATH. */ ++ GStrvBuilder *builder = g_strv_builder_new (); ++ g_strv_builder_addv (builder, (const gchar **) result); ++ g_strfreev (result); ++ result = g_build_guix_search_path_dirs ("GUIX_GTK2_PATH"); ++ g_strv_builder_addv (builder, (const gchar **) result); ++ g_strfreev (result); ++ result = g_strv_builder_end (builder); ++ g_strv_builder_unref (builder); ++ + return result; + } diff --git a/gnu/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch b/gnu/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch index 66fd2fd1c4..28e232a812 100644 --- a/gnu/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch +++ b/gnu/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch @@ -1,38 +1,21 @@ -This patch makes GTK+ look for additional modules in a list of directories -specified by the environment variable "GUIX_GTK3_PATH". This can be used -instead of "GTK_PATH" to make GTK+ find modules that are incompatible with -other major versions of GTK+. - ---- a/gtk/gtkmodules.c 2015-09-20 20:09:05.060590217 +0200 -+++ b/gtk/gtkmodules.c 2015-09-20 20:10:33.423124833 +0200 -@@ -52,6 +52,7 @@ - get_module_path (void) - { - const gchar *module_path_env; -+ const gchar *module_guix_gtk3_path_env; - const gchar *exe_prefix; - gchar *module_path; - gchar *default_dir; -@@ -61,6 +62,7 @@ - return result; +diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c +index f93101c272..b57e1da802 100644 +--- a/gtk/gtkmodules.c ++++ b/gtk/gtkmodules.c +@@ -81,6 +81,16 @@ get_module_path (void) + result = gtk_split_file_list (module_path); + g_free (module_path); - module_path_env = g_getenv ("GTK_PATH"); -+ module_guix_gtk3_path_env = g_getenv ("GUIX_GTK3_PATH"); - exe_prefix = g_getenv ("GTK_EXE_PREFIX"); ++ /* GUIX: Load additional modules from GUIX_GTK3_PATH. */ ++ GStrvBuilder *builder = g_strv_builder_new (); ++ g_strv_builder_addv (builder, (const gchar **) result); ++ g_strfreev (result); ++ result = g_build_guix_search_path_dirs ("GUIX_GTK3_PATH"); ++ g_strv_builder_addv (builder, (const gchar **) result); ++ g_strfreev (result); ++ result = g_strv_builder_end (builder); ++ g_strv_builder_unref (builder); ++ + return result; + } - if (exe_prefix) -@@ -68,7 +70,13 @@ - else - default_dir = g_build_filename (_gtk_get_libdir (), "gtk-3.0", NULL); - -- if (module_path_env) -+ if (module_guix_gtk3_path_env && module_path_env) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk3_path_env, module_path_env, default_dir, NULL); -+ else if (module_guix_gtk3_path_env) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk3_path_env, default_dir, NULL); -+ else if (module_path_env) - module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, - module_path_env, default_dir, NULL); - else diff --git a/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch index 4a60023bf7..56c202ecf4 100644 --- a/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch +++ b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch @@ -1,51 +1,21 @@ -From 889294a93fc6464c2c2919bc47f6fd85ec823363 Mon Sep 17 00:00:00 2001 -From: Raghav Gururajan -Date: Tue, 18 May 2021 19:57:00 -0400 -Subject: [PATCH] [PATCH]: Honor GUIX_GTK4_PATH. - -This patch makes GTK look for additional modules in a list of directories -specified by the environment variable "GUIX_GTK4_PATH". This can be used -instead of "GTK_PATH" to make GTK find modules that are incompatible with -other major versions of GTK. ---- - gtk/gtkmodules.c | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c -index aace5dcbc9..193b6a02e9 100644 +index 51b0916624..0cd6ee7e30 100644 --- a/gtk/gtkmodules.c +++ b/gtk/gtkmodules.c -@@ -105,6 +105,7 @@ static char ** - get_module_path (void) - { - const char *module_path_env; -+ const gchar *module_guix_gtk4_path_env; - const char *exe_prefix; - char *module_path; - char *default_dir; -@@ -114,6 +115,7 @@ get_module_path (void) - return result; +@@ -132,6 +132,16 @@ get_module_path (void) + result = split_file_list (module_path); + g_free (module_path); - module_path_env = g_getenv ("GTK_PATH"); -+ module_guix_gtk4_path_env = g_getenv ("GUIX_GTK4_PATH"); - exe_prefix = g_getenv ("GTK_EXE_PREFIX"); ++ /* GUIX: Load additional modules from GUIX_GTK4_PATH. */ ++ GStrvBuilder *builder = g_strv_builder_new (); ++ g_strv_builder_addv (builder, (const gchar **) result); ++ g_strfreev (result); ++ result = g_build_guix_search_path_dirs ("GUIX_GTK4_PATH"); ++ g_strv_builder_addv (builder, (const gchar **) result); ++ g_strfreev (result); ++ result = g_strv_builder_end (builder); ++ g_strv_builder_unref (builder); ++ + return result; + } - if (exe_prefix) -@@ -121,7 +123,13 @@ get_module_path (void) - else - default_dir = g_build_filename (_gtk_get_libdir (), "gtk-4.0", NULL); - -- if (module_path_env) -+ if (module_guix_gtk4_path_env && module_path_env) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk4_path_env, module_path_env, default_dir, NULL); -+ else if (module_guix_gtk4_path_env) -+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, -+ module_guix_gtk4_path_env, default_dir, NULL); -+ else if (module_path_env) - module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, - module_path_env, default_dir, NULL); - else --- -2.31.1 - From patchwork Mon Jan 27 13:21:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: iyzsong--- via Guix-patches via X-Patchwork-Id: 37778 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AE38827BBE2; Mon, 27 Jan 2025 13:19:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7FC2227BBE9 for ; Mon, 27 Jan 2025 13:19:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcP1D-0000jP-SO; Mon, 27 Jan 2025 08:19:12 -0500 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 1tcP16-0000eS-85 for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcP15-0002rD-M8 for guix-patches@gnu.org; Mon, 27 Jan 2025 08:19:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=O+ThQ9+miYrsemYH2OfZGMrx0nUEjWKuB9zyO/EhGj8=; b=ZC7d4hZ2tHsI3+BCFVAQDH5VeWmL7BXZZsjKGGl40YBn8M3pRjrmzfdACf1TNWxkMThWxdOW2SqZyGKGru6WflBb5AoFIzfkiTrfk9q65IJDUyWlyXsXyqhTMdBvh4IqcjBPO06molULwBtgcMyGGNY3sD7Rm8GEq3EU2+eohHNzFoHYXF74/vIhdUMLNrcuw4eJbOyzRW8Pdlj6KoIeXYPY27dAAROTQTma7VdOgscQ0Osy0Ku+QZsswMXaAUFPMdYkkSagEI0WqP+qbtkytNalcmDSacmuEphQ3YrrJ9w+awufoRuZAVrGTzqscjSu1NhigntKBHkgjSTyZe6R+A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tcP15-0002Ov-DW; Mon, 27 Jan 2025 08:19:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75688] [PATCH v3 4/4] build: glib-or-gtk-build-system: Replace wrapper scripts with 'search-paths.d'. Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, vivien@planete-kraus.eu, guix-patches@gnu.org Resent-Date: Mon, 27 Jan 2025 13:19:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75688 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75688@debbugs.gnu.org Cc: =?utf-8?b?5a6L5paH5q2m?= , Liliana Marie Prikler , Maxim Cournoyer , Vivien Kraus X-Debbugs-Original-Xcc: Liliana Marie Prikler , Maxim Cournoyer , Vivien Kraus Received: via spool by 75688-submit@debbugs.gnu.org id=B75688.17379839019142 (code B ref 75688); Mon, 27 Jan 2025 13:19:03 +0000 Received: (at 75688) by debbugs.gnu.org; 27 Jan 2025 13:18:21 +0000 Received: from localhost ([127.0.0.1]:59927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tcP0O-0002NM-4l for submit@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:21 -0500 Received: from mail.envs.net ([5.199.136.28]:52490) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tcP0F-0002Me-Nh for 75688@debbugs.gnu.org; Mon, 27 Jan 2025 08:18:13 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id D7B5338A3E6D; Mon, 27 Jan 2025 13:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1737983890; bh=O+ThQ9+miYrsemYH2OfZGMrx0nUEjWKuB9zyO/EhGj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qjWU7a7eYC7iUkD35Uxnml9dsLlqT+LdwyBk/CCbyc89J+tIs5yTRaT+UYQzydaCS wxderqpiH4lYY1h/zw5I+nBwVAJQGFS/F5Pnb6Ejk9ZIkybeteM0tV+GwmtVd4JChK 0smEVnT3OQ0m1Sj/BopcLbluSvrTUl7LYjWpAXeYQPPqjC89URMkcEUHggtZ9KJ0Lh 8B3+3kJyyyHO6+OZSz1Xo0FzTn6E9evfJ34LyNORVtVJFM2kfdjANFHqJsP6MnAlOP d0ZkrHRJn2QfmrqV76PHdwKuxm2QgqUXONx173Hlm5XAjK7Wt2ADDUM5QFzP61LG1p WDDWh/IJPeAe9kb5gTghjiqsyK4VWmcbOZtONNUnr0ysqfMB8Y09FdTE+wJhDNi3U8 zjv7rMC30AkvHSZqXUjw4NxaAqSjgiB21hzKlELE0+/EAfjD4eNaPfC519F89pA7hF LvmcjY7VKFw16ZpSk1geE0/r9Xyvm50we3OO43JgO1bQ3sgVJtq4lNqzx30X/47AwR zBzBhDX5/hb5g+JIlE2v/V7QfWtEERIi+g/FrjjKnDw7RuRv7v7SBk2FdYUQ3S76WZ dL9PXTyvgGFIaivI68aTd+I1jvl0tRyK/f8rOsMizrKvxnJet7iUxdCQNzbXSjoUju aUK448Xsqeh5kd1NM1wUAlOw= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id u6efFIVEjPTx; Mon, 27 Jan 2025 13:18:07 +0000 (UTC) Received: from localhost (unknown [112.44.100.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Mon, 27 Jan 2025 13:18:06 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 095c186e; Mon, 27 Jan 2025 13:21:34 +0000 (UTC) Date: Mon, 27 Jan 2025 21:21:23 +0800 Message-ID: <06a62fdc2853a732baf3f6396d38293f38c11860.1737983975.git.iyzsong@member.fsf.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <1df5c051d9d5e61894a49761415f69f7503451d0.1737983975.git.iyzsong@member.fsf.org> References: <1df5c051d9d5e61894a49761415f69f7503451d0.1737983975.git.iyzsong@member.fsf.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: iyzsong@envs.net X-ACL-Warn: , iyzsong--- via Guix-patches X-Patchwork-Original-From: iyzsong--- via Guix-patches via From: iyzsong--- via Guix-patches via Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: 宋文武 * guix/build/glib-or-gtk-build-system.scm (write-search-path-file): New procedure. (gtk-module-directories): Add version to arguments. (gsettings-schema-directories): New procedure. (data-directories): Don't check for "/glib-2.0/schemas". (conf-directories): New procedure. (wrap-all-programs): Rewrite in terms of 'write-search-path-file'. Change-Id: I1c9e8d491b96e298d1568a5e29b04c762c26e4d1 --- guix/build/glib-or-gtk-build-system.scm | 166 ++++++++++++++---------- 1 file changed, 95 insertions(+), 71 deletions(-) diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm index 67a52ddad3..335a856575 100644 --- a/guix/build/glib-or-gtk-build-system.scm +++ b/guix/build/glib-or-gtk-build-system.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Mark H Weaver ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2025 宋文武 ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +40,13 @@ (define-module (guix build glib-or-gtk-build-system) ;; ;; Code: +(define* (write-search-path-file output variable value) + "Write VALUE to @file{etc/search-paths.d/VARIABLE} under OUTPUT." + (let ((search-paths.d (string-append output "/etc/search-paths.d"))) + (mkdir-p search-paths.d) + (with-output-to-file (string-append search-paths.d "/" variable) + (lambda () (display value))))) + (define (subdirectory-exists? parent sub-directory) (directory-exists? (string-append parent sub-directory))) @@ -47,32 +55,12 @@ (define (directory-included? directory directories-list) (fold (lambda (s p) (or (string-ci=? s directory) p)) #f directories-list)) -;; We do not include $HOME/.guix-profile/gtk-v.0 (v=2 or 3) because we do not -;; want to mix gtk+-2 and gtk+-3 modules. See -;; https://developer.gnome.org/gtk3/stable/gtk-running.html -(define (gtk-module-directories inputs) - "Check for the existence of \"libdir/gtk-v.0\" in INPUTS. Return a list +;; We load GTK modules via the GUIX_GTK2_PATH, GUIX_GTK3_PATH and GUIX_GTK4_PATH +;; search paths. +(define (gtk-module-directories inputs version) + "Check for the existence of \"libdir/gtk-VERSION\" in INPUTS. Return a list with all found directories." - (let* ((version - (cond - ((string-match "gtk-4" - (or (assoc-ref inputs "gtk") - (assoc-ref inputs "source") - "")) - "4.0") - ((string-match "gtk\\+-3" - (or (assoc-ref inputs "gtk+") - (assoc-ref inputs "source") - "")) - "3.0") - ((string-match "gtk\\+-2" - (or (assoc-ref inputs "gtk+") - (assoc-ref inputs "source") - "")) - "2.0") - (else - "4.0"))) ; We default to version 4.0. - (gtk-module + (let ((gtk-module (lambda (input prev) (let* ((in (match input ((_ . dir) dir) @@ -85,27 +73,22 @@ (define (gtk-module-directories inputs) prev))))) (fold gtk-module '() inputs))) -;; See +;; XDG data files include themes, sounds, icons, etc. See: ;; http://www.freedesktop.org/wiki/DesktopThemeSpec ;; http://freedesktop.org/wiki/Specifications/sound-theme-spec ;; http://freedesktop.org/wiki/Specifications/icon-theme-spec ;; -;; Currently desktop themes are not well supported and do not honor -;; XDG_DATA_DIRS. One example is evince which only looks for desktop themes -;; in $HOME/.themes (for backward compatibility) and in XDG_DATA_HOME (which -;; defaults to $HOME/.local/share). One way to handle these applications -;; appears to be by making $HOME/.themes a symlink to -;; $HOME/.guix-profile/share/themes. +;; We load them via XDG_DATA_DIRS (from profile, has higher priority) and +;; GUIX_XDG_DATA_DIRS (application specified) search paths. (define (data-directories inputs) - "Check for the existence of \"$datadir/glib-2.0/schemas\" or XDG themes data -in INPUTS. Return a list with all found directories." + "Check for the existence of XDG data files in INPUTS. Return a list with all found +directories." (define (data-directory input previous) (let* ((in (match input ((_ . dir) dir) (_ ""))) (datadir (string-append in "/share"))) - (if (and (or (subdirectory-exists? datadir "/glib-2.0/schemas") - (subdirectory-exists? datadir "/sounds") + (if (and (or (subdirectory-exists? datadir "/sounds") (subdirectory-exists? datadir "/themes") (subdirectory-exists? datadir "/cursors") (subdirectory-exists? datadir "/wallpapers") @@ -117,15 +100,45 @@ (define (data-directories inputs) (fold data-directory '() inputs)) +;;; XDG configuration files are expected to be installed in etc/xdg directory. +;;; We load them via XDG_CONFIG_DIRS (from profile, has higher priority) and +;;; GUIX_XDG_CONFIG_DIRS (application specified) search paths. +(define (conf-directories inputs) + "Check for the existence of XDG configuration files in INPUTS. Return a list with +all found directories." + (define (conf-directory input previous) + (let* ((in (match input + ((_ . dir) dir) + (_ ""))) + (conf-dir (string-append in "/etc/xdg"))) + (if (and (directory-exists? conf-dir) + (not (directory-included? conf-dir previous))) + (cons conf-dir previous) + previous))) + + (fold conf-directory '() inputs)) + +;;; GIO GSettings schemas are expected to be installed in $datadir/glib-2.0/schemas +;;; directory. We load them via the GUIX_GSETTINGS_SCHEMA_DIR search path. +(define (gsettings-schema-directories inputs) + "Check for the existence of \"$datadir/glib-2.0/schemas\" in INPUTS. +Return a list with all found directories." + (define (gsettings-schema-directory input previous) + (let* ((in (match input + ((_ . dir) dir) + (_ ""))) + (schema-dir (string-append in "/share/glib-2.0/schemas"))) + (if (and (directory-exists? schema-dir) + (not (directory-included? schema-dir previous))) + (cons schema-dir previous) + previous))) + + (fold gsettings-schema-directory '() inputs)) + ;; All GIO modules are expected to be installed in GLib's $libdir/gio/modules ;; directory. That directory has to include a file called giomodule.cache -;; listing all available modules. GIO can be made aware of modules in other -;; directories with the help of the environment variable GIO_EXTRA_MODULES. -;; The official GIO documentation states that this environment variable should -;; only be used for testing and not in a production environment. However, it -;; appears that there is no other way of specifying multiple modules -;; directories (NIXOS also does use this variable). See -;; https://developer.gnome.org/gio/stable/running-gio-apps.html +;; listing all available modules. We load them via the GUIX_GIO_EXTRA_MODULES +;; search path. (define (gio-module-directories inputs) "Check for the existence of \"$libdir/gio/modules\" in the INPUTS and returns a list with all found directories." @@ -141,50 +154,61 @@ (define (gio-module-directories inputs) (fold gio-module-directory '() inputs)) + +;;; XXX: Only works for ELF executables and python3 scripts. (define* (wrap-all-programs #:key inputs outputs (glib-or-gtk-wrap-excluded-outputs '()) #:allow-other-keys) "Implement phase \"glib-or-gtk-wrap\": look for GSettings schemas and -gtk+-v.0 libraries and create wrappers with suitably set environment variables +GTK libraries and create @file{etc/search-paths.d} with suitably set of files if found. Wrapping is not applied to outputs whose name is listed in GLIB-OR-GTK-WRAP-EXCLUDED-OUTPUTS. This is useful when an output is known not to contain any GLib or GTK+ binaries, and where wrapping would gratuitously -add a dependency of that output on GLib and GTK+." - ;; Do not require bash to be present in the package inputs - ;; even when there is nothing to wrap. - ;; Also, calculate (sh) only once to prevent some I/O. - (define %sh (delay (search-input-file inputs "bin/bash"))) - (define (sh) (force %sh)) +add a dependency of that output on GLib and GTK." (define handle-output (match-lambda ((output . directory) (unless (member output glib-or-gtk-wrap-excluded-outputs) - (let* ((bindir (string-append directory "/bin")) - (libexecdir (string-append directory "/libexec")) - (bin-list (filter (negate wrapped-program?) - (append (find-files bindir ".*") - (find-files libexecdir ".*")))) - (datadirs (data-directories + (let* ((datadirs (data-directories (alist-cons output directory inputs))) - (gtk-mod-dirs (gtk-module-directories + (confdirs (conf-directories (alist-cons output directory inputs))) - (gio-mod-dirs (gio-module-directories + (schemadirs (gsettings-schema-directories (alist-cons output directory inputs))) - (env-vars `(,@(if (not (null? datadirs)) - (list `("XDG_DATA_DIRS" ":" prefix ,datadirs)) - '()) - ,@(if (not (null? gtk-mod-dirs)) - (list `("GTK_PATH" ":" prefix ,gtk-mod-dirs)) - '()) - ,@(if (not (null? gio-mod-dirs)) - (list `("GIO_EXTRA_MODULES" ":" - prefix ,gio-mod-dirs)) - '())))) - (for-each (lambda (program) - (apply wrap-program program #:sh (sh) env-vars)) - bin-list)))))) + (gtk2-mod-dirs (gtk-module-directories + (alist-cons output directory inputs) + "2.0")) + (gtk3-mod-dirs (gtk-module-directories + (alist-cons output directory inputs) + "3.0")) + (gtk4-mod-dirs (gtk-module-directories + (alist-cons output directory inputs) + "4.0")) + (gio-mod-dirs (gio-module-directories + (alist-cons output directory inputs)))) + (when (not (null? datadirs)) + (write-search-path-file directory "GUIX_XDG_DATA_DIRS" + (string-join datadirs ":"))) + (when (not (null? confdirs)) + (write-search-path-file directory "GUIX_XDG_CONFIG_DIRS" + (string-join confdirs ":"))) + (when (not (null? schemadirs)) + (write-search-path-file directory "GUIX_GSETTINGS_SCHEMA_DIR" + (string-join schemadirs ":"))) + (when (not (null? gtk2-mod-dirs)) + (write-search-path-file directory "GUIX_GTK2_PATH" + (string-join gtk2-mod-dirs ":"))) + (when (not (null? gtk3-mod-dirs)) + (write-search-path-file directory "GUIX_GTK3_PATH" + (string-join gtk3-mod-dirs ":"))) + (when (not (null? gtk4-mod-dirs)) + (write-search-path-file directory "GUIX_GTK4_PATH" + (string-join gtk4-mod-dirs ":"))) + (when (not (null? gio-mod-dirs)) + (write-search-path-file directory "GUIX_GIO_EXTRA_MODULES" + (string-join gio-mod-dirs ":")))))))) (for-each handle-output outputs))