pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/44826: packages for python stdlib modules should not install to site-packages



>Number:         44826
>Category:       pkg
>Synopsis:       packages for python stdlib modules should not install to 
>site-packages
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 05 09:55:00 +0000 2011
>Originator:     Joachim König
>Release:        5.99.44
>Organization:
>Environment:
NetBSD fujitsu-netbsd 5.99.44 NetBSD 5.99.44 (JOACHIM_ACPI) #0: Thu Jan 20 
08:49:04 CET 2011  joachim@joachim:/.../src/sys/arch/i386/compile/JOACHIM_ACPI 
i386

>Description:
The following python stdlib modules are created separately, i.e. with
extra packages, and not during python build and install:

databases/py-gdbm
databases/py-sqlite3
devel/py-curses
devel/py-cursespanel
devel/py-readline
textproc/py-cElementTree
textproc/py-expat
x11/py-Tk

These modules are installed by a custom setup.py (located in the files 
subdirectory) that uses distutils support to build and install the module. 
Distutils however installs modules by default into the location for third party 
modules, lib/pythonX.Y/site-packages.

stdlib modules should however be placed into lib/pythonX.Y. This is normally 
not an issues because the python interpreter searches in both
locations, it is however a problem for software using virtual environments that 
try to isolate the python interpreter and third
party modules in order to avoid version conflicts of the same module
for different third party packages.






>How-To-Repeat:
One such package is Plone Version 4 and its unified installer which
does not find the expat parser (from textproc/py-expat) when installed
for using the pkgsrc python interpreter. There is a bug report at
plone.org:

http://dev.plone.org/plone/ticket/10892

Installing pyexpat.so to lib/python2.6 instead of lib/python2.6/site-packages 
solves the problem.
>Fix:
In all the Makefiles of the above mentioned packages add the following
line:

PYSETUPINSTALLARGS=        --install-lib ${PREFIX}/${PYLIB}

and replace ${PYSITELIB} by ${PYLIB} in the PLIST files.

Unfortunately, PYLIB is not yet replaced in PLIST files, though
PRINT_PLIST_AWK already supports it. So to make it work change
the line in lang/python/extension.mk from:

PLIST_SUBST+= PYINC=${PYINC} PYSITELIB=${PYSITELIB}

to

PLIST_SUBST+= PYINC=${PYINC} PYLIB=${PYLIB} PYSITELIB=${PYSITELIB}

and of course: bump PKGREVISION



Home | Main Index | Thread Index | Old Index