ghostscript errors and fix #14564

Closed
silasb opened this Issue Aug 30, 2012 · 15 comments

4 participants

@silasb

I keep getting can't find X11/Xlib.h but above the error I am seeing -I/usr/X11/include.

Error is below.

SNIP

cc  -DHAVE_MKSTEMP   -DHAVE_FONTCONFIG  -DHAVE_SETLOCALE -DHAVE_SSE2  -DHAVE_BSWAP32  -DHAVE_STRERROR -O2 -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DGX_COLOR_INDEX_TYPE="unsigned long int"  -I/Users/silas/opt/Cellar/libtiff/4.0.2/include      -I./obj -I./base  -DWHICH_CMS="lcms2" -I/usr/X11/include -o ./obj/gdevx.o -c ./base/gdevx.c
In file included from ./base/gdevx.c:21:
./base/x_.h:131:12: fatal error: 'X11/Xlib.h' file not found
#  include <X11/Xlib.h>
       ^
1 error generated.
make: *** [obj/gdevx.o] Error 1

SNIP

My brew --config and brew doctor is here:

https://gist.github.com/3533685

After talking with mistym on IRC, she proposed to use --env=std and it compiled and runs fine now.

This might also help: http://sourceforge.net/mailarchive/message.php?msg_id=29634591

@2bits

From what you posted, it is searching this X11 directory: -I/usr/X11/include
What do you get for

ls -ld /usr/X11
ls -lA /usr/X11/include/
@silasb
oxy:cgi-bin silas$ ls -ld /usr/X11
lrwxr-xr-x  1 root  wheel  8 Aug 30 11:42 /usr/X11 -> /opt/X11

oxy:cgi-bin silas$ ls -lA /usr/X11/include/
total 96
drwxr-xr-x   23 root   wheel    782 Aug 27 13:27 GL
drwxr-xr-x    6 root   wheel    204 Aug 27 13:22 VG
drwxr-xr-x   88 root   wheel   2992 Aug 27 13:53 X11
-r--r--r--    1 root   wheel  25545 Aug 27 12:55 Xplugin.h
drwxr-xr-x   17 root   wheel    578 Aug 27 13:25 cairo
drwxr-xr-x    5 root   wheel    170 Aug 27 12:58 fontconfig
drwxr-xr-x    3 root   wheel    102 Aug 27 12:58 freetype2
-rw-r--r--    1 root   wheel   3890 Aug 27 12:58 ft2build.h
drwxr-xr-x    5 root   wheel    170 Aug 27 13:06 libpng15
drwxr-xr-x    4 root   wheel    136 Aug 27 13:07 pixman-1
lrwxr-xr-x    1 silas  wheel     14 Aug 29 10:27 png.h -> libpng15/png.h
lrwxr-xr-x    1 silas  wheel     18 Aug 29 10:27 pngconf.h -> libpng15/pngconf.h
lrwxr-xr-x    1 silas  wheel     21 Aug 29 10:27 pnglibconf.h -> libpng15/pnglibconf.h
drwxr-xr-x   42 root   wheel   1428 Aug 27 13:10 xcb
drwxr-xr-x  160 root   wheel   5440 Aug 27 13:34 xorg
-rw-r--r--    1 root   wheel    518 Aug 27 13:25 xpyb.h
@2bits

Try brew install --env=std gs and tell us how it goes.

@silasb
@2bits

I guess it just needs a depends_on :x11 because of superenv, but it makes my brain hurt:

depends_on :libpng
depends_on :x11

No likey

@silasb

Previously there was a version that didn't depend on X. Is it possible to get this functionality back?

This probably belongs in another bug report.

@mistydemeo

It has a marked dependency on :libpng, not :x11, which is the source of the bug. From the formula:

ENV['LIBS'] = "-L#{MacOS::X11.lib}" if MacOS::X11.installed?

@mxcl points out here that

superenv is strict about that: forcibly removing X11 paths from the actual cc instantiations unless the formula depends on X11.

So the issue is that we've provided X11 libs to LIBS because X11 was found to be installed, but the X11 include paths have been removed elsewhere due to X11 not being specifically requested.

@mxcl
Homebrew member

That LIB line is not the problem, the problem is some aspect of ghostscript depends on X11 and we need to identify it and make it optional or add depends_on :x11 to the formula.

@2bits

It works if I leave it with only depends_on :libpng and I comment out the ENV['LIBS'] line and I add --without-x. It should of course be tested, but at least it compiles.

@2bits 2bits added a commit to 2bits/homebrew that referenced this issue Aug 31, 2012
@2bits 2bits ghostscript: add `--without-x`
gs-9.06 is designed to build with only `:libpng` these days, but it
fails to compile with superenv unless we specify that we don't
want to build with X11.

* Remove the `ENV['LIBS'] = some/X11/path`
* Add `--without-x` to fix a build error.

Fixes #14564
f28f1ba
@2bits

That should fix it. I uploaded a PR.

@mistydemeo mistydemeo added a commit that closed this issue Aug 31, 2012
@2bits 2bits ghostscript: add `--without-x`
gs-9.06 is designed to build with only `:libpng` these days, but it
fails to compile with superenv unless we specify that we don't
want to build with X11.

* Remove the `ENV['LIBS'] = some/X11/path`
* Add `--without-x` to fix a build error.

Fixes #14564

Closes #14596.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
3e084bf
@mistydemeo

Fix pulled.

@mxcl
Homebrew member

I managed to just install Ghostscript on 10.8.1, 4.4.1 CLT-only without XQuartz installed, no errors. Update: without the latest fix applied.

@mistydemeo

@mxcl Right - the issue actually came up when XQuartz was installed.

@mxcl
Homebrew member

OIC. Sorry.

@ckdaas ckdaas added a commit that referenced this issue Sep 10, 2012
@2bits 2bits ghostscript: add `--without-x`
gs-9.06 is designed to build with only `:libpng` these days, but it
fails to compile with superenv unless we specify that we don't
want to build with X11.

* Remove the `ENV['LIBS'] = some/X11/path`
* Add `--without-x` to fix a build error.

Fixes #14564

Closes #14596.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
181a590
@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Sep 12, 2012
@2bits 2bits ghostscript: add `--without-x`
gs-9.06 is designed to build with only `:libpng` these days, but it
fails to compile with superenv unless we specify that we don't
want to build with X11.

* Remove the `ENV['LIBS'] = some/X11/path`
* Add `--without-x` to fix a build error.

Fixes #14564

Closes #14596.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
07bcb46
@shazron shazron added a commit that referenced this issue Sep 13, 2012
@2bits 2bits ghostscript: add `--without-x`
gs-9.06 is designed to build with only `:libpng` these days, but it
fails to compile with superenv unless we specify that we don't
want to build with X11.

* Remove the `ENV['LIBS'] = some/X11/path`
* Add `--without-x` to fix a build error.

Fixes #14564

Closes #14596.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
c07fdc1
@halloleo halloleo added a commit that referenced this issue Sep 14, 2012
@2bits 2bits ghostscript: add `--without-x`
gs-9.06 is designed to build with only `:libpng` these days, but it
fails to compile with superenv unless we specify that we don't
want to build with X11.

* Remove the `ENV['LIBS'] = some/X11/path`
* Add `--without-x` to fix a build error.

Fixes #14564

Closes #14596.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
e4f8310
@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
@2bits 2bits ghostscript: add `--without-x`
gs-9.06 is designed to build with only `:libpng` these days, but it
fails to compile with superenv unless we specify that we don't
want to build with X11.

* Remove the `ENV['LIBS'] = some/X11/path`
* Add `--without-x` to fix a build error.

Fixes #14564

Closes #14596.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
94df065
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.