gnu: Transmission: Fix localization of transmission-gtk.

* 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.
<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.

Signed-off-by: Leo Famulari <leo@famulari.name>
This commit is contained in:
Simon South 2020-11-27 16:35:46 -05:00 committed by Leo Famulari
parent b229803a78
commit 1d63445168
No known key found for this signature in database
GPG key ID: 2646FA30BACA7F08
3 changed files with 43 additions and 4 deletions

View file

@ -1656,6 +1656,7 @@ dist_patch_DATA = \
%D%/packages/patches/tipp10-remove-license-code.patch \ %D%/packages/patches/tipp10-remove-license-code.patch \
%D%/packages/patches/tk-find-library.patch \ %D%/packages/patches/tk-find-library.patch \
%D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transcode-ffmpeg.patch \
%D%/packages/patches/transmission-honor-localedir.patch \
%D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \
%D%/packages/patches/tup-unbundle-dependencies.patch \ %D%/packages/patches/tup-unbundle-dependencies.patch \
%D%/packages/patches/tuxpaint-stamps-path.patch \ %D%/packages/patches/tuxpaint-stamps-path.patch \

View file

@ -75,12 +75,17 @@ (define-public transmission
version ".tar.xz")) version ".tar.xz"))
(sha256 (sha256
(base32 (base32
"1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i")))) "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i"))
(patches (search-patches "transmission-honor-localedir.patch"))))
(build-system glib-or-gtk-build-system) (build-system glib-or-gtk-build-system)
(outputs '("out" ; library and command-line interface (outputs '("out" ; library and command-line interface
"gui")) ; graphical user interface "gui")) ; graphical user interface
(arguments (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 #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'install 'move-gui (add-after 'install 'move-gui
@ -93,12 +98,11 @@ (define-public transmission
(rename-file (string-append out "/bin/transmission-gtk") (rename-file (string-append out "/bin/transmission-gtk")
(string-append gui "/bin/transmission-gtk")) (string-append gui "/bin/transmission-gtk"))
(mkdir (string-append gui "/share"))
(for-each (for-each
(lambda (dir) (lambda (dir)
(rename-file (string-append out "/share/" dir) (rename-file (string-append out "/share/" dir)
(string-append gui "/share/" dir))) (string-append gui "/share/" dir)))
'("appdata" "applications" "icons" "locale" "pixmaps")) '("appdata" "applications" "icons" "pixmaps"))
(mkdir-p (string-append gui "/share/man/man1")) (mkdir-p (string-append gui "/share/man/man1"))
(rename-file (rename-file

View file

@ -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)