Subject: bug#70282: closed (Re: [bug#70282] [PATCH v4] gnu: gnome-shell: Wrap screencast service.)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 14 May 2024 05:37:02 +0000

Your bug report

#70282: [PATCH 0/2] Fix gnome-shell screenrecorder

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70282: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70282
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#70282] [PATCH v4] gnu: gnome-shell: Wrap screencast service.
From: Liliana Marie Prikler <[email-masked]>
To: Maxim Cournoyer <[email-masked]>, Dariqq <[email-masked]>
Cc: [email-masked], Vivien Kraus <[email-masked]>
Date: Tue, 14 May 2024 07:34:58 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Am Donnerstag, dem 09.05.2024 um 11:30 -0400 schrieb Maxim Cournoyer:
> Hi Dariqq,
> 
> Dariqq <[email-masked]> writes:
> 
> [...]
> 
> > > > diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> > > > index 92e35e3c5a..4bbff2a89b 100644
> > > > --- a/gnu/packages/gnome.scm
> > > > +++ b/gnu/packages/gnome.scm
> > > > @@ -9408,6 +9408,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)
> > > > @@ -9427,6 +9428,19 @@ (define-public gnome-shell
> > > >                                       "path =>
> > > > imports.gi.GIRepository.Repository."
> > > >                                      
> > > > "prepend_search_path(path));\n"
> > > >                                       all)))
> > > > +                  ;; Screencast requires a pipewire service
> > > > running
> > > > +                  ;; (i.e. as provided by home-pipewire-
> > > > service-type)
> > > > +                  (substitute* (string-append #$output
> > > > "/share/gnome-shell/"
> > > > +                                             
> > > > "org.gnome.Shell.Screencast")
> > > > +                    (("imports\\.package\\.start" all)
> > > > +                     (string-append "'" gi-typelib-path
> > > > "'.split(':').forEach("
> > > > +                                    "path =>
> > > > imports.gi.GIRepository.Repository."
> > > > +                                   
> > > > "prepend_search_path(path));\n"
> > > > +                                   
> > > > "imports.gi.GLib.setenv('GST_PLUGIN_SYSTEM_PATH',"
> > > > +                                   
> > > > "[imports.gi.GLib.getenv('GST_PLUGIN_SYSTEM_PATH'),"
> > > > +                                    "'" gst-plugin-path
> > > > "'].filter(v => v).join(':'),"
> > > > +                                    "true);\n"
> > > > +                                    all)))
> > > Perhaps a simple patch would convey the change better and be
> > > easier to maintain in the future / be readily available for other
> > > distributions to use.
> > 
> > 
> > The simple patch that would do this is basically the patch from
> > nixos in v1 of this which adds a shebang line for gjs to the
> > service invocation files (rather than the dbus service invoking
> > $gjs $service). The problem then is that wrap-program changes the
> > filename to * .real which makes gjs unhappy.
> > 
> > The people from nix circumvent this by using some js at the
> > beginning to reset the entrypoint to the correct value.
> > 
> > One nice way around avoiding the problem would be using wrap-script
> > instead though that does not support gjs as interpreter (yet?) and
> > adding that forces a rebuild of all packages due to (guix build
> > utils) changing.
> 
> It'd be nice to prep such support on core-updates.  You can test it
> on master by having a (guix build utils-next) module that you
> explicitly use.
> 
> > Maybe another comment, similiar to the one Liliana suggested
> > earlier in this thread, could be added at the beginning to inform
> > about changing to wrap script + patch instead once that is a viable
> > option?
> 
> That could be a good reminder to have, yes.
I've pushed the current version as-is, without reminder, so that we can
at least mark the issue done.  If someone has a good text to add,
please don't hesitate to do so in post.  Also don't hesitate to submit
new stuff to gnome-team or core-updates after the pending merges are
through.

Cheers and thanks for all the hard work :)

Subject: [PATCH 0/2] Fix gnome-shell screenrecorder
From: Dariqq <[email-masked]>
To: [email-masked]
Cc: [email-masked], Dariqq <[email-masked]>
Date: Mon, 8 Apr 2024 15:39:06 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Guix,

Last week a user in the irc chat remarked that the built in Gnome screenrecorder is not available which rekado and me then investigated afterwards.

This functionality is provided by the org.gnome.Shell.Screencast dbus service which currently fails to start (if for example you try to investigate it with d-spy you get the not really helpful error: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Shell.Screencast exited with status 1)

We later figured that this error happens because the required typelib files cannot be found.

As a fix I imported a patch from NixOS [1] from their gnome-shell 42/44 package and wrapped the relevant files with GI_TYPELIB_PATH. This seems to be strictly necessary only for the screencast service however I wrapped all of the dbus services listed in the js/dbusServices/meson.build file, same as what is done in NixOS.

In order for Screencast to work you'll also need pipewire available (I think for the gstreamer plug-in) which is why I added it to gnome-essential-extras in the second patch.

You'll also need pipewire running (i.e the home-service) which makes this a bit unintuitive for users.
I don't think it is currently possible to enable user level shepherd services from the system configuration, but correct me if I am wrong. Without pipewire running the screen recording stops immediately.

As usual i am not sure if the formating/wording of my commit messages and the name I gave the patch are fine.

Also thanks to rekado for helping to make sense of this.

[1] https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/desktops/gnome/core/gnome-shell/wrap-services.patch 

Dariqq (2):
  gnu: gnome-shell: Wrap d-bus services.
  gnu: gnome-essential-extras: Propagate pipewire.

 gnu/local.mk                                  |  1 +
 gnu/packages/gnome.scm                        | 14 ++++-
 .../gnome-shell-wrappable-dbus-services.patch | 59 +++++++++++++++++++
 3 files changed, 72 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/gnome-shell-wrappable-dbus-services.patch

base-commit: cd45294d576975a3bff2f755764a3f46f09ea6f9
-- 
2.41.0