extra apps and locales
Bastien Nocera
hadess at hadess.net
Wed Feb 15 20:19:37 UTC 2017
On Wed, 2017-02-15 at 18:35 +0000, Robert McQueen wrote:
> Hi there,
>
> We have a Flatpak for VLC (https://github.com/endlessm/vlc-flatpak/)
Added to the examples Wiki page:
https://github.com/flatpak/flatpak/wiki/Examples
Would be great if you could convince the upstream to ship it!
> where we're downloading some pre-compiled Linux binaries (for Debian
> jessie, because our runtime is based on that) and unpacking the /usr
> from the .debs into /app/extra.
>
> The app works fine, but doesn't find it's locales - because the
> binaries
> are compiled assuming prefix is /usr, so it's looking in
> /usr/share/locale for it's .mo files. The gettext command line tool
> accepts a TEXTDOMAINDIR environment variable, but glibc's
> bindtextdomain
> call doesn't respect this environment variable - it just takes the
> arguments provided which are compiled in to the calling binary.
There are multiple ways to fix or work-around this problem:
1) Call bindtextdomain() again for those domains which don't live in
/usr. From reading the man page, it seems to overwrite the existing
directory configured. This is useful if you can modify the program, and
all the libraries from which you need translations are init'ed at the
same time
2) Patch the binary. Easy to do if your locale path will be shorter
than Debian's. Pretty sure that could be a 'sed' script.
3) Use LD_PRELOAD to intercept bindtextdomain() calls. Also pretty easy
to do, especially if as you have the libc sources.
<snip>
> In some other cases, we've patched some libraries like GStreamer in
> the
> Flatpak runtime, to eg have a different search path for plugins, but
> patching glibc (in both the fd.o runtime & also in the Endless OS
> runtime, where a large part is shared with the system's ostree)
> seems
> like a very large sledgehammer to crack this nut.
Pretty sure GStreamer has envvar that will actually affect its search
path, it's even set in jhbuild:
$ export | grep GST
declare -x GST_PLUGIN_PATH_1_0="/home/hadess/Projects/gnome-install/lib/gstreamer-1.0"
declare -x GST_REGISTRY="/home/hadess/Projects/gnome-install/_jhbuild/gstreamer-0.10.registry"
declare -x GST_REGISTRY_1_0="/home/hadess/Projects/gnome-install/_jhbuild/gstreamer-1.0.registry"
Cheers
More information about the xdg-app
mailing list