This repository has been archived by the owner. It is now read-only.

Pango compilation fails in XQuartz vs. TK X11 (context: pkg_config, superenv path removal) #18635

Closed
joni-dodreams opened this Issue Mar 21, 2013 · 26 comments

Comments

Projects
None yet
6 participants

OS X 10.8.3
XCode 4.6.1 (also using the latest command line tools)
XQuartz 2.7.4

ls -l /usr/local/include/X11
/usr/local/include/X11 -> ../Cellar/tk/8.6.0/include/X11
brew install pango

--- snip ---

brew: superenv removed: -I/opt/X11/include -I/opt/X11/include -g -O2 -Wall
In file included from pangoxft-fontmap.c:31:
/opt/X11/include/X11/Xlibint.h:67:8: error: redefinition of '_XDisplay'
struct _XDisplay
       ^
/usr/local/include/X11/Xlib.h:441:16: note: previous definition is here
typedef struct _XDisplay {

--- snip ---

Has to do with the recent pkg_config behaviour changes [1] [2], the new TK version or is this a clear user error on my behalf?

[1] mxcl#18198
[2] mxcl#18581

Contributor

samueljohn commented Mar 21, 2013

Where does /usr/local/include/X11/Xlib.h come from?
ls -la /usr/local/include/X11/Xlib.h ?

Contributor

samueljohn commented Mar 21, 2013

Reproduced. I get the same err.

Contributor

samueljohn commented Mar 21, 2013

does brew install pango --without-x work for you? For me it does. I don't know what the X11 errors are exactly.
Is without x11 ok for you?

Contributor

jacknagel commented Mar 21, 2013

The X11 headers in /usr/local/include are definitely the problem.

Contributor

adamv commented Mar 21, 2013

New brew doctor check?

ls -la /usr/local/include/X11
lrwxr-xr-x  1 rotonen  admin  30 21 Maa 16:34 /usr/local/include/X11 -> ../Cellar/tk/8.6.0/include/X11
ls -la /usr/local/include/X11/
total 312
drwxr-xr-x  12 rotonen  admin    408 21 Maa 17:11 .
drwxr-xr-x  16 rotonen  admin    544 21 Maa 16:34 ..
-rw-r--r--   1 rotonen  admin  18589 21 Maa 16:34 X.h
lrwxr-xr-x   1 rotonen  admin     20 21 Maa 17:11 X11 -> /opt/X11/include/X11
-rw-r--r--   1 rotonen  admin   2518 21 Maa 16:34 Xatom.h
-rw-r--r--   1 rotonen  admin   1714 21 Maa 16:34 Xfuncproto.h
-rw-r--r--   1 rotonen  admin  40752 21 Maa 16:34 Xlib.h
-rw-r--r--   1 rotonen  admin  20202 21 Maa 16:34 Xutil.h
-rw-r--r--   1 rotonen  admin   1953 21 Maa 16:34 cursorfont.h
-rw-r--r--   1 rotonen  admin   1445 21 Maa 16:34 keysym.h
-rw-r--r--   1 rotonen  admin  52429 21 Maa 16:34 keysymdef.h
-rw-r--r--   1 rotonen  admin   2284 21 Maa 16:34 xbytes.h

Now here the plot thickens? include/X11/X11?

I am still not excluding a user error on my behalf here either. Most likely I've just tab-autocompleted a quick-fix attempt X11 symlink to appear under there. Unless anyone else can verify that, I suggest it is safe to assume so.

head -n 24 /usr/local/include/X11/Xlib.h
/* $XConsortium: Xlib.h,v 11.221 93/07/02 14:13:28 gildea Exp $ */
/*
 * Copyright 1985, 1986, 1987, 1991 by the Massachusetts Institute of Technology
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted, provided
 * that the above copyright notice appear in all copies and that both that
 * copyright notice and this permission notice appear in supporting
 * documentation, and that the name of M.I.T. not be used in advertising
 * or publicity pertaining to distribution of the software without specific,
 * written prior permission. M.I.T. makes no representations about the
 * suitability of this software for any purpose.  It is provided "as is"
 * without express or implied warranty.
 *
 * X Window System is a Trademark of MIT.
 *
 */


/*
 *  Xlib.h - Header definition and support file for the C subroutine
 *  interface library (Xlib) to the X Window System Protocol (V11).
 *  Structures and symbols starting with "_" are private to the library.
 */
brew doctor
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:

    brew install gtk+ jasper pango

Run `brew missing` for more details.
brew missing
jigdo: pango gtk+
libicns: jasper

Pango compiles and installs fine --without-x.

I need the X11 support in pango. The proposed workaround is a no-go in my use case.

Contributor

adamv commented Mar 21, 2013

What is TK X11?

ls -la /usr/local/Cellar/tk/8.6.0/include/X11
total 312
drwxr-xr-x  12 rotonen  admin    408 21 Maa 17:11 .
drwxr-xr-x  16 rotonen  admin    544 21 Maa 16:34 ..
-rw-r--r--   1 rotonen  admin  18589 21 Maa 16:34 X.h
lrwxr-xr-x   1 rotonen  admin     20 21 Maa 17:11 X11 -> /opt/X11/include/X11
-rw-r--r--   1 rotonen  admin   2518 21 Maa 16:34 Xatom.h
-rw-r--r--   1 rotonen  admin   1714 21 Maa 16:34 Xfuncproto.h
-rw-r--r--   1 rotonen  admin  40752 21 Maa 16:34 Xlib.h
-rw-r--r--   1 rotonen  admin  20202 21 Maa 16:34 Xutil.h
-rw-r--r--   1 rotonen  admin   1953 21 Maa 16:34 cursorfont.h
-rw-r--r--   1 rotonen  admin   1445 21 Maa 16:34 keysym.h
-rw-r--r--   1 rotonen  admin  52429 21 Maa 16:34 keysymdef.h
-rw-r--r--   1 rotonen  admin   2284 21 Maa 16:34 xbytes.h

Does TK ship with X11 headers these days, or what?

Also: the removal of my include/X11/X11 -> /opt/X11/include/X11 symlink did nothing for the build process: still fails as in original post. As far as I can see I have now excluded this particular user error from being the cause here.

Contributor

samueljohn commented Mar 21, 2013

Jack and me pulled and worked on Tk 8.6 in homebrew-dupes. Perhaps remove the
system "make install-private-headers" from the tk formula?
Definitely the $(brew --prefix)/include/X11 are coming from tk.

Contributor

samueljohn commented Mar 21, 2013

No, it's not the "make install-private-headers". I just tested that.
So well ... one option would be to make Tk keg_only. I dupes system stuff.
But I have to check if brew install python --with-brewed-tk still works.

Contributor

jacknagel commented Mar 21, 2013

Yeah, we should make the private headers optional at the very least, or make tcl and tk keg-only.

Contributor

jacknagel commented Mar 21, 2013

Ah, thanks for looking into it.

Contributor

samueljohn commented Mar 21, 2013

I am in favor of keg_only. I can't do right now. Tomorrow if that is ok.

workaorund right now: either brew install pango --without-x or brew unlink tk && brew install pango && brew link tk

Owner

MikeMcQuaid commented Mar 21, 2013

+1 for keg_only

Contributor

samueljohn commented Mar 21, 2013

brew uses tk does show nothing (probably because it's all depending on options.).
Resorting to grep.

Contributor

mbcoguno commented Mar 22, 2013

Wait, don't keg_only, this is enough:

diff --git a/tk.rb b/tk.rb
index d03a98f..578fb26 100644
--- a/tk.rb
+++ b/tk.rb
@@ -40,7 +40,7 @@ class Tk < Formula

     # Awww tk, don't install (outdated) X11 headers!
     # (See http://trac.macports.org/ticket/8730)
-    if build.include? "enable-aqua"
+    unless build.with? "x11"
       rm_rf(include/'X11')
     end
   end
Contributor

samueljohn commented Mar 22, 2013

I can revert it. Python seems the only formula that depends on tk.
But just deleting the X11 stuff might also not be the best idea...

Turns out that even if tk is keg_only Python don't want to build --with-brewed-tk.

Contributor

samueljohn commented Mar 22, 2013

If I remove my X11 and remove the include/X11 from Tk, I get:

/usr/local/opt/tk/include/tk.h:71:13: fatal error: 'X11/Xlib.h' file not found
#   include <X11/Xlib.h>

So we should not remove the X11 dir from Tk - it seems needed even for AquaTk (native OS X GUI)

Contributor

mbcoguno commented Mar 22, 2013

OK, I know. Can you delete useless section?

And, is keg_only unless build.with? "x11" good? Caveats says no even though --with-x11 doesn't ships the X11 header.

Contributor

samueljohn commented Mar 22, 2013

Yes of course, thanks for spotting @mbcoguno.

I am trying to get python to build with the Tk now. Problem seems the ld: library not found for -lX11 part. I don't yet know where this comes from. The setup.py does not seem to add it.

Owner

MikeMcQuaid commented Mar 22, 2013

If it's a system dupe it should be keg-only anyway.

Contributor

samueljohn commented Mar 22, 2013

Any idea where Python got -lX11 from. I basically removed all occurrences from it's sources. But still. I doesn't come from tk's pkg-config. So I am puzzled where that came from...

Can't find it. Won't have much time before the weekend begins (where I won't have much time)

Contributor

samueljohn commented Mar 22, 2013

#18657 is the issue for Python not building with brewed tk.

Contributor

samueljohn commented Mar 22, 2013

tk should be keg_only. Might want to try if pango builds?

Contributor

jacknagel commented Mar 25, 2013

Assuming fixed.

@jacknagel jacknagel closed this Mar 25, 2013

@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.