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
* 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
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’.
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
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
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
* 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
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 :)
[-- 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 --]
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
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.