unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#44595] [PATCH 0/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
@ 2020-11-12 16:23 Simon South
  2020-11-12 16:27 ` [bug#44595] [PATCH 1/1] " Simon South
  2020-11-22  0:03 ` [bug#44595] " Leo Prikler
  0 siblings, 2 replies; 11+ messages in thread
From: Simon South @ 2020-11-12 16:23 UTC (permalink / raw)
  To: 44595; +Cc: simon

This patch updates the package for Transmission, a BitTorrent client, to more
completely separate its GUI from the rest of the package's output.

Specifically, it moves the AppData, localization files and man page for the
"transmission-gtk" application to the package's "gui" output. These had
inadvertently been left in the main output, as you can see (before applying
the patch) with

  find `guix build transmission` -type f | grep gtk

Note I've also removed a comment from the package definition, as it is now
outdated and I see no reason to be continually expanding it when I feel it is
clear from the phase's name, the preceding comment and the code itself what is
being done and why.

--
Simon South
simon@simonsouth.net


Simon South (1):
  gnu: transmission: Move remaining GUI-related files to "gui" output.

 gnu/packages/bittorrent.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

-- 
2.29.2





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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-12 16:23 [bug#44595] [PATCH 0/1] gnu: transmission: Move remaining GUI-related files to "gui" output Simon South
@ 2020-11-12 16:27 ` Simon South
  2020-11-18 22:47   ` bug#44595: " Ludovic Courtès
  2020-11-22  0:03 ` [bug#44595] " Leo Prikler
  1 sibling, 1 reply; 11+ messages in thread
From: Simon South @ 2020-11-12 16:27 UTC (permalink / raw)
  To: 44595; +Cc: simon

* gnu/packages/bittorrent.scm (transmission)[arguments]<phases>: Expand
"move-gui" phase to move remaining GUI-related files (AppData file,
localization files, man page) to "gui" output.
---
 gnu/packages/bittorrent.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm
index 2a4339fda0..c2ac44a267 100644
--- a/gnu/packages/bittorrent.scm
+++ b/gnu/packages/bittorrent.scm
@@ -93,14 +93,18 @@
                (rename-file (string-append out "/bin/transmission-gtk")
                             (string-append gui "/bin/transmission-gtk"))
 
-               ;; Move the '.desktop' and icon files as well.
                (mkdir (string-append gui "/share"))
                (for-each
                 (lambda (dir)
                   (rename-file (string-append out "/share/" dir)
                                (string-append gui "/share/" dir)))
-                '("applications" "icons" "pixmaps")))
-             #t)))))
+                '("appdata" "applications" "icons" "locale" "pixmaps"))
+
+               (mkdir-p (string-append gui "/share/man/man1"))
+               (rename-file
+                (string-append out "/share/man/man1/transmission-gtk.1")
+                (string-append gui "/share/man/man1/transmission-gtk.1"))
+             #t))))))
     (inputs
      `(("libevent" ,libevent)
        ("curl" ,curl)
-- 
2.29.2





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

* bug#44595: [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-12 16:27 ` [bug#44595] [PATCH 1/1] " Simon South
@ 2020-11-18 22:47   ` Ludovic Courtès
  0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2020-11-18 22:47 UTC (permalink / raw)
  To: Simon South; +Cc: 44595-done

Simon South <simon@simonsouth.net> skribis:

> * gnu/packages/bittorrent.scm (transmission)[arguments]<phases>: Expand
> "move-gui" phase to move remaining GUI-related files (AppData file,
> localization files, man page) to "gui" output.

Applied, thanks!

Ludo’.




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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-12 16:23 [bug#44595] [PATCH 0/1] gnu: transmission: Move remaining GUI-related files to "gui" output Simon South
  2020-11-12 16:27 ` [bug#44595] [PATCH 1/1] " Simon South
@ 2020-11-22  0:03 ` Leo Prikler
  2020-11-22 13:31   ` Simon South
  2020-11-27 21:30   ` Simon South
  1 sibling, 2 replies; 11+ messages in thread
From: Leo Prikler @ 2020-11-22  0:03 UTC (permalink / raw)
  To: ludo; +Cc: 44595

Hi,

I believe this patch inadvertently broke localization for transmission-
gtk – or at least I'm recently seeing the English version despite the
localization files being present and my locale not being set to English
.  There is probably a bindtextdomain call somewhere, that is not
accurately patched and hence refers to "out" instead of "gui".

Regards, Leo





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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-22  0:03 ` [bug#44595] " Leo Prikler
@ 2020-11-22 13:31   ` Simon South
  2020-11-27 21:30   ` Simon South
  1 sibling, 0 replies; 11+ messages in thread
From: Simon South @ 2020-11-22 13:31 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 44595, ludo

Leo Prikler <leo.prikler@student.tugraz.at> writes:
> I believe this patch inadvertently broke localization for transmission-
> gtk – or at least I'm recently seeing the English version despite the
> localization files being present and my locale not being set to
> English.

Thanks for pointing this out, Leo. I'll look into it.

-- 
Simon South
simon@simonsouth.net




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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-22  0:03 ` [bug#44595] " Leo Prikler
  2020-11-22 13:31   ` Simon South
@ 2020-11-27 21:30   ` Simon South
  2020-11-27 21:35     ` [bug#44595] [PATCH] gnu: transmission: Fix localization of transmission-gtk Simon South
  2020-11-27 22:35     ` [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output Leo Prikler
  1 sibling, 2 replies; 11+ messages in thread
From: Simon South @ 2020-11-27 21:30 UTC (permalink / raw)
  To: 44595, Leo Prikler

Leo Prikler <leo.prikler@student.tugraz.at> writes:
> I believe this patch inadvertently broke localization for transmission-
> gtk – or at least I'm recently seeing the English version despite the
> localization files being present and my locale not being set to English

I think I have this fixed now; I'll reply to this email with a patch
that corrects this by

- Patching Transmission to honour the "localedir" option to its
  configure script, and

- Using this option to specify the "gui" output as the location for the
  (GTK-specific) localization data.

With the patch applied I can now run transmission-gtk en français, which
really did not work before.

Leo, thanks for mentioning "bindtextdomain" as that was indeed the
source of the problem. If you have a few moments, could you test the
patch please to make sure it fixes the problem you're seeing?

-- 
Simon South
simon@simonsouth.net




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

* [bug#44595] [PATCH] gnu: transmission: Fix localization of transmission-gtk.
  2020-11-27 21:30   ` Simon South
@ 2020-11-27 21:35     ` Simon South
  2020-11-27 22:35     ` [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output Leo Prikler
  1 sibling, 0 replies; 11+ messages in thread
From: Simon South @ 2020-11-27 21:35 UTC (permalink / raw)
  To: 44595, leo.prikler; +Cc: simon

* gnu/packages/bittorrent.scm (transmission)[source]: Add patch to make
Transmission honor the "localedir" option to its configure script.
[arguments]<configure-flags>: Use "localedir" to set the "gui" output as the
location for (GTK-specific) localization data.
[arguments]<phases>: Update "move-gui" to remove a now-superfluous call to
"mkdir" and omit "share/locale" from the list of directories needing to be
moved between outputs.
* gnu/packages/patches/transmission-honor-localedir.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/bittorrent.scm                   | 12 ++++---
 .../transmission-honor-localedir.patch        | 34 +++++++++++++++++++
 3 files changed, 43 insertions(+), 4 deletions(-)
 create mode 100644 gnu/packages/patches/transmission-honor-localedir.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 289f510c11..fe94bcfc2e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1656,6 +1656,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/tipp10-remove-license-code.patch		\
   %D%/packages/patches/tk-find-library.patch			\
   %D%/packages/patches/transcode-ffmpeg.patch	\
+  %D%/packages/patches/transmission-honor-localedir.patch	\
   %D%/packages/patches/ttf2eot-cstddef.patch			\
   %D%/packages/patches/tup-unbundle-dependencies.patch		\
   %D%/packages/patches/tuxpaint-stamps-path.patch		\
diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm
index ab44caa06a..08e61d7ba2 100644
--- a/gnu/packages/bittorrent.scm
+++ b/gnu/packages/bittorrent.scm
@@ -75,12 +75,17 @@
                                   version ".tar.xz"))
               (sha256
                (base32
-                "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i"))))
+                "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i"))
+              (patches (search-patches "transmission-honor-localedir.patch"))))
     (build-system glib-or-gtk-build-system)
     (outputs '("out"                      ; library and command-line interface
                "gui"))                    ; graphical user interface
     (arguments
-     '(#:glib-or-gtk-wrap-excluded-outputs '("out")
+     '(#:configure-flags
+       (list (string-append "--localedir="
+                            (assoc-ref %outputs "gui")
+                            "/share/locale"))
+       #:glib-or-gtk-wrap-excluded-outputs '("out")
        #:phases
        (modify-phases %standard-phases
          (add-after 'install 'move-gui
@@ -93,12 +98,11 @@
                (rename-file (string-append out "/bin/transmission-gtk")
                             (string-append gui "/bin/transmission-gtk"))
 
-               (mkdir (string-append gui "/share"))
                (for-each
                 (lambda (dir)
                   (rename-file (string-append out "/share/" dir)
                                (string-append gui "/share/" dir)))
-                '("appdata" "applications" "icons" "locale" "pixmaps"))
+                '("appdata" "applications" "icons" "pixmaps"))
 
                (mkdir-p (string-append gui "/share/man/man1"))
                (rename-file
diff --git a/gnu/packages/patches/transmission-honor-localedir.patch b/gnu/packages/patches/transmission-honor-localedir.patch
new file mode 100644
index 0000000000..70c66bfb2b
--- /dev/null
+++ b/gnu/packages/patches/transmission-honor-localedir.patch
@@ -0,0 +1,34 @@
+This patch modifies Transmission so it honors the "localedir" option
+passed to its configure script, allowing GTK-specific localization
+data to be placed in the package's "gui" output.
+
+Without this patch, localization of transmission-gtk can break as the
+application will expect to find this data in the package's default
+output (as a result of the call to bindtextdomain in gtk/main.c).
+
+diff --git a/configure b/configure
+index a29e24f..3ae8ef4 100755
+--- a/configure
++++ b/configure
+@@ -21305,7 +21305,7 @@ $as_echo "$LINGUAS" >&6; }
+    sed -e "/^#/d" -e "/^\$/d" -e "s,.*,	$posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ 	< $srcdir/po/POTFILES.in > po/POTFILES
+ 
+-    transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
++    transmissionlocaledir='${localedir}'
+ 
+ fi
+ 
+diff --git a/configure.ac b/configure.ac
+index 57d3cae..ab62093 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -563,7 +563,7 @@ if test "x$enable_nls" = "xyes" ; then
+     AC_SUBST(GETTEXT_PACKAGE)
+     AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
+     AM_GLIB_GNU_GETTEXT
+-    transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
++    transmissionlocaledir='${localedir}'
+     AC_SUBST(transmissionlocaledir)
+ fi
+ AC_SUBST(INTLLIBS)
-- 
2.29.2





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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-27 21:30   ` Simon South
  2020-11-27 21:35     ` [bug#44595] [PATCH] gnu: transmission: Fix localization of transmission-gtk Simon South
@ 2020-11-27 22:35     ` Leo Prikler
  2020-11-28  4:42       ` Leo Famulari
  1 sibling, 1 reply; 11+ messages in thread
From: Leo Prikler @ 2020-11-27 22:35 UTC (permalink / raw)
  To: Simon South, 44595

Am Freitag, den 27.11.2020, 16:30 -0500 schrieb Simon South:
> With the patch applied I can now run transmission-gtk en français,
> which
> really did not work before.
> 
> Leo, thanks for mentioning "bindtextdomain" as that was indeed the
> source of the problem. If you have a few moments, could you test the
> patch please to make sure it fixes the problem you're seeing?
LGTM, it now displays perfektes Alman as before :)





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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-27 22:35     ` [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output Leo Prikler
@ 2020-11-28  4:42       ` Leo Famulari
  2020-11-28 18:03         ` Simon South
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2020-11-28  4:42 UTC (permalink / raw)
  To: Leo Prikler; +Cc: 44595-done, Simon South

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

On Fri, Nov 27, 2020 at 11:35:24PM +0100, Leo Prikler wrote:
> Am Freitag, den 27.11.2020, 16:30 -0500 schrieb Simon South:
> > With the patch applied I can now run transmission-gtk en français,
> > which
> > really did not work before.
> > 
> > Leo, thanks for mentioning "bindtextdomain" as that was indeed the
> > source of the problem. If you have a few moments, could you test the
> > patch please to make sure it fixes the problem you're seeing?
> LGTM, it now displays perfektes Alman as before :)

Great! Pushed as 1d63445168d0102adf08637ed3be4609a044c9e6

Simon, do you think the patch should be sent upstream? Is the fix
generically useful? Or is it really a weird corner case from Guix?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-28  4:42       ` Leo Famulari
@ 2020-11-28 18:03         ` Simon South
  2020-11-29  1:11           ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Simon South @ 2020-11-28 18:03 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 44595-done

Leo Famulari <leo@famulari.name> writes:
> Great! Pushed as 1d63445168d0102adf08637ed3be4609a044c9e6

Nice, thank you.

> Simon, do you think the patch should be sent upstream?

This occurred to me but it turns out a recent commit rips out the
Autotools-based build system altogether, so the change no longer has any
context upstream. This also means we may need to devise a new solution
for the next version of Transmission when it releases.

-- 
Simon South
simon@simonsouth.net




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

* [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
  2020-11-28 18:03         ` Simon South
@ 2020-11-29  1:11           ` Leo Famulari
  0 siblings, 0 replies; 11+ messages in thread
From: Leo Famulari @ 2020-11-29  1:11 UTC (permalink / raw)
  To: Simon South; +Cc: 44595-done

On Sat, Nov 28, 2020 at 01:03:49PM -0500, Simon South wrote:
> This occurred to me but it turns out a recent commit rips out the
> Autotools-based build system altogether, so the change no longer has any
> context upstream. This also means we may need to devise a new solution
> for the next version of Transmission when it releases.

Good to know... looks like they are going to use CMake.




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

end of thread, other threads:[~2020-11-29  1:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 16:23 [bug#44595] [PATCH 0/1] gnu: transmission: Move remaining GUI-related files to "gui" output Simon South
2020-11-12 16:27 ` [bug#44595] [PATCH 1/1] " Simon South
2020-11-18 22:47   ` bug#44595: " Ludovic Courtès
2020-11-22  0:03 ` [bug#44595] " Leo Prikler
2020-11-22 13:31   ` Simon South
2020-11-27 21:30   ` Simon South
2020-11-27 21:35     ` [bug#44595] [PATCH] gnu: transmission: Fix localization of transmission-gtk Simon South
2020-11-27 22:35     ` [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output Leo Prikler
2020-11-28  4:42       ` Leo Famulari
2020-11-28 18:03         ` Simon South
2020-11-29  1:11           ` 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).