Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#12803 closed defect (fixed)

python25 does not provide a dynamic library

Reported by: nox@… Owned by: mww@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mww@…, nox@…
Port:

Description

python2.5-config --libs talks about a "python2.5" library.

The python2.5-config script says:

elif opt in ('--libs', '--ldflags'):
    libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
    libs.append('-lpython'+pyver)
    # add the prefix/lib/pythonX.Y/config dir, but only if there is no
    # shared library in prefix/lib/.
    if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
        libs.insert(0, '-L' + getvar('LIBPL'))
    print ' '.join(libs)

As you can see, if python is built with Py_ENABLE_SHARED set, it should provide a dynamic library. If not, it should include in the LDFLAGS the lib/python2.5/config directory, where lives libpython2.5.a.

Unfortunately, python25 build system assumes that if you're on Darwin, you're more likely to build Python as a framework, and so it forgets about dynamic library when building it the old-fashioned Unix way.

Finally, Py_ENABLE_SHARED is set because configure has been asked to (configure.args --enable-shared, but the only thing that get changed is that modules are built as bundles.

I've tried writing a patch (attached) about that but it fails when building.

So, we either found a way to build a nice and neat dylib, or we move to framework-style install.

Attachments (3)

patch-Makefile.pre.in (622 bytes) - added by nox@… 13 years ago.
patch-configure (956 bytes) - added by nox@… 13 years ago.
python25-2.5.1_1.diff (7.2 KB) - added by nox@… 13 years ago.

Download all attachments as: .zip

Change History (9)

Changed 13 years ago by nox@…

Attachment: patch-Makefile.pre.in added

Changed 13 years ago by nox@…

Attachment: patch-configure added

comment:1 Changed 13 years ago by nox@…

So, with some more work and a nice patch from the Fink team (I think), I've been able to build and install a dynamic library.
But that's not all there is about this last patch:

  • Added gettext dependency (needed for the _locale core module).
  • Now uses altinstall make target: this target installs the Python interpreter as python2.5 thus removing the need of patching Makefile.pre.in to avoid conflicts with other python2* ports.
  • Added 2 source patches to workaround the lack of environ global array on Darwin.
  • Removed call to system to rename the other executables and the manpage.
  • Removed useless configure arguments (they were either not defined or enabled by default).
  • Modified livecheck a bit to something more beautiful and correctly escaped.

Hope you'll be able to review this bunch of patches easily, otherwise i'll split them up a little.

Changed 13 years ago by nox@…

Attachment: python25-2.5.1_1.diff added

comment:2 Changed 13 years ago by nox@…

The Makefile.pre.in patch now also disable the installation of lib-tk and sqlite3 directories, as these modules are disabled anyway.

comment:3 Changed 13 years ago by mww@…

I'd like to keep the sqlite3 and lib-tk files in the base installation so we do not have to disable them here and put them into the py25-tkinter.. ports. For the rest (the 95%): Damn good work - I'd say just go and commit them yourself!

comment:4 Changed 13 years ago by nox@…

Resolution: fixed
Status: newclosed

Commited in r29606! I'll try to do something about the sqlite3 and tkinter modules and IDLE.

comment:5 Changed 13 years ago by mdickens@…

There are still issues with python25 (rev 4), with regard to the (lack of) framework and this dylib. Please see ticket:11267, comment#11 .

comment:6 Changed 12 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.