Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#16933 closed enhancement (fixed)

RFE: Make Python 2.6 more Framework Friendly

Reported by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) Owned by: blb@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: skymoo (Adam Mercer), nox@…
Port: python26

Description

In #16334, I proposed changes to the python25 installation to fix problems caused by the switch to the Framework installation.
My proposed changes apparently would have caused other problems, and no consensus was reached.
Breaking py25-* ports seems to have been a major concern.

May I humbly suggest that python26 is an excellent opportunity to implement these changes since there are not yet any py26-* ports to break.

I have attached the proposed changes.
I have several py26- ports written based on these changes.
Just as an example, I have also attached py26-tkinter since IDLE.app will not run without it.

Attachments (2)

Portfile.diff (2.9 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 11 years ago.
Portfile (2.7 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 11 years ago.

Download all attachments as: .zip

Change History (21)

Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile.diff added

comment:1 Changed 11 years ago by skymoo (Adam Mercer)

Cc: ram@… added

Cc Me!

comment:2 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Are there any objections to my committing this patch?

comment:3 Changed 11 years ago by blb@…

I should be able to mess around with it today.

Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile added

comment:4 Changed 11 years ago by raimue (Rainer Müller)

Seems like you removed some parts of the installation, here are my concerns:

  • Why is libpython${branch}.dylib removed?
  • What happens to ${destroot}${prefix}/bin? It should only contain binaries with the branch suffix.
  • Why did you remove --disable-tk? Doesn't that pull in a depends_lib port:tk?
  • Not sure about the --without-readline flag, but usually readline was provided as a separate port py*-readline until now. Is this going to conflict now?

Sorry, I did not test the new Portfile, but at least wanted to leave some concerns about the changes.

comment:5 Changed 11 years ago by blb@…

I think the --disable-tk and --without-readline bits aren't needed anymore since the patch-setup.py takes care of disabling those modules.

comment:6 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Thanks for the reply.

  • Why is libpython${branch}.dylib removed?

The only reason is that if another port is using the python framework installation correctly then it is not needed.

  • What happens to ${destroot}${prefix}/bin? It should only contain binaries with the branch suffix.

With this configuration, only versioned binary files are installed into ${destroot}${prefix}/bin.
The python installation does this automatically.
Non versioned binaries are located in ${frameworks_dir}/Python.framework/Versions/2.6/bin, which do not conflict with anything.

  • Why did you remove --disable-tk? Doesn't that pull in a depends_lib port:tk?

--disable-tk is not recognized by the python configure script.
Further, I can find no mention of tk.
I believe this is an artifact from earlier python versions.

  • Not sure about the --without-readline flag, but usually readline was provided as a separate port py*-readline until now. Is this going to conflict now?

--without-readline is not recognized by the python configure script.
The configure does in fact check for how to link readline, but I can find no way of turning it off.
There does not seem to be a problem (perhaps because one of the patchfiles includes readline in the disabled_module_list).

comment:7 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Sorry, I should have stated that I could not find any mention of tk in the configure script.

comment:8 Changed 11 years ago by blb@…

I see it no longer installs ${prefix}/lib and ${prefix}/include items (all are now under the framework). This is fine for python group-based ports, but what about those that want python but aren't using the group stuff? I haven't had a chance to test one to see what happens, though many of them may need testing to see if there are issues.

comment:9 Changed 11 years ago by nox@…

Cc: nox@… added

Cc Me!

comment:10 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

I am not sure that the lack of ${prefix}/lib and ${prefix}/include will be a major problem.

Some ports are smart enough to ask python what to do.
graphviz for example has the following in its configure script:

        PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
        PYTHON_INCLUDES=-I$PYTHON_PREFIX/include/python$PYTHON_VERSION_SHORT
        PYTHON_LIBS="-L$PYTHON_PREFIX/lib$LIBPOSTFIX/python$PYTHON_VERSION_SHORT/config"
        PYTHON_INSTALL_DIR="`$PYTHON $srcdir/config/config_python.py archsitelib`"

This type of thing is actually one of the sources of the problem with python25, which was discussed in #16334.
graphviz tried to install in the Framework library directory, but they had been made into soft links to ${prefix}/lib.
MacPorts can't handle installation into links to directories.

If a port does not ask python directly for the settings, I think that a couple of -I... and -L... might be all that is required.

So far, boost, graphviz, and pdflib are non-PortGroup ports which work with the new python26 with minimal effort.

comment:11 Changed 11 years ago by blb@…

I wonder if, as mentioned in #16334, since we may have to do symlinks from the Frameworks.../bin to ${prefix}/bin, we can add that to the port group, something like python26.linkbin program would automatically link Frameworks.../bin/program to ${destroot}${prefix}/bin ? With the py25-numpy example in #16334, it could append 2.6 if necessary.

comment:12 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Are you thinking of something like this?

proc python26.linkbin { program } {
    ln -s ${frameworks_dir}/Python.framework/Versions/2.6/bin/${program} ${destroot}/bin/${program}2.6
}

I suppose I would argue that it doesn't really add much.

comment:13 Changed 11 years ago by blb@…

When we implement jmr's group unification stuff (#16723), we would need to push version numbers away from the Portfile itself, since it'd then be dependent upon which python version variant is being used. So my first idea would be wrong, instead, no 26 in it at all I think.

comment:14 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

May I go ahead and commit this patch, or are there unresolved concerns?

I would be happy to become a co-maintainer of python26 to help fix any bug reports concerning this patch.

comment:15 in reply to:  14 Changed 11 years ago by blb@…

Replying to mcalhoun@…:

May I go ahead and commit this patch, or are there unresolved concerns?

I would be happy to become a co-maintainer of python26 to help fix any bug reports concerning this patch.

Sure on both questions, I hope to try a few ports against it to make sure be we should still have some time since there still isn't a python26 port group yet.

comment:16 in reply to:  10 ; Changed 11 years ago by raimue (Rainer Müller)

Replying to mcalhoun@…:

So far, boost, graphviz, and pdflib are non-PortGroup ports which work with the new python26 with minimal effort.

Have you tried mercurial? I remember I had problems with it while I was doing the framework transition and tried to place everything inside the framework itself.

comment:17 in reply to:  16 Changed 11 years ago by blb@…

Replying to raimue@…:

Have you tried mercurial? I remember I had problems with it while I was doing the framework transition and tried to place everything inside the framework itself.

That was one of the first ones I was planning on testing, FYI.

comment:18 Changed 11 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Resolution: fixed
Status: newclosed

Fixed in r42212.

comment:19 Changed 10 years ago by (none)

Milestone: Port Enhancements

Milestone Port Enhancements deleted

Note: See TracTickets for help on using tickets.