From patchwork Sat Jan 20 10:38:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 59222 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 EB8E627BBEA; Sat, 20 Jan 2024 11:13: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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 0560427BBE2 for ; Sat, 20 Jan 2024 11:13:54 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rR9Hb-0000I2-GH; Sat, 20 Jan 2024 06:13:03 -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 1rR9HY-0000GO-61 for guix-patches@gnu.org; Sat, 20 Jan 2024 06:13:00 -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 1rR9HX-0001e4-V0 for guix-patches@gnu.org; Sat, 20 Jan 2024 06:12:59 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rR9Ha-0003pV-MA for guix-patches@gnu.org; Sat, 20 Jan 2024 06:13:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68556] [PATCH gnome-team v4 3/8] gnu: gnome-shell-extensions: Wrap all the extensions. Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Jan 2024 11:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68556 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: liliana.prikler@gmail.com, 68556@debbugs.gnu.org Cc: rg@raghavgururajan.name, maxim.cournoyer@gmail.com Received: via spool by 68556-submit@debbugs.gnu.org id=B68556.170574912714569 (code B ref 68556); Sat, 20 Jan 2024 11:13:02 +0000 Received: (at 68556) by debbugs.gnu.org; 20 Jan 2024 11:12:07 +0000 Received: from localhost ([127.0.0.1]:32981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR9Gg-0003mn-Oi for submit@debbugs.gnu.org; Sat, 20 Jan 2024 06:12:07 -0500 Received: from planete-kraus.eu ([89.234.140.182]:54616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR9Gd-0003lb-3R for 68556@debbugs.gnu.org; Sat, 20 Jan 2024 06:12:03 -0500 Received: from planete-kraus.eu (localhost [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 4c601c15; Sat, 20 Jan 2024 11:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:in-reply-to:references:from:date:subject:to:cc :mime-version; s=albinoniA; bh=/Ug6HUson69ag4ZUrZz1RRPFMZc=; b=i U63VtGakPlw0U9xCOWlRTcBzwR39bhPi2W6e2j/XRHYqGV1buAsRf66sabR10ALL aJFP8o3jA95+WR6dFbk+QWcmXOpw86sBmgFELFuu3IeZsUMiJ1ltbXJj3bsEWFzP IlzUEXyOKFn8yZC/S57tn8GishKbuhwMfom5a0qFgotl8obYUn8LpL3EQHxbeFRu TlzWDtFxxO5NOlMa4X0xMXrxm+ebFow2rS4mI8JieFPVVOyrX/FfGkml4DYwqtee tG5/sTplEBQOwM6arbT3/HZQ05KuteSfDfKwAYjLv/8KJuoO2pmFNlxgcWQ8QfuG jH6c7f2IxLm0mJ284bKXw== Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id b0b4eadb (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sat, 20 Jan 2024 11:11:55 +0000 (UTC) Message-ID: <4bca25041b1890755ac5a10d92e546739fe53ea1.1705748530.git.vivien@planete-kraus.eu> In-Reply-To: References: Date: Sat, 20 Jan 2024 11:38:27 +0100 MIME-Version: 1.0 User-Agent: Evolution 3.48.4 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: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches X-Patchwork-Original-From: Vivien Kraus via Guix-patches via From: Vivien Kraus 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 The top-level modules that are wrapped are the /extension.js and /prefs.js of every extension sub-directory. * gnu/packages/gnome.scm (gnome-shell-extensions) [#:phase 'wrap-applications-menu]: Rename to 'wrap-extensions. Wrap every top-level module. [inputs]: Add glib. [propagated-imputs]: Remove glib. Change-Id: I88634970321aa8847857e45b369b4ba285caa87d --- gnu/packages/gnome.scm | 43 +++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index b449ed55db..0f9b2d89c6 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -10729,33 +10729,42 @@ (define-public gnome-shell-extensions #:configure-flags #~'("-Dextension_set=all") #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'wrap-applications-menu + (add-after 'unpack 'wrap-extensions (lambda _ (use-modules (ice-9 textual-ports)) - (call-with-output-file "extensions/apps-menu/extension.js-wrapped" - (lambda (out) - (format out "'~a'.split(':').forEach(" - (getenv "GI_TYPELIB_PATH")) - (display - (string-append "path => imports.gi.GIRepository.Repository" - ".prepend_search_path(path));\n") - out) - (display - (call-with-input-file "extensions/apps-menu/extension.js" - get-string-all) - out))) - (rename-file "extensions/apps-menu/extension.js-wrapped" - "extensions/apps-menu/extension.js")))))) + (let list-extensions ((dir (opendir "extensions"))) + (let ((extension (readdir dir))) + (unless (eof-object? extension) + (for-each + (lambda (file-to-wrap) + (when (file-exists? file-to-wrap) + (call-with-output-file + (string-append file-to-wrap "-wrapped") + (lambda (out) + (format out "'~a'.split(':').forEach(" + (getenv "GI_TYPELIB_PATH")) + (display + (string-append "path => imports.gi.GIRepository.Repository" + ".prepend_search_path(path));\n") + out) + (display + (call-with-input-file file-to-wrap + get-string-all) + out))) + (rename-file (string-append file-to-wrap "-wrapped") + file-to-wrap))) + (list (string-append "extensions/" extension "/extension.js") + (string-append "extensions/" extension "/prefs.js"))) + (list-extensions dir))))))))) (native-inputs (list `(,glib "bin") gettext-minimal pkg-config)) (inputs (list gobject-introspection ;to set GI_TYPELIB_PATH + glib gnome-menus ;for Applications Menu )) - (propagated-inputs - (list glib)) (synopsis "Extensions for GNOME Shell") (description "GNOME Shell extensions modify and extend GNOME Shell functionality and behavior.")