aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-10-01 21:32:50 +0200
committerLudovic Courtès <ludo@gnu.org>2015-10-03 17:55:13 +0200
commitfbb909ac7e947ebc8aea2c2efca7df3a78dfc3c4 (patch)
tree9544c52c5284af05bae138a42dd98f53768d2ef2 /gnu/packages/patches
parent1668dfcd37174af13636a85c80df2f833e867387 (diff)
downloadguix-fbb909ac7e947ebc8aea2c2efca7df3a78dfc3c4.tar
guix-fbb909ac7e947ebc8aea2c2efca7df3a78dfc3c4.tar.gz
gnu: glibc: Honor 'GUIX_LOCPATH'.
* gnu/packages/patches/glibc-guix-locpath.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/base.scm (glibc)[source]: Use it. [native-search-paths]: Use 'GUIX_LOCPATH' instead of 'LOCPATH'. * doc/guix.texi (Application Setup): Introduce the term "foreign distro". Document 'GUIX_LOCPATH'.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/glibc-guix-locpath.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnu/packages/patches/glibc-guix-locpath.patch b/gnu/packages/patches/glibc-guix-locpath.patch
new file mode 100644
index 0000000000..69bb2e50de
--- /dev/null
+++ b/gnu/packages/patches/glibc-guix-locpath.patch
@@ -0,0 +1,34 @@
+Honor a special 'GUIX_LOCPATH' environment variable.
+
+This is most useful when using Guix on top of another distro, which uses an
+different libc version with incompatible locale data. In this case, setting
+'GUIX_LOCPATH' rather than 'LOCPATH' allows users to tell Guix's libc where to
+look for its locale data without breaking programs that use the other libc.
+
+See <https://lists.gnu.org/archive/html/guix-devel/2015-09/msg00717.html> for
+some background information.
+
+--- a/locale/newlocale.c
++++ b/locale/newlocale.c
+@@ -103,6 +103,8 @@ __newlocale (int category_mask, const char *locale, __locale_t base)
+ locale_path_len = 0;
+
+ locpath_var = getenv ("LOCPATH");
++ if (locpath_var == NULL || locpath_var[0] == '\0')
++ locpath_var = getenv ("GUIX_LOCPATH");
+ if (locpath_var != NULL && locpath_var[0] != '\0')
+ {
+ if (__argz_create_sep (locpath_var, ':',
+diff --git a/locale/setlocale.c b/locale/setlocale.c
+index ead030d..0e66c7b 100644
+--- a/locale/setlocale.c
++++ b/locale/setlocale.c
+@@ -252,6 +252,8 @@ setlocale (int category, const char *locale)
+ locale_path_len = 0;
+
+ locpath_var = getenv ("LOCPATH");
++ if (locpath_var == NULL || locpath_var[0] == '\0')
++ locpath_var = getenv ("GUIX_LOCPATH");
+ if (locpath_var != NULL && locpath_var[0] != '\0')
+ {
+ if (__argz_create_sep (locpath_var, ':',