Opened 15 years ago

Closed 13 years ago

#19583 closed defect (fixed)

py26-wxpython wrongfully decides to build himself universal

Reported by: Veence (Vincent) Owned by: jameskyle@…
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc: alex@…, michaelld (Michael Dickens), cvanweelden@…, jjstickel@…, arobson73@…
Port: py26-wxpython

Description (last modified by ryandesign (Ryan Carsten Schmidt))

While wxwidgets is not universal (yet), because of dependencies on Carbon and Quicktime, py26-wxpython, when compiled on a universal python 2.6 environnement, tries to build himself universal, probably because it picks up the flags used for python 2.6 compiling during setup. Consequency: it fails miserably here:

src/mac/_gdi_wrap.cpp: In function 'PyObject* _wrap_Font_MacGetATSUFontID(PyObject*, PyObject*)':
src/mac/_gdi_wrap.cpp:15883: error: 'class wxFont' has no member named 'MacGetATSUFontID'

because in the definition of the wxFont class, we read:

#ifndef __LP64__    
    // 'old' Quickdraw accessors
    short MacGetFontNum() const;
    short MacGetFontSize() const;
    wxByte  MacGetFontStyle() const;

    // 'new' ATSUI accessors
    wxUint32 MacGetATSUFontID() const;
    wxUint32 MacGetATSUAdditionalQDStyles() const;
    wxUint16 MacGetThemeFontID() const ;

    // Returns an ATSUStyle not ATSUStyle*
    void* MacGetATSUStyle() const ;
#else
    const void * MacGetCTFont() const;
    // soon to be removed for 64bit, Returns an ATSUStyle not ATSUStyle*
    void* MacGetATSUStyle() const ;
#endif

the wxFont class not being the same on 32 and 64-bit mode.

Any idea to patch this up?

Attachments (4)

py26-wxpython.log (98.5 KB) - added by alex@… 14 years ago.
Build log
patch-py26-wxpython-config.py-i386.diff (764 bytes) - added by alex@… 14 years ago.
patch to config.py to force i386 architecture
Portfile-py26-wxpython.diff (452 bytes) - added by alex@… 14 years ago.
Patch to Portfile to include patch to config.py
py26-wxpython-debug.txt (163.8 KB) - added by Russell-Jones-OxPhys (Russell Jones) 14 years ago.
10.6.2 +universal in variants.conf: sudo port clean py26-wxpython ; sudo port -d install py26-wxpython

Download all attachments as: .zip

Change History (24)

comment:1 Changed 15 years ago by Veence (Vincent)

Well, adding CFLAGS="" and CXXFLAGS="" to the build.env line solves build problem, but another then appears :

Python 2.6 (r26:66714, Nov 19 2008, 14:55:25) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from wx import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/pkg/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module>
    from wx._core import *
  File "/usr/pkg/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in <module>
    import _core_
ImportError: dynamic module does not define init function (init_core_)

whatever python is run in 32 or 64-bit mode...

comment:2 Changed 15 years ago by Veence (Vincent)

Well, after all it is somehow related to architecture. I filtered out all .so modules to leave only i386 files:

file *.so
_animate.so:   Mach-O bundle i386
_aui.so:       Mach-O bundle i386
_calendar.so:  Mach-O bundle i386
_combo.so:     Mach-O bundle i386
_controls_.so: Mach-O bundle i386
_core_.so:     Mach-O bundle i386
_gdi_.so:      Mach-O bundle i386
_gizmos.so:    Mach-O bundle i386
_glcanvas.so:  Mach-O bundle i386
_grid.so:      Mach-O bundle i386
_html.so:      Mach-O bundle i386
_media.so:     Mach-O bundle i386
_misc_.so:     Mach-O bundle i386
_richtext.so:  Mach-O bundle i386
_stc.so:       Mach-O bundle i386
_webkit.so:    Mach-O bundle i386
_windows_.so:  Mach-O bundle i386
_wizard.so:    Mach-O bundle i386
_xrc.so:       Mach-O bundle i386

I run a i386 python

-> file /usr/pkg/bin/python
/usr/pkg/bin/python: Mach-O executable i386
-> python
Python 2.6 (r26:66714, Nov 19 2008, 14:55:25) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from wx import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/pkg/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module>
    from wx._core import *
  File "/usr/pkg/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in <module>
    import _core_
ImportError: dlopen(/usr/pkg/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core_.so, 2): no suitable image found.  Did find:
	/usr/pkg/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/wx-2.8-mac-unicode/wx/_core_.so: mach-o, but wrong architecture

??? How a 32-bit code can possibly require to dynamically link with a 64-bit piece ???

comment:3 Changed 15 years ago by Veence (Vincent)

Description: modified (diff)
Resolution: fixed
Status: newclosed

Ok, gotcha. Sorry for the noise.

comment:4 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

I'm setting the ticket description back to what it originally was and moving your note into your comment above.

I'm not sure though from the text in this ticket what the resolution to this issue turned out to be.

comment:5 Changed 14 years ago by alex@…

Cc: alex@… added

Cc Me!

Changed 14 years ago by alex@…

Attachment: py26-wxpython.log added

Build log

comment:6 Changed 14 years ago by alex@…

I ran into the same issue when building gnuradio and gnuradio-grc respectively, which has py26-wxpython as a dependency. Doesn't seem to be fixed to me, or am I missing sth?

comment:7 Changed 14 years ago by alex@…

Workaround: force i386 only build.

Created a local ~/ports subdir, as documented in

http://guide.macports.org/chunked/development.patches.html

Patched config.py, diff and diff to Portfile attached.

Changed 14 years ago by alex@…

patch to config.py to force i386 architecture

Changed 14 years ago by alex@…

Attachment: Portfile-py26-wxpython.diff added

Patch to Portfile to include patch to config.py

comment:8 Changed 14 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: closedreopened

comment:9 Changed 14 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to jameskyle@…
Status: reopenednew

comment:10 Changed 14 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

comment:11 Changed 14 years ago by Russell-Jones-OxPhys (Russell Jones)

I've been building my macports on 10.6.2 with +universal in variants.conf. This port does not have such a variant, so I suppose the fact that it's building universal on my system is a manifestation of this bug. I've attached the output of

sudo port clean py26-wxpython ; sudo port -d install py26-wxpython

Changed 14 years ago by Russell-Jones-OxPhys (Russell Jones)

Attachment: py26-wxpython-debug.txt added

10.6.2 +universal in variants.conf: sudo port clean py26-wxpython ; sudo port -d install py26-wxpython

comment:12 Changed 14 years ago by cvanweelden@…

Cc: cvanweelden@… added

Cc Me!

comment:13 Changed 14 years ago by jjstickel@…

Cc: jjstickel@… added

Cc Me!

comment:14 Changed 14 years ago by arobson73@…

its consfusing knowing what the status is with all. to me it seems like its still not working. i tried installing the macport gnuradio, but that fails due to wx-python. im new to mac / linux type hacking around, just used to the easy double click way of installing of windows. from looking at wxpython website it says for mac os x , that wxpython only works with a framework build of python. what does that mean ?

comment:15 Changed 14 years ago by arobson73@…

Cc: arobson73@… added

Cc Me!

comment:16 in reply to:  14 ; Changed 14 years ago by jjstickel@…

Replying to arobson73@…:

its consfusing knowing what the status is with all. to me it seems like its still not working. i tried installing the macport gnuradio, but that fails due to wx-python. im new to mac / linux type hacking around, just used to the easy double click way of installing of windows. from looking at wxpython website it says for mac os x , that wxpython only works with a framework build of python. what does that mean ?

Basically, it seems that wxWidgets and wxPython are currently broken on Snow Leopard and using Macports, unless you compile all of Macports as 32 bit. I tried going the universal route, and all kinds of stuff broke, like for example this bug. We are all waiting for the wxwidgets/wxpython team to get cocoa working, but it does not seem to be soon.

comment:17 in reply to:  16 Changed 14 years ago by arobson73@…

Replying to jjstickel@…:

Replying to arobson73@…:

its consfusing knowing what the status is with all. to me it seems like its still not working. i tried installing the macport gnuradio, but that fails due to wx-python. im new to mac / linux type hacking around, just used to the easy double click way of installing of windows. from looking at wxpython website it says for mac os x , that wxpython only works with a framework build of python. what does that mean ?

Basically, it seems that wxWidgets and wxPython are currently broken on Snow Leopard and using Macports, unless you compile all of Macports as 32 bit. I tried going the universal route, and all kinds of stuff broke, like for example this bug. We are all waiting for the wxwidgets/wxpython team to get cocoa working, but it does not seem to be soon.

ok, thanks for quick reply. does this mean your request will soon be ready since it has been set to fixed ? http://trac.wxwidgets.org/ticket/11867

"swigged" files committed - whatever that means.

comment:18 Changed 14 years ago by jjstickel@…

For a possible solution, or at least a workaround, see ticket #24350.

comment:19 Changed 14 years ago by guillaumesalagnac

Cc Me!

comment:20 Changed 13 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

This was mostly fixed by changes to python and the portgroup, and the last of it should be fixed by r73122.

Note: See TracTickets for help on using tickets.