[MacPorts] #21824: python26 framework broken
#21824: python26 framework broken --------------------------------+------------------------------------------- Reporter: stromnov@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: python26 --------------------------------+------------------------------------------- python2.6 framework broken in macports {{{man ld}}} {{{ -framework name[,suffix] This option tells the linker to search for `name.framework/name' the framework search path. If the optional suffix is specified the framework is first searched for the name with the suffix and then without (e.g. look for `name.framework/name_suffix' first, if not there try `name.framework/name'). }}} If we want to link with something like -framework Python, we need ${prefix}/Library/Framework/Python.framework/Python in ours paths {{{ stromnov@stromnov:~$ ls -la /System/Library/Frameworks/Python.framework/Python lrwxr-xr-x 1 root wheel 23 Oct 2 23:59 /System/Library/Frameworks/Python.framework/Python -> Versions/Current/Python stromnov@stromnov:~$ ls -la /opt/local/Library/Frameworks/Python.framework/Python ls: /opt/local/Library/Frameworks/Python.framework/Python: No such file or directory }}} {{{cat test.c}}} {{{ #include <Python.h> int main(const int argc, const char *argv[]) { Py_Initialize(); Py_Finalize(); return 0; } }}} Trying to compile with default paths turned off (-Z): {{{ stromnov@stromnov:~$ gcc -Z -F/opt/local/Library/Frameworks -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -framework Python test.c ld: framework not found Python collect2: ld returned 1 exit status }}} Explicitly create proper framework link: {{{ stromnov@stromnov:~$ (cd /opt/local/Library/Frameworks/Python.framework/; sudo ln -s Versions/2.6/Python Python) }}} Compiling: {{{ stromnov@stromnov:~$ gcc -Z -F/opt/local/Library/Frameworks -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -framework Python test.c stromnov@stromnov:~$ }}} -- Ticket URL: <http://trac.macports.org/ticket/21824> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken --------------------------------+------------------------------------------- Reporter: stromnov@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: python26 --------------------------------+------------------------------------------- Comment(by stromnov@…): Problem detected while investigating #21444. -- Ticket URL: <http://trac.macports.org/ticket/21824#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken --------------------------------+------------------------------------------- Reporter: stromnov@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: python26 --------------------------------+------------------------------------------- Changes (by ram@…): * cc: blb@…, mcalhoun@… (added) -- Ticket URL: <http://trac.macports.org/ticket/21824#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken --------------------------------+------------------------------------------- Reporter: stromnov@… | Owner: blb@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Keywords: | Port: python26 --------------------------------+------------------------------------------- Changes (by macsforever2000@…): * cc: blb@… (removed) * owner: macports-tickets@… => blb@… -- Ticket URL: <http://trac.macports.org/ticket/21824#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken ---------------------------------+------------------------------------------ Reporter: stromnov@… | Owner: blb@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Resolution: invalid | Keywords: Port: python26 | ---------------------------------+------------------------------------------ Changes (by blb@…): * status: new => closed * resolution: => invalid Comment: Install python_select and use that to select which framework is to be used for linking like that. Also, if you use {{{ #include <Python/Python.h> }}} you won't need the {{{-I}}} argument as the framework stuff will get that for you. -- Ticket URL: <http://trac.macports.org/ticket/21824#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken ---------------------------------+------------------------------------------ Reporter: stromnov@… | Owner: blb@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Resolution: invalid | Keywords: Port: python26 | ---------------------------------+------------------------------------------ Comment(by stromnov@…): Hmm, so it completely wrong to link ports to frameworks? I'm using macports python2.5, but need to build port, that links to python2.6 framework. It's impossible without using of python_select two times. -- Ticket URL: <http://trac.macports.org/ticket/21824#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken ---------------------------------+------------------------------------------ Reporter: stromnov@… | Owner: blb@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Resolution: invalid | Keywords: Port: python26 | ---------------------------------+------------------------------------------ Comment(by blb@…): That's the thing, if python25 and python26 were to setup full framework stuff (Current and whatnot), then they'd conflict and you could have only one of them installed (or at least active) at a time. You should be able to link to the library directly with {{{-L${prefix}/lib -lpython2.6}}} or for the linking stage, using distutils: {{{ $ /opt/local/bin/python2.6 ...
import distutils.sysconfig print distutils.sysconfig.get_config_var('LINKFORSHARED') -u _PyMac_Error /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python }}}
-- Ticket URL: <http://trac.macports.org/ticket/21824#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken ---------------------------------+------------------------------------------ Reporter: stromnov@… | Owner: blb@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Resolution: invalid | Keywords: Port: python26 | ---------------------------------+------------------------------------------ Comment(by stromnov@…): When port is native MacOSX application that need explicit linkage with framework, we can link that application against fake framework, something like this (last lines in python_select sequence): {{{ PortGroup python25 ... set fwkdir ${workdir}/Frameworks/Python.framework cd ${workdir} mkdir -p ${fwkdir}/Versions ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5 ${fwkdir}/Versions/Current ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Headers ${fwkdir}/Headers ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Resources ${fwkdir}/Resources ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Python ${fwkdir}/Python ... CFLAGS+=-F${fwkdir} -framework Python ... }}} Every port, that installed as framework, can store (in registry?) some meta information for creating fake framework at build time. -- Ticket URL: <http://trac.macports.org/ticket/21824#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#21824: python26 framework broken ---------------------------------+------------------------------------------ Reporter: stromnov@… | Owner: blb@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.8.1 Resolution: invalid | Keywords: Port: python26 | ---------------------------------+------------------------------------------ Comment(by vince@…): Replying to [comment:7 stromnov@…]:
When port is native MacOSX application that need explicit linkage with framework, we can link that application against fake framework, something like this (last lines in python_select sequence):
{{{ PortGroup python25 ... set fwkdir ${workdir}/Frameworks/Python.framework cd ${workdir} mkdir -p ${fwkdir}/Versions ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5 ${fwkdir}/Versions/Current ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Headers ${fwkdir}/Headers ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Resources ${fwkdir}/Resources ln -s ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Python ${fwkdir}/Python ... CFLAGS+=-F${fwkdir} -framework Python ... }}}
Every port, that installed as framework, can store (in registry?) some meta information for creating fake framework at build time.
That's precisely what I do for an upcoming port. See also #21614. -- Ticket URL: <http://trac.macports.org/ticket/21824#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts