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: 59569 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 E33BB27BBEA; Mon, 29 Jan 2024 20:05:04 +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 AF5F327BBE2 for ; Mon, 29 Jan 2024 20:05:03 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUXrN-0000Z6-8x; Mon, 29 Jan 2024 15:04:01 -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 1rUXrH-0000Y6-Uv for guix-patches@gnu.org; Mon, 29 Jan 2024 15:03:55 -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 1rUXrH-0002iy-MP for guix-patches@gnu.org; Mon, 29 Jan 2024 15:03:55 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUXrQ-0003mI-3S for guix-patches@gnu.org; Mon, 29 Jan 2024 15:04:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68556] [PATCH gnome-team v5 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: Mon, 29 Jan 2024 20:04:04 +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: 68556@debbugs.gnu.org Cc: rg@raghavgururajan.name, vivien@planete-kraus.eu, liliana.prikler@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 68556-submit@debbugs.gnu.org id=B68556.170655860114393 (code B ref 68556); Mon, 29 Jan 2024 20:04:04 +0000 Received: (at 68556) by debbugs.gnu.org; 29 Jan 2024 20:03:21 +0000 Received: from localhost ([127.0.0.1]:33532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUXqi-0003k5-HI for submit@debbugs.gnu.org; Mon, 29 Jan 2024 15:03:20 -0500 Received: from planete-kraus.eu ([2a00:5881:4008:2810::309]:37772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUXqg-0003id-TX for 68556@debbugs.gnu.org; Mon, 29 Jan 2024 15:03:19 -0500 Received: from planete-kraus.eu (localhost [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 53b819e7; Mon, 29 Jan 2024 20:03:09 +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=TseOsr5bTnxVlRyjiq/IZKmuUsk=; b=Y VZ8axEjS3UNNec8H8HJ9EOeB2qLVT4+KyAw/jjrkzST8hLlf5dHJqV+D0d1bmo9l bAmK/f2cvk43dkDrAUZudIuZ2EgXBwfp4k5jf7K8k5MbfA6zikLViuH1L8rEE7Cs McCT7w4cigD7hXdOVQBt2g9MZ2dwO6+8ZfJSE9HqEZkMRz5P3seLS9E1s590NGtf MzjiDKJf6EiUrPPiuykl9aO2hK+FMLfAGfyOA1Gyk9nV1LUxP6qASor8L6As2gRK Qj1pO6iWYW5mit9TT0IPJklZRIxxOsmJyRwpJy1y1ez5vXDaq8hfZ+i4t4Jo7MIB jOwS1tGg9pttKOMTDvm2g== Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 3c542833 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 29 Jan 2024 20:03:08 +0000 (UTC) Message-ID: 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 | 45 +++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 04fc0500cd..8bc0491230 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -10729,32 +10729,41 @@ (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 gobject-introspection ;to set GI_TYPELIB_PATH pkg-config)) (inputs - (list gnome-menus)) ;for Applications Menu - (propagated-inputs - (list glib)) + (list glib + gnome-menus)) ;for Applications Menu (synopsis "Extensions for GNOME Shell") (description "GNOME Shell extensions modify and extend GNOME Shell functionality and behavior.")