View | Details | Raw Unified | Return to bug 185947
Collapse All | Expand All

(-)Mk/bsd.python.mk (-18 / +74 lines)
Lines 78-85 Link Here
78
#					  for ${PYTHON_PKGNAMEPREFIX}.
78
#					  for ${PYTHON_PKGNAMEPREFIX}.
79
#
79
#
80
# PYTHON_VERSION	- Version of the python binary in your ${PATH}, in the
80
# PYTHON_VERSION	- Version of the python binary in your ${PATH}, in the
81
#					  format "python2.0". Set this in your makefile in case you
81
#					  format "python2.0". Set this in your makefile in case
82
#					  want to build extensions with an older binary.
82
#					  you want to build extensions with an older binary.
83
#					  default: depends on the version of your python binary
83
#					  default: depends on the version of your python binary
84
#
84
#
85
# PYTHON_VER		- Version of the python binary in your ${PATH}, in the
85
# PYTHON_VER		- Version of the python binary in your ${PATH}, in the
Lines 86-101 Link Here
86
#					  format "2.7".
86
#					  format "2.7".
87
#
87
#
88
# PYTHON_DEFAULT_VERSION
88
# PYTHON_DEFAULT_VERSION
89
#					- Version of the default python binary in your ${PATH}, in
89
#					- Version of the default python binary in your ${PATH},
90
#					  the format "python2.7".
90
#					  in the format "python2.7".
91
#
91
#
92
# PYTHON2_DEFAULT_VERSION
92
# PYTHON2_DEFAULT_VERSION
93
#					- Version of the default python2 binary in your ${PATH}, in
93
#					- Version of the default python2 binary in your ${PATH},
94
#					  the format "python2.7".
94
#					  in the format "python2.7".
95
#
95
#
96
# PYTHON3_DEFAULT_VERSION
96
# PYTHON3_DEFAULT_VERSION
97
#					- Version of the default python3 binary in your ${PATH}, in
97
#					- Version of the default python3 binary in your ${PATH},
98
#					  the format "python3.2".
98
#					  in the format "python3.2".
99
#
99
#
100
# PYTHON_MAJOR_VER	- Python version major number. 2 for python-2.x,
100
# PYTHON_MAJOR_VER	- Python version major number. 2 for python-2.x,
101
#					  3 for python-3.x and so on.
101
#					  3 for python-3.x and so on.
Lines 125-146 Link Here
125
# USE_PYTHON_PREFIX	- Says that the port installs in ${PYTHONBASE}.
125
# USE_PYTHON_PREFIX	- Says that the port installs in ${PYTHONBASE}.
126
#
126
#
127
# USE_PYDISTUTILS	- Use distutils as do-configure, do-build and do-install
127
# USE_PYDISTUTILS	- Use distutils as do-configure, do-build and do-install
128
#					  targets.
128
#					  targets. Using distutils also will cause the port to
129
#					  use a unique prefix for certain directories
130
#					  using USES=uniquefiles:dirs (see the
131
#					  uniquefiles.mk Uses for details). The values for
132
#					  the uniquefiles USES are set as follows:
129
#
133
#
134
#						UNIQUE_PREFIX=	${PYTHON_PKGNAMEPREFIX}
135
#						UNIQUE_SUFFIX=	-${PYTHON_VER}
136
#
137
#					  If the port is installed for the current default
138
#					  python version, scripts and binaries in
139
#
140
#						${PREFIX}/bin
141
#						${PREFIX}/sbin
142
#						${PREFIX}/libexec
143
#
144
#					  are linked from the prefixed version to the
145
#					  prefix-less original name, e.g. bin/foo-2.7 --> bin/foo.
146
#
130
# PYSETUP			- Name of the setup script used by the distutils package.
147
# PYSETUP			- Name of the setup script used by the distutils package.
131
#					  default: setup.py
148
#					  default: setup.py
132
#
149
#
133
# PYDISTUTILS_AUTOPLIST
150
# PYDISTUTILS_AUTOPLIST
134
#					- Automatically generates the packaging list for a port that uses
151
#					- Automatically generates the packaging list for a port
135
#                                         distutils or setuptools (easy_install) when defined.
152
#					  that uses distutils or setuptools (easy_install) when
136
#                                         requires: USE_PYDISTUTILS
153
#					  defined.
154
#					  requires: USE_PYDISTUTILS
137
#
155
#
138
# PYTHON_PY3K_PLIST_HACK
156
# PYTHON_PY3K_PLIST_HACK
139
#					- Automatically generates Python 3.x compatible __pycache__ entries
157
#					- Automatically generates Python 3.x compatible
140
#                                         from a Python 2.x packaging list when defined. Use this for ports that
158
#					  __pycache__ entries from a Python 2.x packaging list
141
#                                         do *not* use standard Python packaging mechanisms such as distutils
159
#					  when defined. Use this for ports that do *not* use
142
#                                         or setuptools, and support *both* Python 2.x and 3.x. Not needed when
160
#					  standard Python packaging mechanisms such as distutils
143
#                                         PYDISTUTILS_AUTOPLIST is defined.
161
#					  or setuptools, and support *both* Python 2.x and 3.x.
162
#					  Not needed when PYDISTUTILS_AUTOPLIST is defined.
144
#
163
#
145
# PYDISTUTILS_PKGNAME
164
# PYDISTUTILS_PKGNAME
146
#					- Internal name in the distutils for egg-info.
165
#					- Internal name in the distutils for egg-info.
Lines 411-416 Link Here
411
PYTHONPREFIX_LIBDIR=		${PYTHON_LIBDIR:S;${PYTHONBASE};${PREFIX};}
430
PYTHONPREFIX_LIBDIR=		${PYTHON_LIBDIR:S;${PYTHONBASE};${PREFIX};}
412
PYTHONPREFIX_SITELIBDIR=	${PYTHON_SITELIBDIR:S;${PYTHONBASE};${PREFIX};}
431
PYTHONPREFIX_SITELIBDIR=	${PYTHON_SITELIBDIR:S;${PYTHONBASE};${PREFIX};}
432
# Used for recording the installed files.
433
_PYTHONPKGLIST=				${WRKDIR}/.PLIST.pymodtmp
434
435
# Ports bound to a certain python version MUST
436
# - use the PYTHON_PKGNAMEPREFIX
437
# - use directories using the PYTHON_PKGNAMEPREFIX
438
# - will install binaries using the required PYTHON_PKGNAMEPREFIX, with
439
#   the default python version creating a symlink to the original binary
440
#   name (for staging-aware ports).
441
#
442
# What makes a port 'bound' to a certain python version?
443
# - it installs data into PYTHON_SITELIBDIR, PYTHON_INCLUDEDIR, ...
444
# - it links against libpython*.so
445
# - it uses USE_PYDISTUTILS
446
#
447
.if defined(NO_STAGE) && defined(UNIQUE_PYTHON_FILES)
448
BROKEN=	UNIQUE_PYTHON_FILES uses USES=uniquefiles, which is not stage-safe
449
.endif
450
.if !defined(NO_STAGE) && (defined(USE_PYDISTUTILS) || defined(UNIQUE_PYTHON_FILES))
451
_USES_POST+=	uniquefiles:dirs
452
.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION}
453
UNIQUE_DEFAULT_LINKS=	yes
454
.else
455
UNIQUE_DEFAULT_LINKS=	no
456
.endif
457
UNIQUE_PREFIX=			${PYTHON_PKGNAMEPREFIX}
458
UNIQUE_SUFFIX=			-${PYTHON_VER}
459
460
.if defined(PYDISTUTILS_AUTOPLIST)
461
UNIQUE_FIND_SUFFIX_FILES=	\
462
	${SED} -e 's|^${PREFIX}/||' ${_PYTHONPKGLIST} ${TMPPLIST} | \
463
	${GREP} -e '^bin/.*$$\|^sbin/.*$$\|^libexc/.*$$'
464
.else
465
UNIQUE_FIND_SUFFIX_FILES=	\
466
	${GREP} -he '^bin/.*$$\|^sbin/.*$$\|^libexec/.*$$' ${TMPPLIST} 2>/dev/null
467
.endif
468
.endif
469
413
_CURRENTPORT:=	${PKGNAMEPREFIX}${PORTNAME}
470
_CURRENTPORT:=	${PKGNAMEPREFIX}${PORTNAME}
414
.if defined(USE_PYDISTUTILS) && ${_CURRENTPORT} != ${PYTHON_PKGNAMEPREFIX}setuptools
471
.if defined(USE_PYDISTUTILS) && ${_CURRENTPORT} != ${PYTHON_PKGNAMEPREFIX}setuptools
415
BUILD_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}setuptools>0:${PORTSDIR}/devel/py-setuptools
472
BUILD_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}setuptools>0:${PORTSDIR}/devel/py-setuptools
Lines 494-500 Link Here
494
PYDISTUTILS_INSTALLARGS+=	--root=${STAGEDIR}
551
PYDISTUTILS_INSTALLARGS+=	--root=${STAGEDIR}
495
. endif
552
. endif
496
.endif
553
.endif
497
_PYTHONPKGLIST=				${WRKDIR}/.PLIST.pymodtmp
498
PYDISTUTILS_INSTALLARGS:=	--record ${_PYTHONPKGLIST} \
554
PYDISTUTILS_INSTALLARGS:=	--record ${_PYTHONPKGLIST} \
499
		${PYDISTUTILS_INSTALLARGS}
555
		${PYDISTUTILS_INSTALLARGS}

Return to bug 185947