Package: motif / 2.3.4-13

13-fix_hardcoded_x11rgb_path.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: Fix hardcoded path to /usr/lib/X11/rgb.txt in lib/Xm/ColorS.c
 LibXm is hardcoded to read rgb.txt from /usr/lib/X11 but this file, provided
 by x11-common in Debian, is located in /etc/X11 and /usr/share/X11 via symlink.
 .
 This patch fixes this by allowing the directory in which rgb.txt resides to be
 customized by the --with-x11rgbdir=DIR configure option.
Author: Graham Inggs <graham@nerve.org.za>
Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1585
Last-Update: 2013-03-12
--- a/configure.ac
+++ b/configure.ac
@@ -189,6 +189,10 @@
 XMBINDDIR_FALLBACK="$xmbinddir"
 AC_SUBST(XMBINDDIR_FALLBACK)
 
+AC_ARG_WITH(x11rgbdir, [  --with-x11rgbdir=DIR  rgb.txt is located in DIR], x11rgbdir=$withval, x11rgbdir="/usr/lib/X11")
+X11RGBPATH="$x11rgbdir/rgb.txt"
+AC_SUBST(X11RGBPATH)
+
 RM="rm -f"
 AC_SUBST(RM)
 
--- a/lib/Xm/ColorS.c
+++ b/lib/Xm/ColorS.c
@@ -123,6 +123,10 @@
  *       STATIC DECLARATIONS
  ************************************************************/
 
+#ifndef X11RGBPATH
+#define X11RGBPATH "/usr/lib/X11/rgb.txt"
+#endif
+
 static XtResource resources[] =
 {
   {
@@ -146,7 +150,7 @@
   {
     XmNrgbFile, XmCString, XmRString,
     sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file),
-    XmRString, (XtPointer) "/usr/lib/X11/rgb.txt"
+    XmRString, (XtPointer) X11RGBPATH
   },
 #endif
   {
--- a/lib/Xm/Makefile.am
+++ b/lib/Xm/Makefile.am
@@ -8,6 +8,7 @@
 INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \
            -DINCDIR=\"@INCDIR@\" \
            -DLIBDIR=\"@LIBDIR@\" \
+           -DX11RGBPATH=\"@X11RGBPATH@\" \
            ${X_CFLAGS}
 xmdir = $(includedir)/Xm