From patchwork Fri Apr 12 17:26:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariqq X-Patchwork-Id: 62948 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 B6863166A6; Fri, 12 Apr 2024 18:48:05 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 3A3381628F for ; Fri, 12 Apr 2024 18:48:04 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvL0G-00015q-LM; Fri, 12 Apr 2024 13:47:56 -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 1rvL0F-00013i-3N for guix-patches@gnu.org; Fri, 12 Apr 2024 13:47:55 -0400 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 1rvL0E-00074Y-RU for guix-patches@gnu.org; Fri, 12 Apr 2024 13:47:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rvL0N-0007YT-UE; Fri, 12 Apr 2024 13:48:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70282] [PATCH v2] gnu: gnome-shell: Wrap screencast service. References: In-Reply-To: Resent-From: Dariqq Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, vivien@planete-kraus.eu, guix-patches@gnu.org Resent-Date: Fri, 12 Apr 2024 17:48:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70282 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70282@debbugs.gnu.org Cc: Dariqq , Liliana Marie Prikler , Maxim Cournoyer , Vivien Kraus X-Debbugs-Original-Xcc: Liliana Marie Prikler , Maxim Cournoyer , Vivien Kraus Received: via spool by 70282-submit@debbugs.gnu.org id=B70282.171294407628950 (code B ref 70282); Fri, 12 Apr 2024 17:48:03 +0000 Received: (at 70282) by debbugs.gnu.org; 12 Apr 2024 17:47:56 +0000 Received: from localhost ([127.0.0.1]:59536 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvL0E-0007WJ-1e for submit@debbugs.gnu.org; Fri, 12 Apr 2024 13:47:56 -0400 Received: from mout01.posteo.de ([185.67.36.65]:45029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvL09-0007UC-5s for 70282@debbugs.gnu.org; Fri, 12 Apr 2024 13:47:51 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D1FF5240027 for <70282@debbugs.gnu.org>; Fri, 12 Apr 2024 19:47:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712944052; bh=X2oid8sEb/Fk4KzGWLK2HSxty+Sad10oPwbPpPM7h7g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=Xa8aJgBo10/lKVuN8IXd26T0EL1K72svdW27a28MDbzWbDZ3o3UVxWmqMCX5oXBej zxCM4p0SaEVjtcl+7z4tV1TfV4hBCxEYkRuAhVwDNHyWKR+uDoSn23RH0ydyr29+Rb y7CvOSDZj/VMOrnjTQnjMgOXbZmqPEkYoHnO5KeFkyepG+3sh0X82t97NJMOdQThrQ 20XSKX93H7TOf1pX5RfO1sx5R90dNX9yfWy+ciynstObB7dfTcqzB211j/Qh8x10Ca h/PWgG/ZYa9l58WEYaps96Tvrkm8damhNZtlNOUsYUji/tZcQ9uGi1cOFCsBSGH0Fe oWz3isieXwJQg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VGPCm2Bvbz9rxG; Fri, 12 Apr 2024 19:47:32 +0200 (CEST) From: Dariqq Date: Fri, 12 Apr 2024 17:26:48 +0000 Message-ID: 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: , 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 screencast service can now find typelibs and gstreamer plugins. * gnu/packages/linux.scm (gnome-shell) [inputs]: Add gst-plugins-good and pipewire. [#:phases]<'wrap-programs>: Create a wrapper for screencast service and use it. Change-Id: I2c31bf1bd92e281b86c57b06988c6a3793a58d40 --- Hi, Here is v2 of the patch. The wrapper is now created manually as I was unable to find a way to manipulate the gstreamer plugin load path from within javascript. Importantly this leaves the original javascript file untouched and therefore circumvents the argv[0] problem in v1. All the required gstreamer plugins (pipewire and gst-plugins-good) are now inputs and are in the wrapper via GST_PLUGIN_SYSTEM_PATH. I've also left a comment for the required home-pipewire-service. In gnome-shell 45+ the invocation has changed to 'gjs -m service'. Should this also be a comment somewhere? gnu/packages/gnome.scm | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) base-commit: 3dc26b4eaed448cbc02a80bafb2ebb6d908f2b4e diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 4934ade3dd..d68624344f 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -9381,6 +9381,7 @@ (define-public gnome-shell (add-after 'install 'wrap-programs (lambda* (#:key inputs #:allow-other-keys) (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")) + (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")) (python-path (string-join (filter (lambda (item) @@ -9405,7 +9406,39 @@ (define-public gnome-shell (wrap-program (string-append #$output "/bin/" prog) `("GUIX_PYTHONPATH" ":" prefix (,python-path)) `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))) - '("gnome-shell-perf-tool"))))) + '("gnome-shell-perf-tool")) + ;; Make a wrapper for the screencast service + ;; Requires a pipewire service running + ;; (i.e. as provided by home-pipewire-service-type) + (let* ((screencast "org.gnome.Shell.Screencast") + (dir (string-append #$output "/share/gnome-shell/")) + (dbus-service-dir (string-append #$output + "/share/dbus-1/" + "services/")) + (wrapper (string-append dir screencast "-wrapper"))) + (call-with-output-file wrapper + (lambda (port) + (format port + (string-append + "#!~a~%" + "export GI_TYPELIB_PATH=~a~%" + "export GST_PLUGIN_SYSTEM_PATH=~a~%" + "exec \"~a\" \"~a\" \"$@\"~%") + (which "bash") + (format #f "\"~a${~a:+:}$~a\"" + gi-typelib-path + "GI_TYPELIB_PATH" "GI_TYPELIB_PATH") + (format #f "\"~a${~a:+:}$~a\"" + gst-plugin-path + "GST_PLUGIN_SYSTEM_PATH" + "GST_PLUGIN_SYSTEM_PATH") + (string-append #$(this-package-input "gjs") + "/bin/gjs") + (string-append dir screencast)))) + (chmod wrapper #o555) + (substitute* (string-append dbus-service-dir screencast + ".service") + (("Exec=.*") (string-append "Exec=" wrapper "\n"))))))) (add-after 'install 'rewire (lambda* (#:key inputs #:allow-other-keys) (for-each @@ -9465,6 +9498,7 @@ (define-public gnome-shell gnome-settings-daemon graphene gst-plugins-base + gst-plugins-good ibus libcanberra libcroco @@ -9475,6 +9509,7 @@ (define-public gnome-shell mesa-headers mutter network-manager-applet + pipewire polkit pulseaudio python-pygobject