unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#53036] [PATCH] gnu: syncthing-gtk: Fix autostart.
@ 2022-01-05 19:20 John Kehayias via Guix-patches via
  2022-01-05 21:13 ` Leo Famulari
  0 siblings, 1 reply; 2+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-05 19:20 UTC (permalink / raw)
  To: 53036

[-- Attachment #1: Type: text/plain, Size: 784 bytes --]

Hello,

This is a simple fix/workaround for https://issues.guix.gnu.org/50789

As discussed there, there is not a perfect solution for syncthing-gtk writing ~/.config/autostart/Syncthing-GTK.desktop with the Exec line pointing to the store path of ".syncthing-gtk-real". I've opted for a simple fix that won't break upon changes to the syncthing-gtk store path that was done similarly to e.g. the desktop files Flatpak writes in 9c4244cc73db4d5c3adf6f8342f6b08b39dd3628: just use plain "syncthing-gtk". While this means different syncthing-gtk could conflict (whatever is first in PATH wins), that seems unlikely given this package is just a frontend to syncthing. Anyway, seems like the best option right now so that the autostart file is usable and won't break.

Thanks,
John

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-syncthing-gtk-Fix-autostart.patch --]
[-- Type: text/x-patch; name=0001-gnu-syncthing-gtk-Fix-autostart.patch, Size: 1811 bytes --]

From 1d62676b2b507f67103110c3fce5d8c6dc483f8b Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 5 Jan 2022 14:09:42 -0500
Subject: [PATCH] gnu: syncthing-gtk: Fix autostart.

* gnu/packages/syncthing.scm (syncthing-gtk)[#:phases]: Add autostart-path
phase to use "syncthing-gtk" (rather than a store path to
".syncthing-gtk-real") as the exec command for the autostart desktop file
written by syncthing-gtk.
---
 gnu/packages/syncthing.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm
index 7125e70117..f356b24844 100644
--- a/gnu/packages/syncthing.scm
+++ b/gnu/packages/syncthing.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -171,6 +172,13 @@ (define-public syncthing-gtk
                  (substitute* "syncthing_gtk/configuration.py"
                    (("/usr/bin/syncthing") (string-append syncthing
                                                           "/bin/syncthing"))))))
+           (add-after 'unpack 'autostart-path
+             ;; Change the autostart desktop file Exec command to just be
+             ;; syncthing-gtk, rather than the store path to
+             ;; .syncthing-gtk-real
+             (lambda _
+               (substitute* "syncthing_gtk/tools.py"
+                 (("return executable") "return \"syncthing-gtk\""))))
            (add-after 'unpack 'remove-windows.py
              (lambda _
                ;; A Windows-specific module that fails to load with
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [bug#53036] [PATCH] gnu: syncthing-gtk: Fix autostart.
  2022-01-05 19:20 [bug#53036] [PATCH] gnu: syncthing-gtk: Fix autostart John Kehayias via Guix-patches via
@ 2022-01-05 21:13 ` Leo Famulari
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Famulari @ 2022-01-05 21:13 UTC (permalink / raw)
  To: 53036; +Cc: 53036-done

On Wed, Jan 05, 2022 at 07:20:14PM +0000, John Kehayias via Guix-patches via wrote:
> From 1d62676b2b507f67103110c3fce5d8c6dc483f8b Mon Sep 17 00:00:00 2001
> From: John Kehayias <john.kehayias@protonmail.com>
> Date: Wed, 5 Jan 2022 14:09:42 -0500
> Subject: [PATCH] gnu: syncthing-gtk: Fix autostart.
> 
> * gnu/packages/syncthing.scm (syncthing-gtk)[#:phases]: Add autostart-path
> phase to use "syncthing-gtk" (rather than a store path to
> ".syncthing-gtk-real") as the exec command for the autostart desktop file
> written by syncthing-gtk.

Thanks! I pushed as c37559e81979232feee07aa1eb39faacb093c5ca with the
following changes:

1) I renamed the phase to 'fix-autostart-path'. It's not very important
but typically build phases are named imperatively.

2) I rewrote the commit message and code comment to be more clear about
what the change does. I found it a bit confusing and had to reread the
previous discussion to remind myself. Hopefully this is an improvement.

Thanks again for taking care of this package!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-05 21:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 19:20 [bug#53036] [PATCH] gnu: syncthing-gtk: Fix autostart John Kehayias via Guix-patches via
2022-01-05 21:13 ` Leo Famulari

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).