[R] Building R on Fedora Core 2 from the src rpm

Christopher Albert christopher.albert at mcgill.ca
Wed May 19 18:34:19 CEST 2004


Hi,

The libtk8.3 dependencies in the R-1.9.0 rpm generate apt conflicts 
after an upgrade from Fedora Core 1 to Fedora core 2.
In trying to rebuild the rpm from the source rpm provided on CRAN,
the build fails when it comes time to compile

src/modules/X11/dataentry.c

you get many errors of the form :
> In file included from dataentry.c:34:
> /usr/X11R6/include/X11/Xlib.h:1400: error: syntax error before "_Xconst"
> /usr/X11R6/include/X11/Xlib.h:1488: error: syntax error before "char"
> /usr/X11R6/include/X11/Xlib.h:1516: error: syntax error before "_Xconst"
> /usr/X11R6/include/X11/Xlib.h:1520: error: syntax error before "char"
> /usr/X11R6/include/X11/Xlib.h:1542: error: syntax error before "_Xconst"
...

This could have something to do with the change from X1186 to xorg.

A workaround is simply to change the line in src/modules/X11/dataentry.c:
> /* don't use X11 function prototypes (which tend to ...): */
> #define NeedFunctionPrototypes 0
to
 > #define NeedFunctionPrototypes 1 .

As a patch:
> diff -crN R-1.9.0.orig/src/modules/X11/dataentry.c R-1.9.0/src/modules/X11/dataentry.c
> *** R-1.9.0.orig/src/modules/X11/dataentry.c    2004-03-22 06:00:16.000000000 -0500
> --- R-1.9.0/src/modules/X11/dataentry.c 2004-05-19 11:35:21.903803616 -0400
> ***************
> *** 29,35 ****
>   #include "Print.h"
>    
>   /* don't use X11 function prototypes (which tend to ...): */
> ! #define NeedFunctionPrototypes 0
>   #include <X11/X.h>
>   #include <X11/Xlib.h>
>   #include <X11/Xutil.h>
> --- 29,35 ----
>   #include "Print.h"
>    
>   /* don't use X11 function prototypes (which tend to ...): */
> ! #define NeedFunctionPrototypes 1
>   #include <X11/X.h>
>   #include <X11/Xlib.h>
>   #include <X11/Xutil.h>

Then the rpm builds fine.

Someone who knows the code will need to confirm that this is an 
acceptable solution.


Chris Albert




More information about the R-help mailing list