From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 4GJ/GuoIJWbFogAA62LTzQ:P1 (envelope-from ) for ; Sun, 21 Apr 2024 14:39:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 4GJ/GuoIJWbFogAA62LTzQ (envelope-from ) for ; Sun, 21 Apr 2024 14:39:06 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=HrIpXXPe; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713703146; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=48jYRoyOXsASsO0KSPXxtqEhmqTIIFdpMDOefEoI+s8=; b=tLBm/tEjsvIEqd/3vJ+L8ruqkDXtWBXzLOq63044vS4FZBxTMHGaEqfN69C9ewpZ5UbSy7 npNK/jtberg6eK6K0T0cIdC3/X9F3BmREyKGoPBG7F3AaLzl4/IzdLGw317Aom6gBY9U3E WvlC9FoPXIG7NFjpivw8q0eUwg6ikuyEDcCw+W01e5dDJY9dpxSo/M6qvb9BhuEauW0row /UNYfiQmKIzBQrbMBrvwMdtHy1Jp2/izUPqub+eZu/8/xQgvdH31TkaK7Jdf6I0xsYlpIo clRqOVbYY4SwK0LgQvnUpIVpmGP30GSoKthpzIbjwtEr1VK3tecNeUHmkmLxCQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=HrIpXXPe; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713703146; a=rsa-sha256; cv=none; b=WgE9XS1/wFj7gQchHVOl1tuAuFI0MZ5kMaE7Wp4D58F6ahKLaHL/1Vn/Fk0oORhSIr1VlR XEVesMyLgSncPC+79WzZtdCiDFLatwGll5qU5dyhD5QnjRrKwEXKBVcLMYAWq2pg+EnT85 TK5GpfnWpQHKizTWXxzJ9+lbUJWzBh0qvhpXfwATW+e+zCGaaLpUP96WOLQEDswRTf670t O72uAE95NUvivdnaVGegJ4R2JwHg+qSPxCG/sc2xyM/hgFH56+0LWalI0kyEbT1IZ+p/dT EsQRby/K7yy1izkCJ9QHMMwSRRPHT8qZ4b4z6ig9PltjauZEPIm32X9naAdCSw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 08699654D0 for ; Sun, 21 Apr 2024 14:39:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryWT2-0007CK-Hz; Sun, 21 Apr 2024 08:38: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 1ryWT1-0007CA-KG for guix-patches@gnu.org; Sun, 21 Apr 2024 08:38:47 -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 1ryWT1-0007f9-1t for guix-patches@gnu.org; Sun, 21 Apr 2024 08:38:47 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryWTG-0004j8-6K for guix-patches@gnu.org; Sun, 21 Apr 2024 08:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70282] [PATCH v2] gnu: gnome-shell: Wrap screencast service. Resent-From: Dariqq Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 21 Apr 2024 12:39:02 +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: Liliana Marie Prikler , 70282@debbugs.gnu.org Cc: Vivien Kraus , Maxim Cournoyer Received: via spool by 70282-submit@debbugs.gnu.org id=B70282.171370310217903 (code B ref 70282); Sun, 21 Apr 2024 12:39:02 +0000 Received: (at 70282) by debbugs.gnu.org; 21 Apr 2024 12:38:22 +0000 Received: from localhost ([127.0.0.1]:42750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryWSb-0004ed-MH for submit@debbugs.gnu.org; Sun, 21 Apr 2024 08:38:22 -0400 Received: from mout01.posteo.de ([185.67.36.65]:58683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryWSW-0004d4-1w for 70282@debbugs.gnu.org; Sun, 21 Apr 2024 08:38:20 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id CB96C240027 for <70282@debbugs.gnu.org>; Sun, 21 Apr 2024 14:37:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1713703073; bh=JoRynbMAni2qZIlGsj64qbZqKLoVsLBasNuLFLAkqAM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:Content-Type: Content-Transfer-Encoding:From; b=HrIpXXPeWAdwimudMg6gD82a1ZYIFjJgo8NPoMAc5zizeqXxdo9gU1Ml42Dg1vdAM 5lCdV6lbTA99TJXSQdFHkhHTDJeZN7T4y+blqxaOyLXsJeiT0lERHVq/DxnkYKCENm F3g4UWzRHfYQm1SIkdsn9YmDPcenn+N92ugMczzvIffft/89TPokK1rsjlSbar5N// 4fK2eejUgVhlaqnODKUo7TlMaFnZQf7wFlxUwI7+Kk5U+HT94spXQ8AdKNPnzAbwgQ H+Lv/ntcmuLn7DamW1kWgspXBAFRaOgKWP/9xDn0g4EFlV4YIURTCmkZDp8DopIh5Z 22JTcwJCaUThA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VMnwJ5pXvz6tmv; Sun, 21 Apr 2024 14:37:52 +0200 (CEST) Message-ID: <8e84c417-825a-416a-8ca0-ed5aebda489e@posteo.net> Date: Sun, 21 Apr 2024 12:37:46 +0000 MIME-Version: 1.0 References: <0497984af8f383af8e8b981d78dc9baf23869e30.camel@gmail.com> <7a635b027f59d348312098650d1606f2e658ffab.camel@gmail.com> Content-Language: en-US From: Dariqq In-Reply-To: <7a635b027f59d348312098650d1606f2e658ffab.camel@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.98 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -3.98 X-Migadu-Queue-Id: 08699654D0 X-TUID: MbkldM1IKQ0n On 20.04.24 12:46, Liliana Marie Prikler wrote: > Am Samstag, dem 20.04.2024 um 10:11 +0000 schrieb Dariqq: >> >> >> On 19.04.24 20:51, Liliana Marie Prikler wrote: >>> Am Freitag, dem 12.04.2024 um 17:26 +0000 schrieb Dariqq: >>>> 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'm not sure this fix is sounds.  It looks like it misses manual >>> invocation from the command line, does it not?  (Well, it's gnome- >>> shell, so if you have to invoke it from the command line, things >>> are broken, but still…) >> >> If only the typelib path is set the dbus service now longer greets >> you with an error but still fails to start without the gstreamer >> plugins. That's why in v1 I was propagating pipewire through >> gnome-essential-extras. >> >> I am not sure what you mean by manual invocation. The screencast >> service should get started via dbus. Nothing manual should be >> required (other than enabling the pipewire home service). > Just what it says on the tin, manually running the "binary" through the > command line. It's not super useful with GNOME, but I think we should > make sure our services work whichever way they could be invoked. > >>    What keeps you from wrapping the environment >>> variable in Javascript? >> >> I was unable to find a way to manipulate the GST_PLUGIN_PATH or >> specify the gst search path from within javascript. There is >> Gst.Registry().scan_path but this creates a new registry and I don't >> think is what we want here. (but I don't know anything about >> gstreamer and javascript so I could be wrong here). > Instead of creating a new Gst.Registry – as per the () here – you could > use gst_registry_get() or whatever the according JS method is to access > the Registry singleton. > > The Registry constructor ought to be protected, but idk how GJS handles > that. > I've tried adding Gst.Registry.get().scan_path() after the GI_TYPELIB expansion but I am not sure why it does not work. Stracing the invocation shows that the pipewire gstreamer plugin is accessed at the beginning but it is still not available somehow. Probably because of my lack of knowledge about gstreamer. >> I guess the most simple patch for the typelibs would be something >> like >> >> >> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm >> index fa6c566c75..28c4e540a6 100644 >> --- a/gnu/packages/gnome.scm >> +++ b/gnu/packages/gnome.scm >> @@ -9404,13 +9404,15 @@ (define-public gnome-shell >>                        (wrap-program (string-append #$output "/bin/" >> prog) >>                          `("GI_TYPELIB_PATH" ":" prefix >> (,gi-typelib-path)))) >>                      '("gnome-shell" "gnome-extensions-app")) >> -                  (substitute* (string-append #$output >> "/share/gnome-shell/" >> - >> "org.gnome.Shell.Extensions") >> -                    (("imports\\.package\\.start" all) >> -                     (string-append "'" gi-typelib-path >> "'.split(':').forEach(" >> -                                    "path => >> imports.gi.GIRepository.Repository." >> -                                    "prepend_search_path(path));\n" >> -                                    all))) >> +                  (for-each >> +                   (lambda (prog) >> +                     (substitute* (string-append #$output >> "/share/gnome-shell/" prog) >> +                       (("imports\\.package\\.start" all) >> +                        (string-append "'" gi-typelib-path >> "'.split(':').forEach(" >> +                                       "path => >> imports.gi.GIRepository.Repository." >> + >> "prepend_search_path(path));\n" >> +                                       all)))) >> +                   '("org.gnome.Shell.Extensions" >> "org.gnome.Shell.Screencast")) >>                     (for-each >>                      (lambda (prog) >>                        (wrap-program (string-append #$output "/bin/" >> prog) >> >> >> and dealing with the gstreamer plugins in another way. > Hmm, could you add --gst-plugin-path on the command line? > >>>> 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? >>> Gnome-shell 45+ is currently irrelevant, but we might have to adapt >>> things once we get there on gnome-team.  We do need a better gjs- >>> patching strategy. >>> >> >> It would be nice if something like wrap-script would work. But the >> problem is that the dbus services specify somehting like "Exec= gjs >> service" rather than executing a gjs-script directly. (which is the >> main purpose of the patch from nixos). And also gjs not being a valid >> interpreter for wrap-script (Changing that will rebuild everything) > You can redo the needed logic locally and add a "XXX: Use wrap-script > once it can handle gjs" for example. That's no hard blocker, but it's > not the nicest option either, I admit. Let's try our other options > first. > I've just found GLib.setenv() to set environment variables for the process directly from within gjs. The GLib typelib comes from the gobject-introspection package so this should be available. From my limited testing it seems to work (at least for the screencast service). What do you think? > Cheers Have a nice day.