[PATCH 0/1] gnu: transmission: Move remaining GUI-related files to "gui" output.

  • Done
  • quality assurance status badge
Details
4 participants
  • Leo Prikler
  • Leo Famulari
  • Ludovic Courtès
  • Simon South
Owner
unassigned
Submitted by
Simon South
Severity
normal

Debbugs page

Simon South wrote 4 years ago
(address . guix-patches@gnu.org)(address . simon@simonsouth.net)
cover.1605196995.git.simon@simonsouth.net
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
Simon South wrote 4 years ago
[PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
(address . 44595@debbugs.gnu.org)(address . simon@simonsouth.net)
4314a875fc1264de13249194636d083da182db7a.1605196995.git.simon@simonsouth.net
* 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(-)

Toggle diff (28 lines)
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
Ludovic Courtès wrote 4 years ago
(name . Simon South)(address . simon@simonsouth.net)(address . 44595-done@debbugs.gnu.org)
87k0uii8pd.fsf@gnu.org
Simon South <simon@simonsouth.net> skribis:

Toggle quote (4 lines)
> * 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’.
Closed
Leo Prikler wrote 4 years ago
bug#44595: [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
(address . ludo@gnu.org)(address . 44595@debbugs.gnu.org)
54d5fb0b95efa59bd8db586a7660edfd3dcca2fc.camel@student.tugraz.at
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
Simon South wrote 4 years ago
Re: [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
87r1ol7c1f.fsf@simonsouth.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:
Toggle quote (5 lines)
> 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
Simon South wrote 4 years ago
87wny67aj8.fsf@simonsouth.net
Leo Prikler <leo.prikler@student.tugraz.at> writes:
Toggle quote (4 lines)
> 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
Simon South wrote 4 years ago
[PATCH] gnu: transmission: Fix localization of transmission-gtk.
(address . simon@simonsouth.net)
20201127213546.10507-1-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

Toggle diff (92 lines)
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
Leo Prikler wrote 4 years ago
Re: [bug#44595] [PATCH 1/1] gnu: transmission: Move remaining GUI-related files to "gui" output.
66842c9c9043fd8f8445026e953b79683244a6df.camel@student.tugraz.at
Am Freitag, den 27.11.2020, 16:30 -0500 schrieb Simon South:
Toggle quote (7 lines)
> 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 :)
Leo Famulari wrote 4 years ago
(name . Leo Prikler)(address . leo.prikler@student.tugraz.at)
X8HVK25xbftpyM55@jasmine.lan
On Fri, Nov 27, 2020 at 11:35:24PM +0100, Leo Prikler wrote:
Toggle quote (10 lines)
> 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?
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAl/B1SoACgkQJkb6MLrK
fwhJmhAAunANBXVKqMqJwT3oYLtH8T8EFVkQlb2WbX7GGR6L+qdQLvAJEu9QISpq
4sEOF2qBNKvTCcp73IzAUjlWteb7yCyKsJeBi9Ivhj2zpwF3Cnq8w8DyWPuXtx2n
Dc1ZHsuWnoYklMRvrT4fdn4/cYKsLRjdRHn7jghN/2vWeLCGiE+VbuRy830es59s
CLkpAd5ZrIZqa3DDY+UXSWu8ty5YiOrQ4Ygi4AKFABbulDBpNl67QmRMWpMJYvHD
npnf+mtJHM/kguH45+Ea5ACWs0KMeoUMLgxZkHt2iR1UYdzY0bWw9mdQ4O2azdBy
0ETMULq+V8Y2EhPJBV+qK6Cpn9tkGswcgb1k6Ebh9L2ZoYUxAnuSG8AmdO6MwzwS
ojGemi8qzkq8WwPhSfNZswzBozDmT0VVLyV5ngY/l7xhSNTbImwtsc5jH5fMM4Y4
cFxWrKuyoVvOytI1AvoJrtLjaLxGgXBYTjrp151kzlbi0GQbyf+1s8J+IUPdGzOo
sIUcbyEu4zjL29xOs/zUyx1V3h+9P1gsvmIdAYqFz+aZUy/uZrukEbTaZUfQW2zI
+ZFfVIDPAxReb8io7QV5XrIY875UqiO+i+jJeJ1Ytm4vbAo7Al3mul96s+dQvuBy
6SHwTo2TQgUC0G2P7tgnyC6ZuPU77suPLHvGCnlzGrUpjRDxbr4=
=yxGK
-----END PGP SIGNATURE-----


Closed
Simon South wrote 4 years ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 44595-done@debbugs.gnu.org)
87czzx5pfe.fsf@simonsouth.net
Leo Famulari <leo@famulari.name> writes:
Toggle quote (2 lines)
> Great! Pushed as 1d63445168d0102adf08637ed3be4609a044c9e6

Nice, thank you.

Toggle quote (2 lines)
> 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
Closed
Leo Famulari wrote 4 years ago
(name . Simon South)(address . simon@simonsouth.net)(address . 44595-done@debbugs.gnu.org)
X8L1S3rxS3ASBSpV@jasmine.lan
On Sat, Nov 28, 2020 at 01:03:49PM -0500, Simon South wrote:
Toggle quote (5 lines)
> 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.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 44595@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 44595
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help