all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dariqq <dariqq@posteo.net>
To: 70282@debbugs.gnu.org
Cc: Dariqq <dariqq@posteo.net>,
	Liliana Marie Prikler <liliana.prikler@gmail.com>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	Vivien Kraus <vivien@planete-kraus.eu>
Subject: [bug#70282] [PATCH v2] gnu: gnome-shell: Wrap screencast service.
Date: Fri, 12 Apr 2024 17:26:48 +0000	[thread overview]
Message-ID: <d5f358b4d17606032eba8a49ff7980720e7d4b4d.1712942808.git.dariqq@posteo.net> (raw)
In-Reply-To: <cover.1712590252.git.dariqq@posteo.net>

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(-)

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

base-commit: 3dc26b4eaed448cbc02a80bafb2ebb6d908f2b4e
-- 
2.41.0





  parent reply	other threads:[~2024-04-12 17:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 15:39 [bug#70282] [PATCH 0/2] Fix gnome-shell screenrecorder Dariqq
2024-04-08 15:53 ` [bug#70282] [PATCH 1/2] gnu: gnome-shell: Wrap d-bus services Dariqq
2024-04-08 16:54   ` Liliana Marie Prikler
2024-04-09 15:35     ` Dariqq
2024-04-09 17:04       ` Liliana Marie Prikler
2024-04-10  8:07         ` Dariqq
2024-04-10 18:20           ` Liliana Marie Prikler
2024-04-11  9:04             ` Dariqq
2024-04-08 15:53 ` [bug#70282] [PATCH 2/2] gnu: gnome-essential-extras: Propagate pipewire Dariqq
2024-04-08 16:49   ` Liliana Marie Prikler
2024-04-09 14:05     ` Dariqq
2024-04-12 17:26 ` Dariqq [this message]
2024-04-19 18:51   ` [bug#70282] [PATCH v2] gnu: gnome-shell: Wrap screencast service Liliana Marie Prikler
2024-04-20 10:11     ` Dariqq
2024-04-20 10:46       ` Liliana Marie Prikler
2024-04-21 12:37         ` Dariqq
2024-04-21 12:43           ` Liliana Marie Prikler
2024-05-08 12:57             ` [bug#70282] [PATCH v3] " Dariqq
2024-04-21 17:02 ` Dariqq
2024-05-08 17:24   ` Liliana Marie Prikler
2024-05-08 18:33 ` [bug#70282] [PATCH v4] " Dariqq
2024-05-08 19:51   ` Maxim Cournoyer
2024-05-08 21:18     ` Dariqq
2024-05-08 22:11       ` Liliana Marie Prikler
2024-05-09  8:27         ` Dariqq
2024-05-10 14:59         ` Dariqq
2024-05-10 16:04           ` Liliana Marie Prikler
2024-05-11  8:03             ` Dariqq
2024-05-09 15:30       ` Maxim Cournoyer
2024-05-14  5:34         ` bug#70282: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5f358b4d17606032eba8a49ff7980720e7d4b4d.1712942808.git.dariqq@posteo.net \
    --to=dariqq@posteo.net \
    --cc=70282@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=maxim.cournoyer@gmail.com \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.