macOS build fails without XQuartz (fig2dev 3.2.6a)
Xfig is a diagramming tool
Brought to you by:
tklxfiguser
fig2dev 3.2.6a
macOS: 10.11.6-x86_64
Xcode: 8.2.1
If XQuartz is not installed on macOS, the build fails even if I pass both --without-x and --without-xpm.
The error is
clang -DHAVE_CONFIG_H -I. -I../.. -I../../fig2dev -DBITMAPDIR=\"/usr/local/Cellar/fig2dev/3.2.6a/share/fig2dev/bitmaps\" -DI18N_DATADIR=\"/usr/local/Cellar/fig2dev/3.2.6a/share/fig2dev/i18n\" -Wno-parentheses -g -O2 -c -o genps.o genps.c
genps.c:138:3: error: unknown type name 'XpmColor'
XpmColor *coltabl, int ncols);
^
1 error generated.
make[2]: *** [genps.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
Full log: https://gist.github.com/ilovezfs/ffe846b38341c296604ba16d788f7020
I can fix this failure with the following change:
--- a/fig2dev/dev/genps.c
+++ b/fig2dev/dev/genps.c
@@ -134,8 +134,10 @@ static bool iso_text_exist(F_compound *ob);
static bool ellipse_exist(F_compound *ob);
static bool approx_spline_exist(F_compound *ob);
static void draw_gridline(float x1, float y1, float x2, float y2);
+#ifdef HAVE_X11_XPM_H
static void convert_xpm_colors(unsigned char cmap[3][MAXCOLORMAPSIZE],
XpmColor *coltabl, int ncols);
+#endif
static void genps_itp_spline(F_spline *s);
static void genps_ctl_spline(F_spline *s);
The build then fails later on with this error:
clang -DHAVE_CONFIG_H -I. -I../.. -I../../fig2dev -DBITMAPDIR=\"/usr/local/Cellar/fig2dev/3.2.6a/share/fig2dev/bitmaps\" -DI18N_DATADIR=\"/usr/local/Cellar/fig2dev/3.2.6a/share/fig2dev/i18n\" -Wno-parentheses -g -O2 -c -o gensvg.o gensvg.c
gensvg.c:441:5: error: unknown type name 'time_t'; did you mean 'size_t'?
time_t when;
^~~~~~
size_t
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/sys/_types/_size_t.h:30:32: note: 'size_t' declared here
typedef __darwin_size_t size_t;
^
1 error generated.
make[2]: *** [gensvg.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
Full log: https://gist.github.com/ilovezfs/a4833ad3a0beb6d3a3f635846876ee1b
I can fix this failure with the following change:
--- a/fig2dev/dev/gensvg.c
+++ b/fig2dev/dev/gensvg.c
@@ -243,6 +243,7 @@
#include <strings.h>
#include <math.h>
//#include <ctype.h>
+#include <time.h>
#include "bool.h"
#include "pi.h"
The combined patch is here: https://gist.github.com/ilovezfs/94c715677f6fc29a9ff14754b2ed6f08
Thanks for your report, and the patches. Both issues will be fixed in the next release.