Subject: [PATCH 1/4] gnu: gnome-shell-extension-gsconnect: Fix search path patching.

From: aurtzy <[email-masked]>
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 <[email-masked]>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <[email-masked]>
 ;;; Copyright © 2023 Eidvilas Markevičius <[email-masked]>
+;;; Copyright © 2025 aurtzy <[email-masked]>
 ;;;
 ;;; 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