bsd.python.mk
Ports need to use a designated python interpreter, whether this
is the default one chosen by the user (or provided by the system)
and pulled in via USE_PYTHON[_BUILD|_RUN]=yes or an explicit version
or version range pulled in via USE_PYTHON[_BUILD|_RUN]=X.Y does not
matter.
Ports should however not rely on 'python' at build or installation
time, whenever possible to avoid problems with building packages for
different python versions.
This change tries to raise the barrier for misbehaving ports and eases
package builds for different python versions.
Tested with: exp-run (ports/184591)
Reviewed by: wg@, koobs@
Supported by: wg@
With hat on: python@
Setuptools is the preferred method to manage Python distributions after
many changes to the packaging ecosystem over the past couple of years.
Only ports using USE_PYDISTUTILS= yes are affected by this commit, ports using
USE_PYDISTUTILS= easy_install remains the same however this usage is now
deprecated and should be converted to USE_PYDISTUTILS= yes.
Some Python distributions do not work with setuptools out of the box because
they extend the install command from distutils and not setuptools, and
so they need to be patched accordingly.
pip (which leverages setuptools) works around the issue by using eggs, however
we want to get rid of those as well, as support for "flat" installation is
unavailable or has other issues associated with it.
This work allows us to unify how python packages are built, ensure that Python
distributions are installed consistently, reduces complexity for Python port
maintainers and paves the way for simplifying the Python ports framework in
the future.
With hat on: python
Reviewed by: koobs, antoine
Exp-run: bdrewery
Approved by: bdrewery (portmgr)
twisted can be configured with the arguments run or build to replace
the previous USE_TWISTED_RUN and USE_TWISTED_BUILD knobs. The twisted
components can be added as comma-separated arguments. If you previously
wrote
USE_TWISTED= yes
USE_TWISTED= conch names
USE_TWISTED_RUN= yes
you now would write
USES= twisted
USES= twisted:conch,names
USES= twisted:run
This allows stage dir support for python packages using easy_install
method from setuptools module.
easy_install target does not support a --root so we workaround it with
PYTHONUSERBASE and other user flags.
Submitted by: nivit, wg
With hat on: python
Exp-run: bdrewery
new DEFAULT_VERSIONS variable.
PYTHON_DEFAULT_VERSION, PYTHON2_DEFAULT_VERSION and
PYTHON3_DEFAULT_VERSION are deprecated. If you have set them in your
make.conf, you should change them something like
DEFAULT_VERSIONS=python=2.7 python2=2.7 python3=3.3
via USE_PYTHON=2 (for lang/python2) or USE_PYTHON=3 (for lang/python3).
This can be used for ports, which do not care, which specific minor
release version of Python 2.x or Python 3.x is used, as long as there
are proper symlinks to e.g. bin/python2 or bin/python3.
This will cause the ports framework to create the plist automatically
for distutils-based ports. All files installed via Python's distutils
mechanisms (either the traditional distutils or easy_install) will be
automtically added to the package list, regardless of the Python
version. It is somewhat similar to the RUBYGEM_AUTOPLIST knob.
- Introduce a new port Makefile knob PYTHON_PY3K_PLIST_HACK.
This automatically replaces .pyc and .pyo package list entries with
the relevant __pycache__ entries for Python 3.x. It should only be
used for ports, which do not use one of Python's default package
installation mechanisms and which are guaranteed to work with any
python version.
- old USE_ZOPE knob support was removed from bsd.python.mk
- update CHANGES and bsd.sanity.mk accordingly
- add ZOPE options knob and use it in lang/py-mx-base
The work is done by Marcus von Appen, but any problems are mine.
Submitted by: mva (python ML)
The ports tree is now staged by default. With pkgng the sequence hasn't
changed, the main difference is that creating package is now independent
from installing it. With pkg_install, the package is now created first
and make install, do install the package.
New macros:
- STAGEDIR: PATH to the directory where the port will be staged.
- NO_STAGE: Keep the old behaviour of the ports tree (aka no staging area)
Unsupported macro if NO_STAGE is not set:
- MAN* with staging man page compression and handling of hardlinks and
symlinks is automatically done in the stage. the manpages becomes then a
"normal" plist files and should be tracked in pkg-plist.
- MANCOMPRESSED the compress-man target is able to only compress when it
needed.
New target:
- stage: this installs everything into the stage directory
- makeplist: this will create a pkg-plist and print it to stdout. This is
a sample plist and it should always be _reviewed_ not directly used.
NOTE: with staging only what is in the plist will be installed, nothing more,
meaning a port staged cannot have leftovers exect directories left. It is
really important to double check the pkg-plist to make sure all the files
the maintainer want to package are in! make makeplist can help in that area.
The goal is to handle as quickly as possible a full removal of the NO_STAGE
support.
More features can be added once the full ports tree is converted to using the
staging area
Conversion notes:
- Remove NO_STAGE
- in {pre,do,post}-install
* Before any usage of ${PREFIX}, ${ETCDIR}, ${PORTSDIR}, ${PORTEXAMPLES}
prepend ${STAGEDIR}
* Remove any thing that is done by @exec or +INSTALL script it will be
done automatically when syncing packages
* Remove any code to show PKG-MESSAGE it will be done automatically when
syncing packages
* Directory creation should remain in post-install (in particular because
pkgng doesn't work like pkg_install in that area and pkgng ignores the
@exec mkdir but directly pack the directory even if empty)
- PORTDOCS/PORTEXAMPELS
To support PORTDOCS, PORTEXAMPLES most of the time there is no more need
for hacks. just add the right %%PORTDOCS%% or %%PORTEXAMPLES%% in your
plist then the given files from the stagedir will or will not sync
according to NOPORTDOCS and NOPORTEXAMPLES.
With hat: portmgr
Reviewed by: bdrewery
binary in $PATH. It can be set in case the user wants to use a
specific python2 version as a default. Its behaviour is similar
to the existing PYTHON3_DEFAULT_VERSION and fixes a small issue with
package builds for different python versions.
- Outline that PYTHON_DEFAULT_VERSION always takes precedence for a
specific python major version.
- Update lang/python2 to use PYTHON2_DEFAULT_VERSION and bump the
PORTREVISION to let the installed port catch up with the change.
- Allow PYTHON3_DEFAULT_VERSION to overriden by a user choice, if
PYTHON_DEFAULT_VERSION is not set to a python3 port.
Reported by: David Demelier <demelier.david@gmail.com>
Reviewed by: koobs@, sbz@
With hat on: python@
system currently installed (i.e. PYEASYINSTALL_ARCHDEP) the entire version
string of the system is used in the destination directory, for example;
python_ldap-2.4.12-py2.7-freebsd-10.0-CURRENT-amd64.egg
This plays havoc when STABLE, RELEASE and RELENG are used, not forgetting
patchlevels as well. Now, only the major FreeBSD version number is included;
python_ldap-2.4.12-py2.7-freebsd-10-amd64.egg
Given that ABI should be stable at least over major releases, this now allows
packages to be created and installed correctly.
PR: ports/133081
Submitted by: Stef Walter <stef@memberwebs.com>
(this patch used as a starting point)
Reviewed by: No objections from python@
. lang/python27: 2.7.3 -> 2.7.5
. lang/python32: 3.2.3 -> 3.2.4
. lang/python33: 3.3.0 -> 3.3.1
- update Mk/bsd.python.mk with new versions
- mark lang/python26 and lang/python31 as deprecated (set them to
upstream EoL dates)
- update docs (lang/python-doc-html)
- align databases/py-bsddb patch for python27 - most of it was applied
upstream. Raise BDB version to 4.3 atleast, according to
upstream requirements.
Many thanks to Martin (miwi) for his time on this update.
PR: 178506
Submitted by: rm (myself)
Exp-run by: portmgr (miwi)
- revert erroneous threads patch in lang/python26 and lang/python27,
that was added after ports/131080. It was rejected upstream, because it's
not actually a bug, but misuse.
Gabor Pali (pgj) in collaboration with Kubilay Kocak (koobs) did an
independent investigation regard the issue. See here for details:
http://lists.freebsd.org/pipermail/freebsd-python/2013-April/005376.html
PR: 153167
Submitted by: Duncan Findlay <duncan@duncf.ca>
Reported by: pgj/koobs (at python@ ML)
Exp-run by: portmgr (miwi)
for an exp-run of updated python versions.
- trim Makefile headers
- remove leading indefinite article from COMMENT
- use PYTHON shortcut in MASTER_SITES
- whitespace fixes
- remove checks for unsupported versions of FreeBSD
- use static value ``33'' instead of PYTHON_SUFFIX in lang/python33/pkg-plist,
because this value is not supposed to be changed across the branch and for
consistency with other python3 ports
- remove conflicts in lang/python-mode.el with not more existing python-2.4
${PYTHON_DEFAULT_VERSION}, this generates conflicting packages.
- Create symbolic links as PEP 394 [1] suggests. ${PYTHON_DEFAULT_VERSION}
will create python and python${MAJOR_VERSION} links. In current default,
lang/python27 will create: python -> python2 -> python2.7
- Introduce ${PYTHON3_DEFAULT_VERSION}, which will handle bin/python3 link.
At this point, lang/python33 will create python3 -> python3.3
- Minor cleanups
* Trim Makefile headers
* Remove ${OSVERSION} detection for xz, whihc is done by USE_XZ
[1] http://www.python.org/dev/peps/pep-0394/
(PYTHON_DISTFILE variable)
- switch lang/python ports (and it's slaves) to tar.xz
I compared all the four pairs .tgz/.tar.xz and they have no content differences.
Discussed on: python@
- change depends for USE_ZOPE case to make it work with current zope version
Submitted by: lwhsu (final patch revision)
Reviewed by: crees
Discussed in: python