GNU bug report logs - #76572
[PATCH 0/4] Fixes for gnome-shell-extension-gsconnect

Previous Next

Package: guix-patches;

Reported by: aurtzy <aurtzy <at> gmail.com>

Date: Tue, 25 Feb 2025 23:27:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76572 in the body.
You can then email your comments to 76572 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Tue, 25 Feb 2025 23:27:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to aurtzy <aurtzy <at> gmail.com>:
New bug report received and forwarded. Copy sent to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org. (Tue, 25 Feb 2025 23:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH 0/4] Fixes for gnome-shell-extension-gsconnect
Date: Tue, 25 Feb 2025 18:21:48 -0500
Hello!

This patch series addresses issues with GSConnect generally not working.

I've been mainly testing this on the gnome-team branch (no relation to
the issues, which have been present in master), but I can confirm that
these patches don't break the main branch (guix pull still works), and
gnome-shell-extension-gsconnect still builds there.

Cheers,

aurtzy

aurtzy (4):
  gnu: gnome-shell-extension-gsconnect: Fix search path patching.
  gnu: gnome-shell-extension-gsconnect: Wrap gsconnect-preferences.
  gnu: gnome-shell-extension-gsconnect: Patch shebangs with gjs.
  gnu: gnome-shell-extension-gsconnect: Fix paths in additional desktop
    file.

 gnu/packages/gnome-xyz.scm | 45 ++++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 11 deletions(-)


base-commit: 8bc831325a905dbd9015739b58e3a5138d2217da
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Tue, 25 Feb 2025 23:36:01 GMT) Full text and rfc822 format available.

Message #8 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH 1/4] gnu: gnome-shell-extension-gsconnect: Fix search path
 patching.
Date: Tue, 25 Feb 2025 18:34:21 -0500
* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Fix 'fix-paths phase substitutions no longer applying.

Change-Id: I99aa0204c1dfad836aed62261d2ffc0c75366510
---
 gnu/packages/gnome-xyz.scm | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index f975926e94..8c1c000feb 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2022 Sughosha <sughosha <at> proton.me>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
 ;;; Copyright © 2023 Eidvilas Markevičius <markeviciuseidvilas <at> gmail.com>
+;;; Copyright © 2025 aurtzy <aurtzy <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -772,12 +773,15 @@ (define-public gnome-shell-extension-gsconnect
                   (("gapplication") gapplication))
                 (for-each
                  (lambda (file)
-                   (substitute* file
-                     (("'use strict';")
-                      (string-append "'use strict';\n\n"
-                                     "'" gi-typelib-path "'.split(':').forEach("
-                                     "path => imports.gi.GIRepository.Repository."
-                                     "prepend_search_path(path));"))))
+                   (with-atomic-file-replacement
+                    file
+                    (lambda (input output)
+                      (format output "~a"
+                              (string-append
+                               "'" gi-typelib-path "'.split(':').forEach("
+                               "path => imports.gi.GIRepository.Repository."
+                               "prepend_search_path(path));\n"))
+                      (dump-port input output))))
                  '("src/extension.js" "src/prefs.js")))))
           (add-after 'install 'wrap-daemons
             (lambda _
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Tue, 25 Feb 2025 23:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH 2/4] gnu: gnome-shell-extension-gsconnect: Wrap
 gsconnect-preferences.
Date: Tue, 25 Feb 2025 18:34:22 -0500
This fixes an error when attempting to open the gsconnect-preferences
application due to Typelib files not being found.

* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Wrap gsconnect-preferences with GI_TYPELIB_PATH
environment variable.  Rename 'wrap-daemons phase to 'wrap-programs.

Change-Id: Ib330766d46dba00a7c68fa3956b28223f07000f8
---
 gnu/packages/gnome-xyz.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 8c1c000feb..0a785193c4 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -783,13 +783,16 @@ (define-public gnome-shell-extension-gsconnect
                                "prepend_search_path(path));\n"))
                       (dump-port input output))))
                  '("src/extension.js" "src/prefs.js")))))
-          (add-after 'install 'wrap-daemons
+          (add-after 'install 'wrap-programs
             (lambda _
               (let* ((out #$output)
-                     (service-dir
-                      (string-append out "/share/gnome-shell/extensions"
-                                     "/gsconnect <at> andyholmes.github.io/service"))
+                     (gsconnect-dir (string-append
+                                     out "/share/gnome-shell/extensions"
+                                     "/gsconnect <at> andyholmes.github.io"))
+                     (service-dir (string-append gsconnect-dir "/service"))
                      (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
+                (wrap-program (string-append gsconnect-dir "/gsconnect-preferences")
+                  `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))
                 (wrap-program (string-append service-dir "/daemon.js")
                   `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
     (inputs
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Tue, 25 Feb 2025 23:36:02 GMT) Full text and rfc822 format available.

Message #14 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH 3/4] gnu: gnome-shell-extension-gsconnect: Patch shebangs with
 gjs.
Date: Tue, 25 Feb 2025 18:34:23 -0500
The 'patch-shebangs phase does not handle shebangs of the form
"/usr/bin/env -S", so we manually patch them to fix a not-found error.

* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Add 'patch-gjs-shebangs phase to patch shebangs using
"/usr/bin/env -S" to execute gjs.

Change-Id: I6b84474e4976484f1203b7cf78fe5e882694cd22
---
 gnu/packages/gnome-xyz.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 0a785193c4..abcbe2c9f9 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -765,6 +765,18 @@ (define-public gnome-shell-extension-gsconnect
                  "gtk_update_icon_cache: false")
                 (("update_desktop_database: true")
                  "update_desktop_database: false"))))
+          (add-after 'unpack 'patch-gjs-shebangs
+            (lambda* (#:key inputs #:allow-other-keys)
+              (for-each
+               (lambda (file)
+                 (substitute* file
+                   (("^#!.*$")
+                    (string-append "#!" (which "gjs") " -m"))))
+               '("installed-tests/minijasmine"
+                 "src/gsconnect-preferences"
+                 "src/service/nativeMessagingHost.js"
+                 "src/service/daemon.js"
+                 "webextension/gettext.js"))))
           (add-before 'configure 'fix-paths
             (lambda* (#:key inputs #:allow-other-keys)
               (let ((gapplication (search-input-file inputs "/bin/gapplication"))
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Tue, 25 Feb 2025 23:36:03 GMT) Full text and rfc822 format available.

Message #17 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH 4/4] gnu: gnome-shell-extension-gsconnect: Fix paths in
 additional desktop file.
Date: Tue, 25 Feb 2025 18:34:24 -0500
This fixes the gsconnect preferences button ("Mobile Settings") in the
top-right quick-access menu not opening the preferences application.  The
window icon also displays properly with this commit.

* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Patch gapplication path in an additional desktop file
in 'fix-paths phase.

Change-Id: I6b84474e4976484f1203b7cf78fe5e882694cd22
---
 gnu/packages/gnome-xyz.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index abcbe2c9f9..d011ae51d0 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -781,8 +781,12 @@ (define-public gnome-shell-extension-gsconnect
             (lambda* (#:key inputs #:allow-other-keys)
               (let ((gapplication (search-input-file inputs "/bin/gapplication"))
                     (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
-                (substitute* "data/org.gnome.Shell.Extensions.GSConnect.desktop.in"
-                  (("gapplication") gapplication))
+                (for-each
+                 (lambda (file)
+                   (substitute* file
+                     (("gapplication") gapplication)))
+                 '("data/org.gnome.Shell.Extensions.GSConnect.desktop.in"
+                   "data/org.gnome.Shell.Extensions.GSConnect.Preferences.desktop.in"))
                 (for-each
                  (lambda (file)
                    (with-atomic-file-replacement
-- 
2.48.1





Information forwarded to guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Fri, 28 Feb 2025 00:54:03 GMT) Full text and rfc822 format available.

Message #20 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: aurtzy <aurtzy <at> gmail.com>
Cc: Vivien Kraus <vivien <at> planete-kraus.eu>, 76572 <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#76572] [PATCH 3/4] gnu: gnome-shell-extension-gsconnect:
 Patch shebangs with gjs.
Date: Fri, 28 Feb 2025 09:53:30 +0900
Hi!

aurtzy <aurtzy <at> gmail.com> writes:

> The 'patch-shebangs phase does not handle shebangs of the form
> "/usr/bin/env -S", so we manually patch them to fix a not-found error.

Oh!  Could you please open an issue about this open so we remember to
fix the problem at its root?

> * gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
> [arguments]<#:phases>: Add 'patch-gjs-shebangs phase to patch shebangs using
> "/usr/bin/env -S" to execute gjs.
>
> Change-Id: I6b84474e4976484f1203b7cf78fe5e882694cd22
> ---
>  gnu/packages/gnome-xyz.scm | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
> index 0a785193c4..abcbe2c9f9 100644
> --- a/gnu/packages/gnome-xyz.scm
> +++ b/gnu/packages/gnome-xyz.scm
> @@ -765,6 +765,18 @@ (define-public gnome-shell-extension-gsconnect
>                   "gtk_update_icon_cache: false")
>                  (("update_desktop_database: true")
>                   "update_desktop_database: false"))))
> +          (add-after 'unpack 'patch-gjs-shebangs

I'd also mention and cross-reference the newly opened issue about
/usr/bin/env -S not being patched here, with e.g.

TODO: Remove after patch-shebangs is fixed to handle '/usr/bin/env -S'
shebangs (see bug#NNNNN).

> +            (lambda* (#:key inputs #:allow-other-keys)
> +              (for-each
> +               (lambda (file)
> +                 (substitute* file
> +                   (("^#!.*$")

That pattern seems a bit too wide?  Can'twe match at least gjs in it, to
avoid breaking non-gjs shebangs which may be introduced in the future
and forgotten?

> +                    (string-append "#!" (which "gjs") " -m"))))
> +               '("installed-tests/minijasmine"
> +                 "src/gsconnect-preferences"
> +                 "src/service/nativeMessagingHost.js"
> +                 "src/service/daemon.js"
> +                 "webextension/gettext.js"))))

Otherwise, LGTM.  Could you please submit a v2 with my above
suggestions?

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Fri, 28 Feb 2025 00:58:04 GMT) Full text and rfc822 format available.

Message #23 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: aurtzy <aurtzy <at> gmail.com>
Cc: Vivien Kraus <vivien <at> planete-kraus.eu>, 76572 <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#76572] [PATCH 4/4] gnu: gnome-shell-extension-gsconnect:
 Fix paths in additional desktop file.
Date: Fri, 28 Feb 2025 09:56:29 +0900
Hi,

aurtzy <aurtzy <at> gmail.com> writes:

> This fixes the gsconnect preferences button ("Mobile Settings") in the
> top-right quick-access menu not opening the preferences application.  The
> window icon also displays properly with this commit.

Thank you!

> * gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
> [arguments]<#:phases>: Patch gapplication path in an additional desktop file
> in 'fix-paths phase.
>
> Change-Id: I6b84474e4976484f1203b7cf78fe5e882694cd22
> ---
>  gnu/packages/gnome-xyz.scm | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
> index abcbe2c9f9..d011ae51d0 100644
> --- a/gnu/packages/gnome-xyz.scm
> +++ b/gnu/packages/gnome-xyz.scm
> @@ -781,8 +781,12 @@ (define-public gnome-shell-extension-gsconnect
>              (lambda* (#:key inputs #:allow-other-keys)
>                (let ((gapplication (search-input-file inputs "/bin/gapplication"))
>                      (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
> -                (substitute* "data/org.gnome.Shell.Extensions.GSConnect.desktop.in"
> -                  (("gapplication") gapplication))
> +                (for-each
> +                 (lambda (file)
> +                   (substitute* file
> +                     (("gapplication") gapplication)))
> +                 '("data/org.gnome.Shell.Extensions.GSConnect.desktop.in"
> +                   "data/org.gnome.Shell.Extensions.GSConnect.Preferences.desktop.in"))

Nitpick: it's a bit more conventional to indent map/filter/for-each,
etc. like:

(for-each procedure
 things)

instead of

(for-each
 procedure
 things)

Unless perhaps when the hanging indent is already deep and there's not
enough columns to accomodate the former.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail>

-- 
Thanks,
Maxim




Information forwarded to aurtzy <at> gmail.com, maxim.cournoyer <at> gmail.com, liliana.prikler <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Thu, 06 Mar 2025 08:49:02 GMT) Full text and rfc822 format available.

Message #26 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH v2 0/4] Fixes for gnome-shell-extension-gsconnect
Date: Thu,  6 Mar 2025 03:44:49 -0500
Hey Maxim,

> > The 'patch-shebangs phase does not handle shebangs of the form
> > "/usr/bin/env -S", so we manually patch them to fix a not-found error.
>
> Oh!  Could you please open an issue about this open so we remember to
> fix the problem at its root?

[...]

> I'd also mention and cross-reference the newly opened issue about
> /usr/bin/env -S not being patched here, with e.g.
> 
> TODO: Remove after patch-shebangs is fixed to handle '/usr/bin/env -S'
> shebangs (see bug#NNNNN).

Looks like someone already beat me to it [1]!  Adjusted to reference
that report.

> That pattern seems a bit too wide?  Can'twe match at least gjs in it, to
> avoid breaking non-gjs shebangs which may be introduced in the future
> and forgotten?

Adjusted.

> Nitpick: it's a bit more conventional to indent map/filter/for-each,
> etc. like:
> 
> (for-each procedure
>  things)
> 
> instead of
> 
> (for-each
>  procedure
>  things)
> 
> Unless perhaps when the hanging indent is already deep and there's not
> enough columns to accomodate the former.

Thanks for the tip; noted!  I've adjusted the forms where they don't
cross column 85 (following editorconfig).

[1] <https://issues.guix.gnu.org/74450>

Cheers,

aurtzy

aurtzy (4):
  gnu: gnome-shell-extension-gsconnect: Fix search path patching.
  gnu: gnome-shell-extension-gsconnect: Wrap gsconnect-preferences.
  gnu: gnome-shell-extension-gsconnect: Patch shebangs with gjs.
  gnu: gnome-shell-extension-gsconnect: Fix paths in additional desktop
    file.

 gnu/packages/gnome-xyz.scm | 47 ++++++++++++++++++++++++++++----------
 1 file changed, 35 insertions(+), 12 deletions(-)


base-commit: 310adf4ce70cbb864859274fcc7842bd519bbddc
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, maxim.cournoyer <at> gmail.com, liliana.prikler <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Thu, 06 Mar 2025 08:49:02 GMT) Full text and rfc822 format available.

Message #29 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH v2 1/4] gnu: gnome-shell-extension-gsconnect: Fix search path
 patching.
Date: Thu,  6 Mar 2025 03:44:50 -0500
* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Fix 'fix-paths phase substitutions no longer applying.

Change-Id: I99aa0204c1dfad836aed62261d2ffc0c75366510
---
 gnu/packages/gnome-xyz.scm | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 92d8b7cb03..1a3a275db5 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2022 Sughosha <sughosha <at> proton.me>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
 ;;; Copyright © 2023 Eidvilas Markevičius <markeviciuseidvilas <at> gmail.com>
+;;; Copyright © 2025 aurtzy <aurtzy <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -766,15 +767,17 @@ (define-public gnome-shell-extension-gsconnect
                     (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
                 (substitute* "data/org.gnome.Shell.Extensions.GSConnect.desktop.in"
                   (("gapplication") gapplication))
-                (for-each
-                 (lambda (file)
-                   (substitute* file
-                     (("'use strict';")
-                      (string-append "'use strict';\n\n"
-                                     "'" gi-typelib-path "'.split(':').forEach("
-                                     "path => imports.gi.GIRepository.Repository."
-                                     "prepend_search_path(path));"))))
-                 '("src/extension.js" "src/prefs.js")))))
+                (for-each (lambda (file)
+                            (with-atomic-file-replacement
+                             file
+                             (lambda (input output)
+                               (format output "~a"
+                                       (string-append
+                                        "'" gi-typelib-path "'.split(':').forEach("
+                                        "path => imports.gi.GIRepository.Repository."
+                                        "prepend_search_path(path));\n"))
+                               (dump-port input output))))
+                          '("src/extension.js" "src/prefs.js")))))
           (add-after 'install 'wrap-daemons
             (lambda _
               (let* ((out #$output)
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, maxim.cournoyer <at> gmail.com, liliana.prikler <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Thu, 06 Mar 2025 08:49:03 GMT) Full text and rfc822 format available.

Message #32 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH v2 2/4] gnu: gnome-shell-extension-gsconnect: Wrap
 gsconnect-preferences.
Date: Thu,  6 Mar 2025 03:44:51 -0500
This fixes an error when attempting to open the gsconnect-preferences
application due to Typelib files not being found.

* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Wrap gsconnect-preferences with GI_TYPELIB_PATH
environment variable.  Rename 'wrap-daemons phase to 'wrap-programs.

Change-Id: Ib330766d46dba00a7c68fa3956b28223f07000f8
---
 gnu/packages/gnome-xyz.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 1a3a275db5..359dc757fd 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -778,13 +778,16 @@ (define-public gnome-shell-extension-gsconnect
                                         "prepend_search_path(path));\n"))
                                (dump-port input output))))
                           '("src/extension.js" "src/prefs.js")))))
-          (add-after 'install 'wrap-daemons
+          (add-after 'install 'wrap-programs
             (lambda _
               (let* ((out #$output)
-                     (service-dir
-                      (string-append out "/share/gnome-shell/extensions"
-                                     "/gsconnect <at> andyholmes.github.io/service"))
+                     (gsconnect-dir (string-append
+                                     out "/share/gnome-shell/extensions"
+                                     "/gsconnect <at> andyholmes.github.io"))
+                     (service-dir (string-append gsconnect-dir "/service"))
                      (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
+                (wrap-program (string-append gsconnect-dir "/gsconnect-preferences")
+                  `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))
                 (wrap-program (string-append service-dir "/daemon.js")
                   `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
     (inputs
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, maxim.cournoyer <at> gmail.com, liliana.prikler <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Thu, 06 Mar 2025 08:49:03 GMT) Full text and rfc822 format available.

Message #35 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH v2 3/4] gnu: gnome-shell-extension-gsconnect: Patch shebangs
 with gjs.
Date: Thu,  6 Mar 2025 03:44:52 -0500
The 'patch-shebangs phase does not handle shebangs of the form
"/usr/bin/env -S", so we manually patch them to fix a not-found error.

* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Add 'patch-gjs-shebangs phase to patch shebangs using
"/usr/bin/env -S" to execute gjs.

Change-Id: I6b84474e4976484f1203b7cf78fe5e882694cd22
---
 gnu/packages/gnome-xyz.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 359dc757fd..09e73a9c0a 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -761,6 +761,19 @@ (define-public gnome-shell-extension-gsconnect
                  "gtk_update_icon_cache: false")
                 (("update_desktop_database: true")
                  "update_desktop_database: false"))))
+          ;; TODO: Remove after 'patch-shebangs is fixed to handle '/usr/bin/env -S'
+          ;; shebangs (see bug#74450).
+          (add-after 'unpack 'patch-gjs-shebangs
+            (lambda* (#:key inputs #:allow-other-keys)
+              (for-each (lambda (file)
+                          (substitute* file
+                            (("^#!/usr/bin/env -S gjs.*$")
+                             (string-append "#!" (which "gjs") " -m"))))
+                        '("installed-tests/minijasmine"
+                          "src/gsconnect-preferences"
+                          "src/service/nativeMessagingHost.js"
+                          "src/service/daemon.js"
+                          "webextension/gettext.js"))))
           (add-before 'configure 'fix-paths
             (lambda* (#:key inputs #:allow-other-keys)
               (let ((gapplication (search-input-file inputs "/bin/gapplication"))
-- 
2.48.1





Information forwarded to aurtzy <at> gmail.com, maxim.cournoyer <at> gmail.com, liliana.prikler <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76572; Package guix-patches. (Thu, 06 Mar 2025 08:49:04 GMT) Full text and rfc822 format available.

Message #38 received at 76572 <at> debbugs.gnu.org (full text, mbox):

From: aurtzy <aurtzy <at> gmail.com>
To: 76572 <at> debbugs.gnu.org
Cc: aurtzy <aurtzy <at> gmail.com>
Subject: [PATCH v2 4/4] gnu: gnome-shell-extension-gsconnect: Fix paths in
 additional desktop file.
Date: Thu,  6 Mar 2025 03:44:53 -0500
This fixes the gsconnect preferences button ("Mobile Settings") in the
top-right quick-access menu not opening the preferences application.  The
window icon also displays properly with this commit.

* gnu/packages/gnome-xyz.scm (gnome-shell-extension-gsconnect):
[arguments]<#:phases>: Patch gapplication path in an additional desktop file
in 'fix-paths phase.

Change-Id: I6b84474e4976484f1203b7cf78fe5e882694cd22
---
 gnu/packages/gnome-xyz.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 09e73a9c0a..d3bf068dbc 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -778,8 +778,12 @@ (define-public gnome-shell-extension-gsconnect
             (lambda* (#:key inputs #:allow-other-keys)
               (let ((gapplication (search-input-file inputs "/bin/gapplication"))
                     (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
-                (substitute* "data/org.gnome.Shell.Extensions.GSConnect.desktop.in"
-                  (("gapplication") gapplication))
+                (for-each
+                 (lambda (file)
+                   (substitute* file
+                     (("gapplication") gapplication)))
+                 '("data/org.gnome.Shell.Extensions.GSConnect.desktop.in"
+                   "data/org.gnome.Shell.Extensions.GSConnect.Preferences.desktop.in"))
                 (for-each (lambda (file)
                             (with-atomic-file-replacement
                              file
-- 
2.48.1





Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Sun, 09 Mar 2025 07:17:01 GMT) Full text and rfc822 format available.

Notification sent to aurtzy <aurtzy <at> gmail.com>:
bug acknowledged by developer. (Sun, 09 Mar 2025 07:17:02 GMT) Full text and rfc822 format available.

Message #43 received at 76572-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: aurtzy <aurtzy <at> gmail.com>
Cc: Vivien Kraus <vivien <at> planete-kraus.eu>, 76572-done <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#76572] [PATCH v2 0/4] Fixes for
 gnome-shell-extension-gsconnect
Date: Sun, 09 Mar 2025 16:16:36 +0900
Hi!

aurtzy <aurtzy <at> gmail.com> writes:

> Hey Maxim,
>
>> > The 'patch-shebangs phase does not handle shebangs of the form
>> > "/usr/bin/env -S", so we manually patch them to fix a not-found error.
>>
>> Oh!  Could you please open an issue about this open so we remember to
>> fix the problem at its root?
>
> [...]
>
>> I'd also mention and cross-reference the newly opened issue about
>> /usr/bin/env -S not being patched here, with e.g.
>> 
>> TODO: Remove after patch-shebangs is fixed to handle '/usr/bin/env -S'
>> shebangs (see bug#NNNNN).
>
> Looks like someone already beat me to it [1]!  Adjusted to reference
> that report.

Excellent, thank you.

[...]

> Thanks for the tip; noted!  I've adjusted the forms where they don't
> cross column 85 (following editorconfig).

Note that our guideline is actually 80 columns maximum.

I've now installed your change to master, thank you!

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 06 Apr 2025 11:24:24 GMT) Full text and rfc822 format available.

This bug report was last modified 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.