[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/13: gnu: Patch libxt's default search path.
From: |
Mark H. Weaver |
Subject: |
01/13: gnu: Patch libxt's default search path. |
Date: |
Wed, 11 Jan 2017 16:25:10 +0000 (UTC) |
mhw pushed a commit to branch master
in repository guix.
commit 54d8d0fef1a0224f118dbfad8fceece06d322eab
Author: John Darrington <address@hidden>
Date: Fri Dec 2 17:25:34 2016 +0100
gnu: Patch libxt's default search path.
* gnu/packages/patches/libxt-guix-search-paths.patch: New file.
* gnu/packages/xorg.scm (libxt) [source]: Add patch.
---
gnu/packages/patches/libxt-guix-search-paths.patch | 126 ++++++++++++++++++++
gnu/packages/xorg.scm | 3 +-
2 files changed, 128 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/patches/libxt-guix-search-paths.patch
b/gnu/packages/patches/libxt-guix-search-paths.patch
new file mode 100644
index 0000000..c618f48
--- /dev/null
+++ b/gnu/packages/patches/libxt-guix-search-paths.patch
@@ -0,0 +1,126 @@
+--- libXt-1.1.5/src/Intrinsic.c 2015-05-01 07:36:20.000000000 +0200
++++ Intrinsic.c 2016-12-12 00:42:16.567388450 +0100
+@@ -1303,21 +1303,101 @@
+ } else (void) strcpy(*rest, string);
+ }
+
+-/*
+- * default path used if environment variable XFILESEARCHPATH
+- * is not defined. Also substitued for %D.
+- * The exact value should be documented in the implementation
+- * notes for any Xt implementation.
++
++
++/*
++ Return the default search path for the function
++ XtResolvePathname to use if XFILESEARCHPATH is
++ not defined.
++
++ It returns the combination the set of values which are the 6 "stems" below,
++ prepended with "/run/current-system/profile", and $GUIX_PROFILE and
++ "$HOME/.guix-profile"
++
++ These values provide the default paths where Guix/GuixSD can expect
++ to find resources for installed packages.
+ */
+-static const char *implementation_default_path(void)
++static const char *guix_default_path(void)
+ {
+-#if defined(WIN32)
+- static char xfilesearchpath[] = "";
+-
+- return xfilesearchpath;
+-#else
+- return XFILESEARCHPATHDEFAULT;
+-#endif
++ static const char *search_path_default_stem[] = {
++ "/lib/X11/%L/%T/%N%C%S",
++ "/lib/X11/%l/%T/%N%C%S",
++ "/lib/X11/%T/%N%C%S",
++ "/lib/X11/%L/%T/%N%S",
++ "/lib/X11/%l/%T/%N%S",
++ "/lib/X11/%T/%N%S"
++ };
++
++#define SIZEOF_STEMS (strlen (search_path_default_stem[0]) \
++ + strlen (search_path_default_stem[1]) \
++ + strlen (search_path_default_stem[2]) \
++ + strlen (search_path_default_stem[3]) \
++ + strlen (search_path_default_stem[4]) \
++ + strlen (search_path_default_stem[5]))
++
++
++ int i;
++ const char *current_profile = "/run/current-system/profile";
++ char *home = getenv ("HOME");
++ char *guix_profile = getenv ("GUIX_PROFILE");
++
++ size_t bytesAllocd = SIZEOF_STEMS + 1;
++
++ /* This function is evaluated multiple times and the calling
++ code assumes that it is idempotent. So we must not allow
++ (say) a changed environment variable to cause it to return
++ something different. */
++ static char *path = NULL;
++ if (path)
++ return path;
++
++ bytesAllocd += 6 * (1 + strlen (current_profile));
++
++ if (guix_profile != NULL)
++ {
++ bytesAllocd += SIZEOF_STEMS;
++ bytesAllocd += 6 * (1 + strlen (guix_profile));
++ }
++
++ if (home != NULL)
++ {
++ bytesAllocd += SIZEOF_STEMS;
++ bytesAllocd += 6 * (1 + strlen(home) + strlen ("/.guix-profile"));
++ }
++
++ path = XtMalloc(bytesAllocd);
++ if (path == NULL) _XtAllocError(NULL);
++
++ memset (path, 0, bytesAllocd);
++
++ for (i = 0 ; i < 6 ; ++i)
++ {
++ strcat (path, current_profile);
++ strcat (path, search_path_default_stem[i]);
++ strcat (path, ":");
++ }
++
++ if (guix_profile != NULL)
++ for (i = 0 ; i < 6 ; ++i)
++ {
++ strcat (path, guix_profile);
++ strcat (path, search_path_default_stem[i]);
++ strcat (path, ":");
++ }
++
++ if (home != NULL)
++ for (i = 0 ; i < 6 ; ++i)
++ {
++ strcat (path, home);
++ strcat (path, "/.guix-profile");
++ strcat (path, search_path_default_stem[i]);
++ strcat (path, ":");
++ }
++
++ /* Remove final : */
++ path[strlen(path) - 1] = '\0';
++
++ return path;
+ }
+
+
+@@ -1345,7 +1425,7 @@
+ {
+ XtPerDisplay pd;
+ static const char *defaultPath = NULL;
+- const char *impl_default = implementation_default_path();
++ const char *impl_default = guix_default_path();
+ int idef_len = strlen(impl_default);
+ char *massagedPath;
+ int bytesAllocd, bytesLeft;
diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 3930d21..c3df6ad 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -5304,7 +5304,8 @@ draggable titlebars and borders.")
".tar.bz2"))
(sha256
(base32
- "06lz6i7rbrp19kgikpaz4c97fw7n31k2h2aiikczs482g2zbdvj6"))))
+ "06lz6i7rbrp19kgikpaz4c97fw7n31k2h2aiikczs482g2zbdvj6"))
+ (patches (search-patches "libxt-guix-search-paths.patch"))))
(build-system gnu-build-system)
(outputs '("out"
"doc")) ;2 MiB of man pages + XML
- branch master updated (9b5364a -> c5edbb9), Mark H. Weaver, 2017/01/11
- 03/13: gnu: libxpm: Update to 3.5.12., Mark H. Weaver, 2017/01/11
- 04/13: gnu: mesa: Enable floating point textures., Mark H. Weaver, 2017/01/11
- 10/13: Revert "gnu: nss: Add comment about test failures in NSS 3.27.2", Mark H. Weaver, 2017/01/11
- 08/13: gnu: cairo: Update to 1.14.8., Mark H. Weaver, 2017/01/11
- 02/13: gnu: kmod: Update to 23., Mark H. Weaver, 2017/01/11
- 07/13: gnu: harfbuzz: Update to 1.3.4., Mark H. Weaver, 2017/01/11
- 01/13: gnu: Patch libxt's default search path.,
Mark H. Weaver <=
- 11/13: gnu: kcrash: Work around race condition when starting Xvfb., Mark H. Weaver, 2017/01/11
- 05/13: gnu: cups-filters: Update to 1.13.1., Mark H. Weaver, 2017/01/11
- 09/13: gnu: cairomm: Update to 1.12.2., Mark H. Weaver, 2017/01/11
- 12/13: Revert "gnu: Add threaded variants of fftw and fftwf for Ardour and mod-host.", Mark H. Weaver, 2017/01/11
- 13/13: gnu: ardour: Add eudev dependency., Mark H. Weaver, 2017/01/11
- 06/13: gnu: poppler: Update to 0.50.0., Mark H. Weaver, 2017/01/11