Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#17558 closed defect (fixed)

connection errors when macports libs are used with Tiger X11 headers

Reported by: vinc17@… Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: High Milestone:
Component: ports Version: 1.6.0
Keywords: crash Cc: david@…, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), ryandesign (Ryan Carsten Schmidt), dbevans (David B. Evans), garribald@…, jjstickel@…, pgijnxn02@…, rowue@…, steeve.earl@…
Port: xorg

Description

With the latest xorg-related ports, I get the following error with Liferea:

prunille:~> liferea
_X11TransSocketUNIXConnect: Cannot connect to non-local host ???D
XIO:  fatal IO error 0 (Unknown error: 0) on X server ":0.0"
      after 9 requests (8 known processed) with 0 events remaining.
zsh: exit 1     liferea

No problem when these ports are not installed.

Attachments (1)

macports-17558-test.diff (7.3 KB) - added by david@… 15 years ago.
Patch against ports tree according to comment 46.

Download all attachments as: .zip

Change History (55)

comment:1 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Status: newassigned

What is the output of :

otool -L which liferea echo $DISPLAY ps x | grep X11

comment:2 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

otool -L `which liferea`
echo $DISPLAY
ps x | grep X11 

comment:3 Changed 15 years ago by vinc17@…

I've tried to rebuild everything, but got the following error:

prunille:~> sudo port -v upgrade xrender
[...]
xinstall: README -> /opt/local/var/macports/build/_Users_vinc17_software_dports_x11_xrender/work/destroot/opt/local/share/doc/xrender-0.9.4/README
--->  Deactivating xrender 0.9.0_3
Error: The following dependencies failed to build: xorg-libX11

I don't know what's going on since xorg-libX11 is already installed:

prunille:~> port installed xorg-libX11
The following ports are currently installed:
  xorg-libX11 @1.1.5_1 (active)

comment:4 Changed 15 years ago by vinc17@…

Then I did:

prunille:~> sudo port -v upgrade xrender
--->  Activating xrender 0.9.0_3
--->  Deactivating xrender 0.9.0_3
--->  Installing xrender 0.9.4_1+darwin_8+macosx
--->  Activating xrender 0.9.4_1+darwin_8+macosx
--->  Cleaning xrender
--->  Removing build directory for xrender

Now, I get the same error as before:

prunille:~> liferea
XIO:  fatal IO error 9 (Bad file descriptor) on X server ":0.0"
      after 74 requests (73 known processed) with 16 events remaining.

Without rebuilding Liferea:

prunille:~> otool -L =liferea-bin
/opt/local/bin/liferea-bin:
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 18.0.0)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
	/opt/local/lib/libgconf-2.4.dylib (compatibility version 6.0.0, current version 6.5.0)
	/opt/local/lib/libORBit-2.0.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 369.8.0)
	/opt/local/lib/libgthread-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.24.0)
	/opt/local/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0)
	/opt/local/lib/libglade-2.0.0.dylib (compatibility version 1.0.0, current version 1.7.0)
	/opt/local/lib/libgtk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
	/opt/local/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.2.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.11)
	/opt/local/lib/libgdk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
	/opt/local/lib/libatk-1.0.0.dylib (compatibility version 2410.0.0, current version 2410.1.0)
	/opt/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
	/opt/local/lib/libgio-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libtiff.3.dylib (compatibility version 12.0.0, current version 12.2.0)
	/opt/local/lib/libjasper.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/opt/local/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
	/opt/local/lib/libpangocairo-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
	/opt/local/lib/libcairo.2.dylib (compatibility version 10803.0.0, current version 10803.4.0)
	/opt/local/lib/libpangoft2-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
	/opt/local/lib/libpixman-1.0.dylib (compatibility version 13.0.0, current version 13.0.0)
	/opt/local/lib/libpng12.0.dylib (compatibility version 34.0.0, current version 34.0.0)
	/opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libpango-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
	/opt/local/lib/libfontconfig.1.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
	/opt/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.18.0)
	/opt/local/lib/libgmodule-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/usr/X11R6/lib/libSM.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/usr/X11R6/lib/libICE.6.dylib (compatibility version 6.3.0, current version 6.3.0)
	/usr/X11R6/lib/libX11.6.dylib (compatibility version 6.2.0, current version 6.2.0)
	/opt/local/lib/libdbus-glib-1.2.dylib (compatibility version 4.0.0, current version 4.0.0)
	/opt/local/lib/libdbus-1.3.dylib (compatibility version 8.0.0, current version 8.0.0)
	/opt/local/lib/libgobject-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libglib-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libgnutls.26.dylib (compatibility version 38.0.0, current version 38.3.0)
	/opt/local/lib/libtasn1.3.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
	/opt/local/lib/libgcrypt.11.dylib (compatibility version 17.0.0, current version 17.1.0)
	/opt/local/lib/libgpg-error.0.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.2.0)
	/opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

After rebuilding Liferea:

prunille:~> otool -L work/liferea-1.4.22d/src/liferea-bin
work/liferea-1.4.22d/src/liferea-bin:
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 18.0.0)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 22.0.0)
	/opt/local/lib/libgconf-2.4.dylib (compatibility version 6.0.0, current version 6.5.0)
	/opt/local/lib/libORBit-2.0.dylib (compatibility version 2.0.0, current version 2.0.0)
	/usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 369.8.0)
	/opt/local/lib/libgthread-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.24.0)
	/opt/local/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0)
	/opt/local/lib/libglade-2.0.0.dylib (compatibility version 1.0.0, current version 1.7.0)
	/opt/local/lib/libgtk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
	/opt/local/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.2.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.11)
	/opt/local/lib/libgdk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
	/opt/local/lib/libatk-1.0.0.dylib (compatibility version 2410.0.0, current version 2410.1.0)
	/opt/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
	/opt/local/lib/libgio-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libtiff.3.dylib (compatibility version 12.0.0, current version 12.2.0)
	/opt/local/lib/libjasper.1.dylib (compatibility version 2.0.0, current version 2.0.0)
	/opt/local/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)
	/opt/local/lib/libpangocairo-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
	/opt/local/lib/libcairo.2.dylib (compatibility version 10803.0.0, current version 10803.4.0)
	/opt/local/lib/libpangoft2-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
	/opt/local/lib/libpixman-1.0.dylib (compatibility version 13.0.0, current version 13.0.0)
	/opt/local/lib/libpng12.0.dylib (compatibility version 34.0.0, current version 34.0.0)
	/opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libpango-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
	/opt/local/lib/libfontconfig.1.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
	/opt/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.18.0)
	/opt/local/lib/libgmodule-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/usr/X11R6/lib/libSM.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/usr/X11R6/lib/libICE.6.dylib (compatibility version 6.3.0, current version 6.3.0)
	/opt/local/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
	/opt/local/lib/libXau.6.dylib (compatibility version 7.0.0, current version 7.0.0)
	/opt/local/lib/libXdmcp.6.dylib (compatibility version 7.0.0, current version 7.0.0)
	/opt/local/lib/libdbus-glib-1.2.dylib (compatibility version 4.0.0, current version 4.0.0)
	/opt/local/lib/libdbus-1.3.dylib (compatibility version 8.0.0, current version 8.0.0)
	/opt/local/lib/libgobject-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libglib-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
	/opt/local/lib/libgnutls.26.dylib (compatibility version 38.0.0, current version 38.3.0)
	/opt/local/lib/libtasn1.3.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
	/opt/local/lib/libgcrypt.11.dylib (compatibility version 17.0.0, current version 17.1.0)
	/opt/local/lib/libgpg-error.0.dylib (compatibility version 5.0.0, current version 5.0.0)
	/opt/local/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.2.0)
	/opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)

prunille:~> echo $DISPLAY
:0.0
prunille:~> ps xw | grep X11
  341  ??  S      0:00.02 /Applications/Utilities/X11.app/Contents/MacOS/X11 -psn_0_1966081
  344  ??  S     19:01.40 /Applications/Utilities/X11.app/Contents/MacOS/X11 -nolisten tcp -psn_0_1966081 :0
 3672  p4  R+     0:00.00 grep X11

Perhaps the bug comes from something else. xrender?

comment:5 Changed 15 years ago by vinc17@…

Hmm, if I deactivate xrender @0.9.4_1+darwin_8+macosx and reactivate xrender @0.9.0_3, I no longer get the error (I think this didn't work when I reported the bug, but there might have been another problem). So, this seems to be a problem in xrender.

comment:6 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I think this is because your xrender @0.9.4_1 is linking against /opt/local/lib/libX11.dylib and the application is linking against /usr/X11/lib/libX11.dylib.

What is the output of:

otool -L /opt/local/var/macports/software/xrender/*/opt/local/lib/libXrender.dylib 

Is this on Tiger?

I've only tested on Leopard. I'm putting together a Tiger box now to test this problem...

comment:7 in reply to:  6 Changed 15 years ago by vinc17@…

Replying to jeremyhu@…:

I think this is because your xrender @0.9.4_1 is linking against /opt/local/lib/libX11.dylib and the application is linking against /usr/X11/lib/libX11.dylib.

No, when I rebuilt Liferea so that it linked against /opt/local/lib/libX11.dylib (see work/liferea-1.4.22d/src/liferea-bin above), I got the same error. But the other libraries (as Liferea is a GTK-based application) are still linked against /usr/X11R6/lib/libX11.6.dylib, e.g.

prunille:~> otool -L /opt/local/lib/libgtk-x11-2.0.0.dylib | grep libX11
        /usr/X11R6/lib/libX11.6.dylib (compatibility version 6.2.0, current version 6.2.0)

Could this be the problem?

What is the output of:

otool -L /opt/local/var/macports/software/xrender/*/opt/local/lib/libXrender.dylib 
/opt/local/var/macports/software/xrender/0.9.0_3/opt/local/lib/libXrender.dylib:
        /opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
        /usr/X11R6/lib/libX11.6.dylib (compatibility version 6.2.0, current version 6.2.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.11)
/opt/local/var/macports/software/xrender/0.9.4_1+darwin_8+macosx/opt/local/lib/libXrender.dylib:
        /opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
        /opt/local/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
        /opt/local/lib/libXau.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /opt/local/lib/libXdmcp.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.11)

Is this on Tiger?

Yes.

comment:8 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Cc: mcalhoun@… ryandesign@… devans@… added

comment:9 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I think there's maybe some symbol clash or something betweek /usr/X11R6/lib/libX11.1.dylib and /opt/local/lib/libX11.1.dylib... but I don't see why it should fail here...

I'm close to getting a Tiger box setup, so I should be able to test this soon. Unfortunately boost is failing to build, so I can't make gimp, but I'll give it a test with some test cases...

comment:11 Changed 15 years ago by dbevans (David B. Evans)

I spent some time getting my Tiger machine to work with gimp, etc this weekend. The solution, I found was to revert xrender to version 9.0 and render to a comparable revision and build with xorg-libX11 deactivated (so it builds with libX11 in /usr/X11R6/lib). Having done this, gimp for instance worked once again with no recompiling. Again this is using the Apple X11.app that comes with Tiger. I think this is consistent with the type of code change that you cite above. That is, I suspect the difference is in the headers in render 0.9 vs xorg-renderproto 0.9.3.

Please note that this is not a gimp specific thing -- the problem can be demonstrated any app that uses xrender (anything that uses the gtk X11 API or just the X11 backends to pango and/or cairo). A simpler test case for instance is gconf-editor.

Let me know if you need help testing anything.

By the way, boost has just been upgraded to 1.37.0 and I have been able to build it without problems on tiger ppc.

comment:12 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

My hunch is that xorg-libX11 is building with the xtrans in /usr/X11 rather than ${prefix}

Can someone test out this beep.c:

#include <X11/Xlib.h>

int main() {
    Display *dpy = XOpenDisplay(NULL);
    XBell(dpy, 100);
    XFlush(dpy);
    return 0;
}
gcc -o beep_system -L/usr/X11R6/lib -I/usr/X11/include beep.c -lX11
gcc -o beep_macports -L/opt/local/lib -I/opt/local/include beep.c -lX11

I assume the 'beep_macports' will fail.

Next, uninstall xorg-libX11, then mv /usr/X11R6/include /usr/X11R6/include.bak, then reinstall xorg-libX11

If my assumption is right, beep_macports will now work...

comment:13 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Actually, I was able to just try that, and it works fine... the beep.c works with the macports libX11, so I don't know why the connection is failing for you... =/

comment:14 Changed 15 years ago by dbevans (David B. Evans)

Yes, both work for me as well. So it's not libX11 -- its libXrender. I'll see if I can make a simple GTK program that shows the difference after dinner tonight.

comment:15 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Port: xrender added; xorg-libX11 removed

Well gtk-demo fails...

I wonder if there's something lower level than gtk2...

This is a bizarre message... with the "non-local host <garbled>" ...

comment:16 Changed 15 years ago by dbevans (David B. Evans)

OK, that's a good one. The underlying interfaces to gtk2 are pango for rendering fonts (either directly via X11 or through cairo) and cairo for graphics rendering. Should be able to do this with one of the cairo demos from www.cairographics.org.

Now if you want to make it work, build a new xrender 0.90_2 say (checkout xrender and render from svn at r38087) and build with xorg-libX11 deactivated. Then deactivate your current xrender and activate this one. gtk-demo should now work (I think).

comment:17 Changed 15 years ago by garribald@…

Cc: garribald@… added

Cc Me!

comment:18 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Ok, so this is annoying...

I just pushed r43377 ... When I build gtk2 with no xorg-* activated, gtk-demo works as expected.

If I then uninstall xrender, install xorg-libX11, then install xrender, I get the bad behavior =/

comment:19 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Further, I got rid of /usr/X11R6 and built gtk using entirely macports xorg-* libs, and gtk-demo works...

So this error results from mixing macports and Tiger X11 libs

comment:20 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Port: gtk2 added; xrender removed
Summary: _X11TransSocketUNIXConnect: Cannot connect to non-local host ???Dconnection errors when both macports and system libs (of the same name) are linked into the same executable

Further, All I need to do to trigger this from "working with all macports libs" to breaking is uninstall gtk2, restore /usr/X11R6, and recompile gtk2... so I think we need to get gtk2 (and probably any other X11 related port) to "prefer" the macports libraries over the system ones if they're available... ugg...

comment:21 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Summary: connection errors when both macports and system libs (of the same name) are linked into the same executableconnection errors when macports libs are used with Tiger X11 headers

A little more... I think the problem isn't the libs... it's the /usr/X11R6/include headers... if I move that directory out of the way (thus forcing the use of the macports headers), gtk-demo works...

this is ugly...

comment:22 Changed 15 years ago by jmroot (Joshua Root)

The problem may be that gtk2 (and others) has:

configure.args-append       --x-includes=${x11prefix}/include \
                                --x-libraries=${x11prefix}/lib

So it's going to be preferring the /usr/X11R6 bits on Tiger. I think those configure args are safe to remove now that (a) pkgconfig looks in x11prefix, and (b) we have working xorg ports for Tiger.

comment:23 Changed 15 years ago by cjdeloye@…

I have been having the same X11 error when trying to get gtk2 working on a i386 running OS X 10.4.11. I went through the suggestions above to no avail. However, I did check the libraries which gtk-demo was trying to use:

otool -L `which gtk-demo`
/opt/local/bin/gtk-demo:
        /opt/local/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
        /opt/local/lib/libgdk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
        /opt/local/lib/libgtk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.4.0)
        /usr/X11R6/lib/libXi.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        /usr/X11R6/lib/libXinerama.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/X11R6/lib/libXext.6.dylib (compatibility version 6.4.0, current version 6.4.0)
        /usr/X11R6/lib/libXcursor.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /opt/local/lib/libpangocairo-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
        /opt/local/lib/libatk-1.0.0.dylib (compatibility version 2410.0.0, current version 2410.1.0)
        /opt/local/lib/libcairo.2.dylib (compatibility version 10803.0.0, current version 10803.4.0)
        /opt/local/lib/libpixman-1.0.dylib (compatibility version 13.0.0, current version 13.0.0)
        /opt/local/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
        /opt/local/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
        /opt/local/lib/libXau.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /opt/local/lib/libXdmcp.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /opt/local/lib/libgio-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
        /opt/local/lib/libpangoft2-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
        /opt/local/lib/libpango-1.0.0.dylib (compatibility version 2204.0.0, current version 2204.0.0)
        /opt/local/lib/libfontconfig.1.dylib (compatibility version 5.0.0, current version 5.0.0)
        /opt/local/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
        /opt/local/lib/libfreetype.6.dylib (compatibility version 10.0.0, current version 10.18.0)
        /opt/local/lib/libgobject-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
        /opt/local/lib/libgmodule-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
        /opt/local/lib/libglib-2.0.0.dylib (compatibility version 1801.0.0, current version 1801.3.0)
        /opt/local/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.2.0)
        /opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /opt/local/lib/libtiff.3.dylib (compatibility version 12.0.0, current version 12.2.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.10)
        /opt/local/lib/libpng12.0.dylib (compatibility version 34.0.0, current version 34.0.0)
        /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
        /opt/local/lib/libjasper.1.dylib (compatibility version 2.0.0, current version 2.0.0)
        /opt/local/lib/libjpeg.62.dylib (compatibility version 63.0.0, current version 63.0.0)

From this, there are apparently several X11 dependencies of gtk2 satisfied by /usr/X11R6 branch libraries.

I uninstalled gtk2, installed the corresponding xorg library ports, and then reinstalled gtk2. This seems to have solved the problem; gtk-demo ran normally afterwards.

comment:24 in reply to:  22 ; Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jmr@…:

The problem may be that gtk2 (and others) has: configure.args-append --x-includes=${x11prefix}/include

--x-libraries=${x11prefix}/lib

So it's going to be preferring the /usr/X11R6 bits on Tiger. I think those configure args are safe to remove now that (a) pkgconfig looks in x11prefix, and (b) we have working xorg ports for Tiger.

But there were tickets that specifically requested --x-includes and --x-libraries be added to several ports, e.g. #15569.

comment:25 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Yeah, those tickets requesting those resulted from our punting imake from Xquartz. I pushed a fix for gtk2 which addresses this n gtk2, but we have a lingering issue from pango still as well that I'm looking at.

comment:26 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: assignedclosed

Ok, I updated cairo, pango, and gtk2.

Most of those '--x-includes --x-libraries' bugs are related to the removal of xmkmf from Xquartz and the broken autoconf X11 detection macros. I think the real fix for those ports will be using autoreconf with the updated macros rather than this --x-includes --x-libraries stuff. I've tested gtk2 using 'gtk-demo' with macports X11 ports as well as Tiger-X11 SDK.

There may still be issues at the level of individual apps. I'll go through and review all the ports that are using '--x-includes' as I audit the x11 category.

comment:27 in reply to:  26 Changed 15 years ago by vinc17@…

Replying to jeremyhu@…:

There may still be issues at the level of individual apps.

I still get the same error after rebuilding Liferea. I don't understand what should be done.

Hmm... gtk2 still links against /usr/X11R6 libraries:

prunille:~> otool -L /opt/local/lib/libgtk-x11-2.0.0.dylib | grep /usr/X11R6
        /usr/X11R6/lib/libXi.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        /usr/X11R6/lib/libXinerama.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/X11R6/lib/libXext.6.dylib (compatibility version 6.4.0, current version 6.4.0)
        /usr/X11R6/lib/libXcursor.1.dylib (compatibility version 1.0.0, current version 1.0.0)

comment:28 Changed 15 years ago by kurtjaeke@…

This is still not resolved: gimp refuses to start with the error message mentioned above, as does gtk-demo. Please give elaborate, in detail instructions on how to fix this: what other non-macports packages need to be installed, etc.

comment:29 Changed 15 years ago by kurtjaeke@…

Please reopen.

comment:30 Changed 15 years ago by vinc17@…

Resolution: fixed
Status: closedreopened

Reopened since xrender still depends on xorg packages:

$ port info xrender
Warning: Found 2 port xrender definitions, displaying first one.
xrender @0.9.4, Revision 3 (x11)
Variants:    macosx, universal

X Render Extension library
Homepage:    http://www.x.org/

Build Dependencies:   pkgconfig, xorg-renderproto
Library Dependencies: xorg-libX11
Platforms:            darwin
Maintainers:          jeremyhu@macports.org openmaintainer@macports.org

I couldn't try to rebuild everything since this is blocked by bug 17662.

comment:31 Changed 15 years ago by jjstickel@…

I, too, am experiencing this problem on OS X 10.4.11. Until this gets resolved "correctly", is there a recommended workaround? How about installing all of xorg from macports?

comment:32 Changed 15 years ago by jjstickel@…

Cc: jjstickel@… added

Cc Me!

comment:33 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

The recommended fix for now is to remove all the xorg-* ports from macports

Here's a "dirty" way to do it... I'm sure there's probably a cooler way to do it that I haven't figured out yet...

port installed | grep xorg | sed 's:(active)::' | xargs sudo port -v -f uninstall

Also, I recommend that you don't use xrender and just use Tiger's libXrender:

sudo port -v -f uninstall xrender

Then just rebuild everything that isn't linked:

hasq() {
        [[ " ${*:2} " == *" $1 "* ]]
}

for f in $(find /opt/local/var/macports/software/*/*/opt/local/{bin,lib} -type f) ; do
        for l in $(otool -L $f | awk '{print $1}' | grep -v ':' | grep '/opt/local') ; do
                if [[ ! -e $l ]] || hasq $(basename $l) ${FAKES} ; then
                        echo $(echo $f | cut -d/ -f7) $(basename $f) needs $(basename $l)
                fi
        done
done

From that list, do a 'sudo port -v -f uninstall <the port>' then install it again...

comment:34 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Port: xorg added; gtk2 removed

comment:35 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

oh... the FAKES envvar there was something that I used to filter out libs that were coming up false-positives (like ones that are relatively linked)...

comment:36 in reply to:  31 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Replying to jjstickel@…:

I, too, am experiencing this problem on OS X 10.4.11. Until this gets resolved "correctly", is there a recommended workaround? How about installing all of xorg from macports?

That is yet another possibility, but if you do that, you'll then need to rebuild everything that is linking against /usr/X11R6/lib/* so it links against the macports libs instead...

I'm testing out a rather dirty bash script that will go through /opt/local/bin and /opt/local/lib and do install_name_tool on the binaries there to make them all use the available macports X11 libs... but it's quite hackish at the moment. I'll post it here after doing some more testing...

comment:37 in reply to:  33 Changed 15 years ago by jjstickel@…

Replying to jeremyhu@…:

The recommended fix for now is to remove all the xorg-* ports from macports

<snip>

From that list, do a 'sudo port -v -f uninstall <the port>' then install it again...

OK, I have removed (actually deactivated now just in case) all of the xorg-* ports and am attempting to reinstall the ports that linked to the previously installed xorg libs. But how do I get around explicit xorg dependencies, e.g. in gtk2, so that I do not have a repeat of the problem?

comment:38 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

What explicit xorg dependency are you seeing in gtk2?

comment:39 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

This bash script should hopefully help. It's very hackish, but it goes through all your macports binaries and libs and forces them to use the macports provided lib instead of the system lib for all installed X11 libraries...

#!/bin/bash

x11prefix=/usr/X11R6
[[ -d /usr/X11 ]] && x11prefix=/usr/X11

prefix=/opt/local

if [[ ! -x ${prefix}/bin/gsed ]] ; then
	echo "This tool needs the gsed port to be installed" >&2
	exit 1
fi

cmdline=""

for f in ${x11prefix}/lib/*.dylib ; do
	[[ -f ${prefix}/lib/$(basename ${f}) ]] && cmdline="${cmdline} -change ${f} ${prefix}/lib/$(basename ${f})"
done

if [[ -z "${cmdline}" ]] ; then
	echo "Could not find any macports X11 libraries" >&2
	exit 1
fi

for f in ${prefix}/bin/* ${prefix}/lib/lib*.dylib ; do
	echo ${f}
	install_name_tool ${cmdline} ${f} >& /dev/null
done

${prefix}/bin/pkg-config --libs xrender | grep -q ${x11prefix}/lib/libX11.dylib && echo "You need to uninstall and reinstall the xrender port"

echo  "This tool does not update libtool archives, so your .la files might be incorrect."

comment:40 Changed 15 years ago by pgijnxn02@…

Cc: pgijnxn02@… added

Cc Me!

comment:41 in reply to:  38 Changed 15 years ago by jjstickel@…

Replying to jeremyhu@…:

What explicit xorg dependency are you seeing in gtk2?

Apparently the problem (for me) is the dependency "lib:libXfixes.3:xorg-libXfixes". It seems that my Apple X11 install does not have a libXfixes library, and so this pulled in all kinds of xorg ports including xorg-libX11. By removing this dependency from the gtk2 Portfile, uninstalling all xorg ports, xrender, gtk2, and dependencies, and reinstalling gtk2 seems to have resolved most of my problems. Unfortunately, kdebase3 is now broken for me and reinstalling has not fixed it. I am not sure if this is related or not.

comment:42 Changed 15 years ago by rowue@…

Cc: rowue@… added

Cc Me!

comment:43 in reply to:  24 Changed 15 years ago by david@…

Replying to ryandesign@…:

Replying to jmr@…:

The problem may be that gtk2 (and others) has: configure.args-append --x-includes=${x11prefix}/include

--x-libraries=${x11prefix}/lib

So it's going to be preferring the /usr/X11R6 bits on Tiger. I think those configure args are safe to remove now that (a) pkgconfig looks in x11prefix, and (b) we have working xorg ports for Tiger.

But there were tickets that specifically requested --x-includes and --x-libraries be added to several ports, e.g. #15569.

I'm the one who requested --x-includes and --x-libraries in #15569. For what it's worth, removing them breaks cairo, pango, and gtk2 for my purposes. I have to build universal libraries that are compatible with 10.4 and 10.5. That means that they must not be linked against the 10.5 X11 libraries in /usr/X11, because some of them like libXau are not in 10.4. (I'm running 10.5.)

From a checkout of r44619 I rebuilt a new environment from scratch. I installed py25-gtk, py25-py2app-devel, py25-sqlite, and py25-zlib and all their dependencies. The packages are linking against the libraries in /usr/X11. Here are excerpts from building gtk2:

checking for X... libraries /usr/X11/lib, headers
checking Pango flags... -I/opt/local-universal-10.4/include/pango-1.0 ... -L/usr/X11/lib -lpangocairo-1.0 -lcairo -lXrender -lSM -lICE -lX11 ...

The resulting libraries are linked against libXau:

/opt/local-universal-10.4/lib/libgtk-x11-2.0.dylib:
        /opt/local-universal-10.4/lib/libgtk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.5.0)
        /opt/local-universal-10.4/lib/libgdk_pixbuf-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.5.0)
        /opt/local-universal-10.4/lib/libgdk-x11-2.0.0.dylib (compatibility version 1401.0.0, current version 1401.5.0)
        /usr/X11/lib/libXi.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/X11/lib/libXinerama.1.dylib (compatibility version 2.0.0, current version 2.0.0)
        /usr/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
        ...
        /usr/X11/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
        /usr/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
        /usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
        /usr/X11/lib/libXau.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        /usr/X11/lib/libXdmcp.6.dylib (compatibility version 7.0.0, current version 7.0.0)
        ...
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0)
        ...
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 136.0.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

If I restore the --x-includes and --x-libraries then the dependency on libXau goes away. (My MacPorts is configured with x11prefix=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6 so only 10.4-compatible libraries are used.)

I agree that this would be better solved by having packages detect the correct location of X11 through Autoconf or whatever. This change is no big deal for me; until the packages are fixed I can just add --x-includes and --x-libraries back to my private patch.

comment:44 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

david: You should be able to accomplish what you want via:

+universal universal_sysroot /Developer/SDKs/MacOS10.4u.sdk x11prefix /usr/X11R6

comment:45 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

The main problem with the --x-include and --x-lib (and AC_X_PATH in general) is that it puts its CFLAGS before configure.cppflags ... thus it causes ${x11prefix}/include/blech.h to be used even when we have ${prefix}/include/blech.h already.

we might be able to solve this by doing:

configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
configure.cppflags-append -I${x11prefix}/include
configure.ldflags-append -L${x11prefix}/lib

Could you give that a try as well.

Aside from that, you may need to do this hack to trick xmkmf (I will celebrate the day AC_X_PATH is no longer used):

cd /Developer/SDKs/MacOSX10.4u.sdk/usr
sudo ln -s X11R6 X11

You should also do yourself a favor and nuke /usr/X11/bin/xmkmf and /usr/X11/bin/imake and 'port uninstall imake' as often as you can. Having it around might cause some ports to use it instead of pkgconfig to find X11 (although your situation is a bit unique because you want to force it to use an SDK's X11, I think that will be enough to trick it into doing what you want)

so in summary:

  • Make a symlink for /Developer/SDKs/MacOSX10.4u.sdk/usr/X11
  • x11prefix /usr/X11R6
  • universal_sysroot /Developer/SDKs/MacOS10.4u.sdk
  • +universal
  • Try changing your build order to only keep imake installed for the ports that explicitly depend on it.

Once we have the option of x11prefix=prefix fully realized (just need fonts to be added now).

comment:46 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Cc: david@… added

David, can you please let me know if that works for you? I think this should work well:

# This block helps us link correctly and setup our pc files correctly when we are
# +system_x11 and x11prefix is somewhere non-standard 
if { ![file exists ${prefix}/lib/pkgconfig/x11.pc] && ![file exists ${x11prefix}/lib/pkgconfig/x11.pc] } {
    # AC_X_PATH blindly asks xmkmf where X11 is, and it always uses /usr/X11R6.
    # These next three lines should cause AC_X_PATH to let us setup our CPPFLAGS
    # and LDFLAGS without interference
    configure.args-append --x-include=${prefix}/include --x-lib=${prefix}/lib
    configure.cppflags-append -I${x11prefix}/include
    configure.ldflags-append  -L${x11prefix}/lib
    
    # And this will similarly get ports that use pkgconfig to find our pkgconfig-less libX11
    post-destroot {
        foreach pc [glob ${destroot}${prefix}/lib/pkgconfig/*.pc] {
            reinplace "s:-lX11:-L${prefix}/lib -L${x11prefix}/lib -lX11:g" ${pc}
        }
    }
}

comment:47 in reply to:  45 ; Changed 15 years ago by david@…

Replying to jeremyhu@…:

so in summary:

  • Make a symlink for /Developer/SDKs/MacOSX10.4u.sdk/usr/X11
  • x11prefix /usr/X11R6
  • universal_sysroot /Developer/SDKs/MacOS10.4u.sdk
  • +universal
  • Try changing your build order to only keep imake installed for the ports that explicitly depend on it.

Thanks for the help. The steps above didn't work. I started with a fresh checkout of MacPorts r44970 configured this way:

./configure --prefix=/opt/local-test --with-tclpackage=/Library/Tcl/macports-test --with-universal-target=10.4 --with-universal-sysroot=/Developer/SDKs/MacOSX10.4u.sdk --with-x11-prefix=/usr/X11R6

I added +universal to /opt/local-test/etc/macports/variants.conf. In /Developer/SDKs/MacOSX10.4u.sdk I ran sudo ln -s X11R6 X11. Then

cd /usr/X11/bin
sudo mv xmkmf xmkmf.bak
sudo mv imake imake.bak

which xmkmf imake gives no results.

I configured the /opt/local-test installation to use the modified ports tree I use for building releases, except that I took out the --x-includes and --x-libraries stuff. I didn't want to complicate the test but without the patch cairo doesn't honor important universal flags like -isysroot and will link against the 10.5 SDK regardless. (To see the patch I used, run svn cat svn://svn.insecure.org/zenmap/install_scripts/macosx/macports-1.8.0-universal.diff@11598 and remove the --x-includes and --x-libraries bits.)

Finally I ran sudo /opt/local-test/bin/port -d install gtk2. (Actually I did this twice. The first time I forgot to patch cairo, so had to remove cairo and build again.) gtk2 quit in a failure I haven't seen before:

libtool: compile:  /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMA
IN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_DISABLE_CAST_CH
ECKS -D_REENTRANT -I/opt/local-test/include/glib-2.0 -I/opt/local-test/lib/glib-
2.0/include -I/opt/local-test/include -I/opt/local-test/include/pango-1.0 -I/opt
/local-test/include/cairo -I/opt/local-test/include/pixman-1 -I/opt/local-test/include/freetype2 -I/opt/local-test/include/libpng12 -I/usr/X11/include -I/opt/lo
cal-test/include -no-cpp-precomp -DX_LOCALE -isysroot /Developer/SDKs/MacOSX10.5
.sdk -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISA
BLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -I/usr/X11/include -DGDK_PIXBU
F_DISABLE_DEPRECATED -O2 -funroll-loops -fstrict-aliasing -isysroot /Developer/S
DKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c gdkev
ents-x11.c  -fno-common -DPIC -o .libs/gdkevents-x11.o
gdkevents-x11.c: In function 'gdk_event_translate':
gdkevents-x11.c:2110: error: 'RRNotify' undeclared (first use in this function)
gdkevents-x11.c:2110: error: (Each undeclared identifier is reported only once
gdkevents-x11.c:2110: error: for each function it appears in.)
...

But apart from that, cairo, pango, and gtk2 all link against the /usr/X11 libraries and libXau.dylib in particular. Here are excerpts from the build log:

--->  Configuring cairo
...
checking for X... libraries /usr/X11/lib, headers 
...
--->  Configuring pango
...
DEBUG: Environment: CFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' CPPFLAGS='-I/opt/local-test/include -no-cpp-precomp -isysroot /Developer/SDKs/MacOSX10.4u.sdk' CXXFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' MACOSX_DEPLOYMENT_TARGET='10.4' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2' LDFLAGS='-L/opt/local-test/lib -no-undefined -bind_at_load -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -arch ppc -arch i386 -mmacosx-version-min=10.4' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2' FFLAGS='-O2' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local-test/var/macports/build/_Users_david_macports-sources_ports.test_x11_pango/work/pango-1.22.4" && ./configure --prefix=/opt/local-test --enable-static --disable-dependency-tracking'
...

And otool verifies that they are linked with libXau.dylib.

I'll try your suggestion from comment 46. Am I supposed to put that code in the portfiles in place of --x-includes and --x-libraries?

comment:48 in reply to:  47 ; Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

I configured the /opt/local-test installation to use the modified ports tree I use for building releases, except that I took out the --x-includes and --x-libraries stuff. I didn't want to complicate the test but without the patch cairo doesn't honor important universal flags like -isysroot and will link against the 10.5 SDK regardless. (To see the patch I used, run svn cat svn://svn.insecure.org/zenmap/install_scripts/macosx/macports-1.8.0-universal.diff@11598 and remove the --x-includes and --x-libraries bits.)

Ok, but what's the login and pass that I should use?

Finally I ran sudo /opt/local-test/bin/port -d install gtk2. (Actually I did this twice. The first time I forgot to patch cairo, so had to remove cairo and build again.) gtk2 quit in a failure I haven't seen before:

libtool: compile:  /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMA
IN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_DISABLE_CAST_CH
ECKS -D_REENTRANT -I/opt/local-test/include/glib-2.0 -I/opt/local-test/lib/glib-
2.0/include -I/opt/local-test/include -I/opt/local-test/include/pango-1.0 -I/opt
/local-test/include/cairo -I/opt/local-test/include/pixman-1 -I/opt/local-test/include/freetype2 -I/opt/local-test/include/libpng12 -I/usr/X11/include -I/opt/lo
cal-test/include -no-cpp-precomp -DX_LOCALE -isysroot /Developer/SDKs/MacOSX10.5
.sdk -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISA
BLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -I/usr/X11/include -DGDK_PIXBU
F_DISABLE_DEPRECATED -O2 -funroll-loops -fstrict-aliasing -isysroot /Developer/S
DKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c gdkev
ents-x11.c  -fno-common -DPIC -o .libs/gdkevents-x11.o
gdkevents-x11.c: In function 'gdk_event_translate':
gdkevents-x11.c:2110: error: 'RRNotify' undeclared (first use in this function)
gdkevents-x11.c:2110: error: (Each undeclared identifier is reported only once
gdkevents-x11.c:2110: error: for each function it appears in.)
...

That's because the protocol headers in the 10.4u SDK are not as up to date as gtk needs. Maybe try installing xorg-randrproto first.

I'll try your suggestion from comment 46. Am I supposed to put that code in the portfiles in place of --x-includes and --x-libraries?

Yes.

comment:49 in reply to:  48 ; Changed 15 years ago by david@…

Replying to jeremyhu@…:

I configured the /opt/local-test installation to use the modified ports tree I use for building releases, except that I took out the --x-includes and --x-libraries stuff. I didn't want to complicate the test but without the patch cairo doesn't honor important universal flags like -isysroot and will link against the 10.5 SDK regardless. (To see the patch I used, run svn cat svn://svn.insecure.org/zenmap/install_scripts/macosx/macports-1.8.0-universal.diff@11598 and remove the --x-includes and --x-libraries bits.)

Ok, but what's the login and pass that I should use?

Sorry, I always forget that: --username guest --password "".

Finally I ran sudo /opt/local-test/bin/port -d install gtk2. (Actually I did this twice. The first time I forgot to patch cairo, so had to remove cairo and build again.) gtk2 quit in a failure I haven't seen before:

libtool: compile:  /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMA
IN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_DISABLE_CAST_CH
ECKS -D_REENTRANT -I/opt/local-test/include/glib-2.0 -I/opt/local-test/lib/glib-
2.0/include -I/opt/local-test/include -I/opt/local-test/include/pango-1.0 -I/opt
/local-test/include/cairo -I/opt/local-test/include/pixman-1 -I/opt/local-test/include/freetype2 -I/opt/local-test/include/libpng12 -I/usr/X11/include -I/opt/lo
cal-test/include -no-cpp-precomp -DX_LOCALE -isysroot /Developer/SDKs/MacOSX10.5
.sdk -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISA
BLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -I/usr/X11/include -DGDK_PIXBU
F_DISABLE_DEPRECATED -O2 -funroll-loops -fstrict-aliasing -isysroot /Developer/S
DKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c gdkev
ents-x11.c  -fno-common -DPIC -o .libs/gdkevents-x11.o
gdkevents-x11.c: In function 'gdk_event_translate':
gdkevents-x11.c:2110: error: 'RRNotify' undeclared (first use in this function)
gdkevents-x11.c:2110: error: (Each undeclared identifier is reported only once
gdkevents-x11.c:2110: error: for each function it appears in.)
...

That's because the protocol headers in the 10.4u SDK are not as up to date as gtk needs. Maybe try installing xorg-randrproto first.

I installed xorg-randrproto, cleaned gtk2, and built again. It hit a different error:

libtool: compile:  /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Gdk\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_DISABLE_CAST_CHECKS -D_REENTRANT -I/opt/local-test/include/glib-2.0 -I/opt/local-test/lib/glib-2.0/include -I/opt/local-test/include -I/opt/local-test/include/pango-1.0 -I/opt/local-test/include/cairo -I/opt/local-test/include/pixman-1 -I/opt/local-test/include/freetype2 -I/opt/local-test/include/libpng12 -I/usr/X11/include -I/opt/lo
cal-test/include -no-cpp-precomp -DX_LOCALE -isysroot /Developer/SDKs/MacOSX10.5
.sdk -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -I/usr/X11/include -DGDK_PIXBU
F_DISABLE_DEPRECATED -O2 -funroll-loops -fstrict-aliasing -isysroot /Developer/S
DKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c gdkev
ents-x11.c  -fno-common -DPIC -o .libs/gdkevents-x11.o
gdkevents-x11.c: In function 'gdk_event_translate':
gdkevents-x11.c:2112: error: 'XRRNotifyEvent' undeclared (first use in this func
tion)gdkevents-x11.c:2112: error: (Each undeclared identifier is reported only once 
gdkevents-x11.c:2112: error: for each function it appears in.)
gdkevents-x11.c:2112: error: 'notify' undeclared (first use in this function)
gdkevents-x11.c:2112: error: syntax error before ')' token

I should mention that gtk2 compiles fine using the 10.4u SDK when I use --x-includes and --x-libraries. Maybe there's some conflict between the -isysroot /Developer/SDKs/MacOSX10.5.sdk and -mmacosx-version-min=10.4 options gtk2 is using. (universal_sysroot is /Developer/SDKs/MacOSX10.4u.sdk in macports.conf.)

I'll try your suggestion from comment 46. Am I supposed to put that code in the portfiles in place of --x-includes and --x-libraries?

Yes.

Using the same configuration as before, I started over:

sudo rm -rf /opt/local-test/
sudo make install
sudo vi /opt/local-test/etc/macports/variants.conf # Add +universal
# Patched cairo, pango, and gtk2. Ran portindex.
sudo vi /opt/local-test/etc/macports/sources.conf # Add file:///Users/david/macports-sources/ports.test
sudo /opt/local-test/bin/port selfupdate
sudo /opt/local-test/bin/port -d install gtk2

I attached the patch against the ports tree.

Somehow the --x-include and --x-lib don't get added to the configure args and the libraries are linked with the wrong X11 dynamic libraries as before.

--->  Configuring cairo
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (cairo)
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
...
checking for X... libraries /usr/X11/lib, headers
...
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
...
checking for X... libraries /usr/X11/lib, headers
...
../doltcompile gcc -DHAVE_CONFIG_H -I. -I..  -I. -I/opt/local-test/include/pixman-1      -I/opt/local-test/include/freetype2 -I/opt/local-test/include   -I/opt/local-test/include   -I/opt/local-test/include/libpng12      -I/usr/X11/include   -I/usr/X11/include     -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing -fno-common -Wp,-D_FORTIFY_SOURCE=2              -I/opt/local-test/include -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk  -arch i386 -mmacosx-version-min=10.4 -c -o cairo-ps-surface.lo cairo-ps-surface.c
...
--->  Configuring pango
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (pango)
DEBUG: Environment: CFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' CPPFLAGS='-I/opt/local-test/include -no-cpp-precomp -isysroot /Developer/SDKs/MacOSX10.4u.sdk' CXXFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' MACOSX_DEPLOYMENT_TARGET='10.4' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2' LDFLAGS='-L/opt/local-test/lib -no-undefined -bind_at_load -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -arch ppc -arch i386 -mmacosx-version-min=10.4' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2' FFLAGS='-O2' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local-test/var/macports/build/_Users_david_macports-sources_ports.test_x11_pango/work/pango-1.22.4" && ./configure --prefix=/opt/local-test --enable-static --disable-dependency-tracking'
...
checking for X... libraries /usr/X11/lib, headers
...
 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I../.. -I/opt/local-test/include/freetype2 -I/opt/local-test/include -I/opt/local-test/include -I . -I/opt/local-test/include -no-cpp-precomp -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c harfbuzz.c -o harfbuzz.o >/dev/null 2>&1
...
--->  Configuring gtk2
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (gtk2)
DEBUG: Environment: CUPS_CONFIG='/Developer/SDKs/MacOSX10.5.sdk/usr/bin/cups-config' CFLAGS='-O2 -funroll-loops -fstrict-aliasing -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' CPPFLAGS='-I/opt/local-test/include -no-cpp-precomp -DX_LOCALE -isysroot /Developer/SDKs/MacOSX10.5.sdk' CXXFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' MACOSX_DEPLOYMENT_TARGET='10.4' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2' LDFLAGS='-L/opt/local-test/lib -arch ppc -arch i386 -mmacosx-version-min=10.4' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2' FFLAGS='-O2' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local-test/var/macports/build/_Users_david_macports-sources_ports.test_x11_gtk2/work/gtk+-2.14.5" && ./configure --prefix=/opt/local-test --disable-shm --disable-glibtest --with-included-loaders --with-xinput --enable-xinerama --disable-dependency-tracking'
...

Even though all three ports use the wrong X11, cairo and pango use the 10.4u sysroot while gtk2 does not. It turns out it's that way in my release builds as well but it doesn't seem to matter. It's because of this code in gtk2/Portfile, which looks wrong:

if {[variant_isset universal]} {
    if {[file exists /Developer/SDKs/MacOSX10.5.sdk]} {
        set configure.universal_sysroot "/Developer/SDKs/MacOSX10.5.sdk"
    } else {
        set configure.universal_sysroot "/Developer/SDKs/MacOSX10.4u.sdk"
    }
    configure.env-append    CUPS_CONFIG="${configure.universal_sysroot}/usr/bin/cups-config"
}

Looking at the code you gave me, I see the reason it didn't have an effect is that /usr/X11R6/lib/pkgconfig/x11.pc exists. So maybe I misunderstood you--did you want me to start over with x11prefix=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6, not x11prefix=/usr/X11R6? I'll try that and post another comment.

Changed 15 years ago by david@…

Attachment: macports-17558-test.diff added

Patch against ports tree according to comment 46.

comment:50 in reply to:  49 Changed 15 years ago by david@…

Replying to david@…:

Looking at the code you gave me, I see the reason it didn't have an effect is that /usr/X11R6/lib/pkgconfig/x11.pc exists. So maybe I misunderstood you--did you want me to start over with x11prefix=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6, not x11prefix=/usr/X11R6? I'll try that and post another comment.

It worked! I did the following:

make distclean
./configure --prefix=/opt/local-test --with-tclpackage=/Library/Tcl/macports-test --with-universal-target=10.4 --with-universal-sysroot=/Developer/SDKs/MacOSX10.4u.sdk --with-x11-prefix=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6
make
sudo make install
sudo /opt/local-test2/bin/port selfupdate
sudo vi /opt/local-test2/etc/macports/variants.conf # Add +universal
sudo vi /opt/local-test2/etc/macports/sources.conf # Add file:///Users/david/macports-sources/ports.test
sudo /opt/local-test2/bin/port -d clean pango cairo gtk2
sudo /opt/local-test2/bin/port -d install gtk2
--->  Configuring cairo
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (cairo)
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
...
checking for X... libraries /opt/local-test2/lib, headers /opt/local-test2/include
...
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I/opt/local-test2/include/pixman-1 -I/opt/local-test2/include/freetype2 -I/opt/local-test2/include -I/opt/local-test2/include -I/opt/local-test2/include/libpng12 -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wstrict-aliasing=2 -Winit-self -Wdeclaration-after-statement -Wold-style-definition -Wno-missing-field-initializers -Wno-unused-parameter -Wno-long-long -Winline -fno-strict-aliasing -fno-common -Wp,-D_FORTIFY_SOURCE=2 -I/opt/local-test2/include -I/opt/local-test2/include -I/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -mmacosx-version-min=10.4 -c cairo-analysis-surface.c  -fno-common -DPIC -o .libs/cairo-analysis-surface.o
...
--->  Configuring pango
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing proc-pre-org.macports.configure-configure-0
DEBUG: Executing org.macports.configure (pango)
DEBUG: Environment: CFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' CPPFLAGS='-I/opt/local-test2/include -
no-cpp-precomp -I/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include -isysroot /Developer/SDKs/MacOSX10.4u.sdk' CXXFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' MACOSX_DEPLOYMENT_TARGET='10.4' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2' LDFLAGS='-L/opt/local-test2/lib -no-undefined -bind_at_load -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -L/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib -arch ppc -arch i386 -mmacosx-version-min=10.4' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2' FFLAGS='-O2' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local-test2/var/macports/build/_Users_david_macports-sources_ports.test_x11_pango/work/pango-1.22.4" && ./configure --prefix=/opt/local-test2 --enable-static --x-include=/opt/local-test2/include --x-lib=/opt/local-test2/lib --disable-dependency-tracking'
...
checking for X... libraries /opt/local-test2/lib, headers /opt/local-test2/include
...
 /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I../.. -I/opt/local-test2/include/freetype2 -I/opt/local-test2/include -I/opt/local-test2/include -I . -I/opt/local-test2/include -no-cpp-precomp -I/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c harfbuzz.c  -fno-common -DPIC -o .libs/harfbuzz.o
...
--->  Configuring gtk2
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (gtk2)
DEBUG: Environment: CUPS_CONFIG='/Developer/SDKs/MacOSX10.5.sdk/usr/bin/cups-config' CFLAGS='-O2 -funroll-loops -fstrict-aliasing -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' CPPFLAGS='-I/opt/local-test2/include -no-cpp-precomp -DX_LOCALE -I/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include -isysroot /Developer/SDKs/MacOSX10.5.sdk' CXXFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4' MACOSX_DEPLOYMENT_TARGET='10.4' CPP='/usr/bin/cpp-4.0' CXX='/usr/bin/g++-4.0' F90FLAGS='-O2' LDFLAGS='-L/opt/local-test2/lib -L/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib -arch ppc -arch i386 -mmacosx-version-min=10.4' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' OBJCFLAGS='-O2' FFLAGS='-O2' CC='/usr/bin/gcc-4.0'
DEBUG: Assembled command: 'cd "/opt/local-test2/var/macports/build/_Users_david_macports-sources_ports.test_x11_gtk2/work/gtk+-2.14.5" && ./configure --prefix=/opt/local-test2 --disable-shm --disable-glibtest --with-included-loaders --x-include=/opt/local-test2/include --x-lib=/opt/local-test2/lib --with-xinput --enable-xinerama --disable-dependency-tracking'
...
checking for X... libraries /opt/local-test2/lib, headers /opt/local-test2/include
...
libtool: compile:  /usr/bin/gcc-4.0 -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -DG_DISABLE_CAST_CHECKS -D_REENTRANT -I/opt/local-test2/include/glib-2.0 -I/opt/local-test2/lib/glib-2.0/include -I/opt/local-test2/include -I/opt/local-test2/include/libpng12 -I/opt/local-test2/include -no-cpp-precomp -DX_LOCALE -I/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include -isysroot /Developer/SDKs/MacOSX10.5.sdk -DG_DISABLE_SINGLE_INCLUDES -DATK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -I/opt/local-test2/include -DGDK_PIXBUF_DISABLE_DEPRECATED -O2 -funroll-loops -fstrict-aliasing -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -mmacosx-version-min=10.4 -Wall -c pixops.c  -fno-common -DPIC -o .libs/pixops.o
...

I built an application bundle and all appears well.

comment:51 Changed 15 years ago by steeve.earl@…

Cc: steeve.earl@… added

Cc Me!

comment:52 Changed 15 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: reopenedclosed

r45603 should finally solve this

comment:53 in reply to:  52 Changed 15 years ago by david@…

Replying to jeremyhu@…:

r45603 should finally solve this

I did another build completely from scratch with r45711 to test the changes. I configured as usual:

./configure --prefix=/opt/local-universal-10.4 --with-tclpackage=/Library/Tcl/macports-universal-10.4 --with-applications-dir=/opt/local-universal-10.4/Applications --with-universal-target=10.4 --with-universal-sysroot=/Developer/SDKs/MacOSX10.4u.sdk --with-x11-prefix=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6

I added

+universal
+system_x11

to variants.conf. Then

/opt/local-universal-10.4/bin/port -d install py25-gtk py25-py2app-devel py25-sqlite3 py25-zlib

The build hit an error in xorg-libXfixes:

checking pkg-config is at least version 0.9.0... yes
checking for X... configure: error: Package requirements (x11) were not met:

No package 'x11' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables X_CFLAGS
and X_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.


Warning: the following items did not execute (for xorg-libXfixes): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: The following dependencies failed to build: gtk2 xorg-libXcomposite xorg-libXfixes xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-libXinerama xorg-libXrandr libglade2 py25-cairo py25-numpy fftw-3 py25-nose py25-setuptools py25-zlib py25-gobject

The problem was caused by [45603/trunk/dports/x11/gtk2/Portfile], which added libXcomposite, libXdamage, and libXfixes to the dependencies of gtk2, none of which are in the 10.4u SDK. When I removed those dependencies the rest of the build went fine. Here's the patch I used:

svn cat --username guest --password "" -r 11767 svn://svn.insecure.org/zenmap/install_scripts/macosx/macports-1.8.0-universal.diff

comment:54 Changed 15 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.