* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2007-10-25 13:49 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2007-10-25 13:49 UTC (permalink / raw
To: gentoo-commits
hawking 07/10/25 13:49:11
Modified: distutils.eclass
Log:
removed deprecated mydoc, use DOCS
Revision Changes Path
1.44 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.44&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.44&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.43&r2=1.44
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- distutils.eclass 21 Aug 2007 18:17:59 -0000 1.43
+++ distutils.eclass 25 Oct 2007 13:49:10 -0000 1.44
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.43 2007/08/21 18:17:59 dev-zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.44 2007/10/25 13:49:10 hawking Exp $
#
# Author: Jon Nelson <jnelson@gentoo.org>
# Current Maintainer: Alastair Tse <liquidx@gentoo.org>
@@ -71,9 +71,6 @@
done
[ -n "${DOCS}" ] && dodoc ${DOCS}
-
- # deprecated! please use DOCS instead.
- [ -n "${mydoc}" ] && dodoc ${mydoc}
}
# generic pyc/pyo cleanup script.
--
gentoo-commits@gentoo.org mailing list
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-01-23 22:19 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-01-23 22:19 UTC (permalink / raw
To: gentoo-commits
hawking 08/01/23 22:19:05
Modified: distutils.eclass
Log:
Fixed ROOT usage for distutils_pkg_postinst failing when ROOT ends with slash
Revision Changes Path
1.45 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.45&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.45&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.44&r2=1.45
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- distutils.eclass 25 Oct 2007 13:49:10 -0000 1.44
+++ distutils.eclass 23 Jan 2008 22:19:04 -0000 1.45
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.44 2007/10/25 13:49:10 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.45 2008/01/23 22:19:04 hawking Exp $
#
# Author: Jon Nelson <jnelson@gentoo.org>
# Current Maintainer: Alastair Tse <liquidx@gentoo.org>
@@ -99,11 +99,14 @@
distutils_pkg_postinst() {
PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}}
+ # strip trailing slash
+ myroot="${ROOT%/}"
+
if has_version ">=dev-lang/python-2.3"; then
python_version
for pymod in ${PYTHON_MODNAME}; do
- if [ -d "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then
- python_mod_optimize ${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}
+ if [ -d "${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then
+ python_mod_optimize ${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}
fi
done
fi
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-05-29 15:24 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-05-29 15:24 UTC (permalink / raw
To: gentoo-commits
hawking 08/05/29 15:24:51
Modified: distutils.eclass
Log:
python_mod_optimize is ROOT aware.
Revision Changes Path
1.47 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.47&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.47&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.46&r2=1.47
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- distutils.eclass 28 Feb 2008 20:20:32 -0000 1.46
+++ distutils.eclass 29 May 2008 15:24:51 -0000 1.47
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.46 2008/02/28 20:20:32 dev-zero Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.47 2008/05/29 15:24:51 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -114,15 +114,11 @@
distutils_pkg_postinst() {
PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}}
- # strip trailing slash
- myroot="${ROOT%/}"
-
if has_version ">=dev-lang/python-2.3"; then
python_version
for pymod in ${PYTHON_MODNAME}; do
- if [ -d "${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then
- python_mod_optimize ${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}
- fi
+ python_mod_optimize \
+ /usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}
done
fi
}
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-05-30 10:22 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-05-30 10:22 UTC (permalink / raw
To: gentoo-commits
hawking 08/05/30 10:22:35
Modified: distutils.eclass
Log:
Changed maintainer to python@g.o. since liquidx retired.
Revision Changes Path
1.48 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.48&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.48&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.47&r2=1.48
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- distutils.eclass 29 May 2008 15:24:51 -0000 1.47
+++ distutils.eclass 30 May 2008 10:22:35 -0000 1.48
@@ -1,10 +1,10 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.47 2008/05/29 15:24:51 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.48 2008/05/30 10:22:35 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
-# Alastair Tse <liquidx@gentoo.org>
+# <python@gentoo.org>
#
# Original author: Jon Nelson <jnelson@gentoo.org>
# @BLURB: This eclass allows easier installation of distutils-based python modules
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-06-20 18:21 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-06-20 18:21 UTC (permalink / raw
To: gentoo-commits
hawking 08/06/20 18:21:39
Modified: distutils.eclass
Log:
Set default PYTHON_MODNAME only if the directory site-packages/PN exists. Thanks to ColdWind.
Revision Changes Path
1.49 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.49&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.49&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.48&r2=1.49
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- distutils.eclass 30 May 2008 10:22:35 -0000 1.48
+++ distutils.eclass 20 Jun 2008 18:21:39 -0000 1.49
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.48 2008/05/30 10:22:35 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.49 2008/06/20 18:21:39 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -90,7 +90,10 @@
# @DESCRIPTION:
# Generic pyc/pyo cleanup script. This function is exported.
distutils_pkg_postrm() {
- PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}}
+ if [[ -z "${PYTHON_MODNAME}" &&\
+ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]]; then
+ PYTHON_MODNAME=${PN}
+ fi
if has_version ">=dev-lang/python-2.3"; then
ebegin "Performing Python Module Cleanup .."
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-06-24 13:40 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-06-24 13:40 UTC (permalink / raw
To: gentoo-commits
hawking 08/06/24 13:40:50
Modified: distutils.eclass
Log:
Set default PYTHON_MODNAME only if the directory site-packages/PN exists for distutils_pkg_postinst.
Revision Changes Path
1.50 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.50&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.50&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.49&r2=1.50
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- distutils.eclass 20 Jun 2008 18:21:39 -0000 1.49
+++ distutils.eclass 24 Jun 2008 13:40:50 -0000 1.50
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.49 2008/06/20 18:21:39 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.50 2008/06/24 13:40:50 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -115,7 +115,10 @@
# This is a generic optimization, you should override it if your package
# installs things in another directory. This function is exported
distutils_pkg_postinst() {
- PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}}
+ if [[ -z "${PYTHON_MODNAME}" &&\
+ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]]; then
+ PYTHON_MODNAME=${PN}
+ fi
if has_version ">=dev-lang/python-2.3"; then
python_version
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-06-28 0:05 Luca Longinotti (chtekk)
0 siblings, 0 replies; 35+ messages in thread
From: Luca Longinotti (chtekk) @ 2008-06-28 0:05 UTC (permalink / raw
To: gentoo-commits
chtekk 08/06/28 00:05:41
Modified: distutils.eclass
Log:
Fix tests. Bash doesn't do filename expansion inside [[]].
Revision Changes Path
1.51 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.51&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.51&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.50&r2=1.51
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- distutils.eclass 24 Jun 2008 13:40:50 -0000 1.50
+++ distutils.eclass 28 Jun 2008 00:05:40 -0000 1.51
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.50 2008/06/24 13:40:50 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.51 2008/06/28 00:05:40 chtekk Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -90,8 +90,8 @@
# @DESCRIPTION:
# Generic pyc/pyo cleanup script. This function is exported.
distutils_pkg_postrm() {
- if [[ -z "${PYTHON_MODNAME}" &&\
- -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]]; then
+ if [ -z "${PYTHON_MODNAME}" ] && \
+ [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
PYTHON_MODNAME=${PN}
fi
@@ -115,8 +115,8 @@
# This is a generic optimization, you should override it if your package
# installs things in another directory. This function is exported
distutils_pkg_postinst() {
- if [[ -z "${PYTHON_MODNAME}" &&\
- -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]]; then
+ if [ -z "${PYTHON_MODNAME}" ] && \
+ [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
PYTHON_MODNAME=${PN}
fi
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-09-24 16:45 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-09-24 16:45 UTC (permalink / raw
To: gentoo-commits
hawking 08/09/24 16:45:09
Modified: distutils.eclass
Log:
Quoting. Add die messages.
Revision Changes Path
1.52 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.52&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.52&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.51&r2=1.52
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- distutils.eclass 28 Jun 2008 00:05:40 -0000 1.51
+++ distutils.eclass 24 Sep 2008 16:45:08 -0000 1.52
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.51 2008/06/28 00:05:40 chtekk Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.52 2008/09/24 16:45:08 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -71,9 +71,11 @@
[ -n "${pylibdir}" ] && dodir "${pylibdir}"
if has_version ">=dev-lang/python-2.3"; then
- ${python} setup.py install --root=${D} --no-compile "$@" || die
+ ${python} setup.py install --root="${D}" --no-compile "$@" ||\
+ die "python setup.py install failed"
else
- ${python} setup.py install --root=${D} "$@" || die
+ ${python} setup.py install --root="${D}" "$@" ||\
+ die "python setup.py install failed"
fi
DDOCS="CHANGELOG KNOWN_BUGS MAINTAINERS PKG-INFO CONTRIBUTORS TODO NEWS"
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-10-27 0:19 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-10-27 0:19 UTC (permalink / raw
To: gentoo-commits
hawking 08/10/27 00:19:46
Modified: distutils.eclass
Log:
distutils_src_install should call python_need_rebuild.
Revision Changes Path
1.53 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.53&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.53&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.52&r2=1.53
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- distutils.eclass 24 Sep 2008 16:45:08 -0000 1.52
+++ distutils.eclass 27 Oct 2008 00:19:46 -0000 1.53
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.52 2008/09/24 16:45:08 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.53 2008/10/27 00:19:46 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -63,6 +63,9 @@
# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS)
distutils_src_install() {
+ # Mark the package to be rebuilt after a python upgrade.
+ python_need_rebuild
+
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2008-10-28 21:29 Ali Polatel (hawking)
0 siblings, 0 replies; 35+ messages in thread
From: Ali Polatel (hawking) @ 2008-10-28 21:29 UTC (permalink / raw
To: gentoo-commits
hawking 08/10/28 21:29:28
Modified: distutils.eclass
Log:
fix distutils_pkg_post{inst,rm}.
Revision Changes Path
1.54 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.54&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.54&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.53&r2=1.54
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- distutils.eclass 27 Oct 2008 00:19:46 -0000 1.53
+++ distutils.eclass 28 Oct 2008 21:29:28 -0000 1.54
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.53 2008/10/27 00:19:46 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.54 2008/10/28 21:29:28 hawking Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -95,17 +95,23 @@
# @DESCRIPTION:
# Generic pyc/pyo cleanup script. This function is exported.
distutils_pkg_postrm() {
- if [ -z "${PYTHON_MODNAME}" ] && \
- [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
- PYTHON_MODNAME=${PN}
+ local moddir pylibdir pymod
+ if [[ -z "${PYTHON_MODNAME}" ]]; then
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then
+ PYTHON_MODNAME=${PN}
+ fi
+ done
fi
if has_version ">=dev-lang/python-2.3"; then
ebegin "Performing Python Module Cleanup .."
- if [ -n "${PYTHON_MODNAME}" ]; then
+ if [[ -n "${PYTHON_MODNAME}" ]]; then
for pymod in ${PYTHON_MODNAME}; do
- for moddir in "`ls -d --color=none -1 ${ROOT}usr/$(get_libdir)/python*/site-packages/${pymod} 2> /dev/null`"; do
- python_mod_cleanup ${moddir}
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ if [[ -d "${pylibdir}"/site-packages/${pymod} ]]; then
+ python_mod_cleanup "${pylibdir#${ROOT}}"/site-packages/${pymod}
+ fi
done
done
else
@@ -120,9 +126,13 @@
# This is a generic optimization, you should override it if your package
# installs things in another directory. This function is exported
distutils_pkg_postinst() {
- if [ -z "${PYTHON_MODNAME}" ] && \
- [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
- PYTHON_MODNAME=${PN}
+ local pylibdir pymod
+ if [[ -z "${PYTHON_MODNAME}" ]]; then
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then
+ PYTHON_MODNAME=${PN}
+ fi
+ done
fi
if has_version ">=dev-lang/python-2.3"; then
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-02-18 14:43 Peter Volkov (pva)
0 siblings, 0 replies; 35+ messages in thread
From: Peter Volkov (pva) @ 2009-02-18 14:43 UTC (permalink / raw
To: gentoo-commits
pva 09/02/18 14:43:31
Modified: distutils.eclass
Log:
Made eclass EAPI=2 aware, bug #255989.
Revision Changes Path
1.55 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.55&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.55&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.54&r2=1.55
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- distutils.eclass 28 Oct 2008 21:29:28 -0000 1.54
+++ distutils.eclass 18 Feb 2009 14:43:31 -0000 1.55
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.54 2008/10/28 21:29:28 hawking Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.55 2009/02/18 14:43:31 pva Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -17,6 +17,15 @@
inherit python multilib eutils
+case "${EAPI:-0}" in
+ 0|1)
+ EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm
+ ;;
+ *)
+ EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm
+ ;;
+esac
+
# @ECLASS-VARIABLE: PYTHON_SLOT_VERSION
# @DESCRIPTION:
# This helps make it possible to add extensions to python slots.
@@ -43,6 +52,13 @@
unpack ${A}
cd "${S}"
+ has ${EAPI:-0} 0 1 && distutils_src_prepare
+}
+
+# @FUNCTION: distutils_src_prepare
+# @DESCRIPTION:
+# The distutils src_prepare function, this function is exported
+distutils_src_prepare() {
# remove ez_setup stuff to prevent packages
# from installing setuptools on their own
rm -rf ez_setup*
@@ -159,4 +175,3 @@
python_tkinter_exists
}
-EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-08-02 0:30 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-08-02 0:30 UTC (permalink / raw
To: gentoo-commits
arfrever 09/08/02 00:30:29
Modified: distutils.eclass
Log:
Add missing echo and use $(get_python).
Revision Changes Path
1.57 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.57&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.57&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.56&r2=1.57
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- distutils.eclass 1 Aug 2009 22:36:20 -0000 1.56
+++ distutils.eclass 2 Aug 2009 00:30:29 -0000 1.57
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.56 2009/08/01 22:36:20 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.57 2009/08/02 00:30:29 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -71,7 +71,8 @@
distutils_src_compile() {
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
build_modules() {
- ${python} setup.py build -b "build-${PYTHON_ABI}" "$@"
+ echo "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" "$@"
+ "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" "$@"
}
python_execute_function build_modules "$@"
else
@@ -95,11 +96,11 @@
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
# - liquidx (14/08/2006)
- pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
+ pylibdir="$("$(get_python)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
- echo ${python} setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
- ${python} setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ echo "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
}
python_execute_function install_modules "$@"
else
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-08-05 18:34 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-08-05 18:34 UTC (permalink / raw
To: gentoo-commits
arfrever 09/08/05 18:34:57
Modified: distutils.eclass
Log:
Use PYTHON() instead of get_python().
Revision Changes Path
1.58 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.58&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.58&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.57&r2=1.58
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- distutils.eclass 2 Aug 2009 00:30:29 -0000 1.57
+++ distutils.eclass 5 Aug 2009 18:34:56 -0000 1.58
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.57 2009/08/02 00:30:29 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.58 2009/08/05 18:34:56 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -71,8 +71,8 @@
distutils_src_compile() {
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
build_modules() {
- echo "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" "$@"
- "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" "$@"
+ echo "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" "$@"
+ "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" "$@"
}
python_execute_function build_modules "$@"
else
@@ -86,6 +86,7 @@
# It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS,
# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS)
distutils_src_install() {
+ local pylibdir
# Mark the package to be rebuilt after a python upgrade.
python_need_rebuild
@@ -96,11 +97,11 @@
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
# - liquidx (14/08/2006)
- pylibdir="$("$(get_python)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
+ pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
- echo "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
- "$(get_python)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ echo "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
}
python_execute_function install_modules "$@"
else
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-08-12 2:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-08-12 2:24 UTC (permalink / raw
To: gentoo-commits
arfrever 09/08/12 02:24:34
Modified: distutils.eclass
Log:
Add checks for correct ebuild phase.
Revision Changes Path
1.59 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.59&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.59&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.58&r2=1.59
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- distutils.eclass 5 Aug 2009 18:34:56 -0000 1.58
+++ distutils.eclass 12 Aug 2009 02:24:34 -0000 1.59
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.58 2009/08/05 18:34:56 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.59 2009/08/12 02:24:34 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -12,10 +12,8 @@
# The distutils eclass is designed to allow easier installation of
# distutils-based python modules and their incorporation into
# the Gentoo Linux system.
-#
-# It inherits python, multilib, and eutils
-inherit python multilib eutils
+inherit eutils multilib python
case "${EAPI:-0}" in
0|1)
@@ -49,6 +47,10 @@
# @DESCRIPTION:
# The distutils src_unpack function, this function is exported
distutils_src_unpack() {
+ if [[ "${EBUILD_PHASE}" != "unpack" ]]; then
+ die "${FUNCNAME}() can be used only in src_unpack() phase"
+ fi
+
unpack ${A}
cd "${S}"
@@ -59,6 +61,10 @@
# @DESCRIPTION:
# The distutils src_prepare function, this function is exported
distutils_src_prepare() {
+ if ! has "${EAPI:-0}" 0 1 && [[ "${EBUILD_PHASE}" != "prepare" ]]; then
+ die "${FUNCNAME}() can be used only in src_prepare() phase"
+ fi
+
# remove ez_setup stuff to prevent packages
# from installing setuptools on their own
rm -rf ez_setup*
@@ -69,14 +75,19 @@
# @DESCRIPTION:
# The distutils src_compile function, this function is exported
distutils_src_compile() {
+ if [[ "${EBUILD_PHASE}" != "compile" ]]; then
+ die "${FUNCNAME}() can be used only in src_compile() phase"
+ fi
+
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- build_modules() {
+ building() {
echo "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" "$@"
"$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" "$@"
}
- python_execute_function build_modules "$@"
+ python_execute_function building "$@"
else
- ${python} setup.py build "$@" || die "compilation failed"
+ echo ${python} setup.py build "$@"
+ ${python} setup.py build "$@" || die "Building failed"
fi
}
@@ -86,13 +97,17 @@
# It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS,
# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS)
distutils_src_install() {
+ if [[ "${EBUILD_PHASE}" != "install" ]]; then
+ die "${FUNCNAME}() can be used only in src_install() phase"
+ fi
+
local pylibdir
# Mark the package to be rebuilt after a python upgrade.
python_need_rebuild
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- install_modules() {
+ installation() {
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
@@ -103,7 +118,7 @@
echo "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
"$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
}
- python_execute_function install_modules "$@"
+ python_execute_function installation "$@"
else
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
@@ -112,7 +127,8 @@
pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
- ${python} setup.py install --root="${D}" --no-compile "$@" || die "python setup.py install failed"
+ echo ${python} setup.py install --root="${D}" --no-compile "$@"
+ ${python} setup.py install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
DDOCS="CHANGELOG KNOWN_BUGS MAINTAINERS PKG-INFO CONTRIBUTORS TODO NEWS"
@@ -130,6 +146,10 @@
# @DESCRIPTION:
# Generic pyc/pyo cleanup script. This function is exported.
distutils_pkg_postrm() {
+ if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
+ die "${FUNCNAME}() can be used only in pkg_postrm() phase"
+ fi
+
local pylibdir pymod
if [[ -z "${PYTHON_MODNAME}" ]]; then
for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
@@ -139,7 +159,6 @@
done
fi
- ebegin "Performing cleanup of Python modules..."
if [[ -n "${PYTHON_MODNAME}" ]]; then
for pymod in ${PYTHON_MODNAME}; do
for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
@@ -155,7 +174,6 @@
else
python_mod_cleanup
fi
- eend 0
}
# @FUNCTION: distutils_pkg_postinst
@@ -163,6 +181,10 @@
# This is a generic optimization, you should override it if your package
# installs modules in another directory. This function is exported.
distutils_pkg_postinst() {
+ if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
+ die "${FUNCNAME}() can be used only in pkg_postinst() phase"
+ fi
+
local pylibdir pymod
if [[ -z "${PYTHON_MODNAME}" ]]; then
for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-09-05 16:45 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-09-05 16:45 UTC (permalink / raw
To: gentoo-commits
arfrever 09/09/05 16:45:35
Modified: distutils.eclass
Log:
Delete support for PYTHON_SLOT_VERSION. Add support for DISTUTILS_GLOBAL_OPTIONS.
Revision Changes Path
1.60 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.60&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.60&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.59&r2=1.60
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- distutils.eclass 12 Aug 2009 02:24:34 -0000 1.59
+++ distutils.eclass 5 Sep 2009 16:45:35 -0000 1.60
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.59 2009/08/12 02:24:34 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.60 2009/09/05 16:45:35 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -24,20 +24,13 @@
;;
esac
-# @ECLASS-VARIABLE: PYTHON_SLOT_VERSION
+DEPEND="virtual/python"
+RDEPEND="${DEPEND}"
+python="python"
+
+# @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS
# @DESCRIPTION:
-# This helps make it possible to add extensions to python slots.
-# Normally only a -py21- ebuild would set PYTHON_SLOT_VERSION.
-if [ "${PYTHON_SLOT_VERSION}" = "2.1" ] ; then
- DEPEND="=dev-lang/python-2.1*"
- python="python2.1"
-elif [ "${PYTHON_SLOT_VERSION}" = "2.3" ] ; then
- DEPEND="=dev-lang/python-2.3*"
- python="python2.3"
-else
- DEPEND="virtual/python"
- python="python"
-fi
+# Global options passed to setup.py.
# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION:
@@ -81,13 +74,13 @@
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
building() {
- echo "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" "$@"
- "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" "$@"
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
}
python_execute_function building "$@"
else
- echo ${python} setup.py build "$@"
- ${python} setup.py build "$@" || die "Building failed"
+ echo ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
+ ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
fi
}
@@ -115,8 +108,8 @@
pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
- echo "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
- "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
}
python_execute_function installation "$@"
else
@@ -127,8 +120,8 @@
pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
- echo ${python} setup.py install --root="${D}" --no-compile "$@"
- ${python} setup.py install --root="${D}" --no-compile "$@" || die "Installation failed"
+ echo ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
+ ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
DDOCS="CHANGELOG KNOWN_BUGS MAINTAINERS PKG-INFO CONTRIBUTORS TODO NEWS"
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-09-07 2:34 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-09-07 2:34 UTC (permalink / raw
To: gentoo-commits
arfrever 09/09/07 02:34:10
Modified: distutils.eclass
Log:
Add support for DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES. Create ez_setup.py only when it existed.
Revision Changes Path
1.61 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.61&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.61&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.60&r2=1.61
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- distutils.eclass 5 Sep 2009 16:45:35 -0000 1.60
+++ distutils.eclass 7 Sep 2009 02:34:10 -0000 1.61
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.60 2009/09/05 16:45:35 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.61 2009/09/07 02:34:10 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -28,6 +28,10 @@
RDEPEND="${DEPEND}"
python="python"
+# @ECLASS-VARIABLE: DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES
+# @DESCRIPTION:
+# Set this to use separate source directories for each enabled version of Python.
+
# @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS
# @DESCRIPTION:
# Global options passed to setup.py.
@@ -58,10 +62,18 @@
die "${FUNCNAME}() can be used only in src_prepare() phase"
fi
- # remove ez_setup stuff to prevent packages
- # from installing setuptools on their own
- rm -rf ez_setup*
- echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py
+ # Delete ez_setup files to prevent packages from installing
+ # setuptools on their own.
+ local ez_setup_py_existence
+ [[ -f ez_setup.py ]] && ez_setup_py_existence="1"
+ rm -fr ez_setup*
+ if [[ "${ez_setup_py_existence}" == "1" ]]; then
+ echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py
+ fi
+
+ if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
+ python_copy_sources
+ fi
}
# @FUNCTION: distutils_src_compile
@@ -73,11 +85,19 @@
fi
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- building() {
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
- }
- python_execute_function building "$@"
+ if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
+ building() {
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
+ }
+ python_execute_function -s building "$@"
+ else
+ building() {
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
+ }
+ python_execute_function building "$@"
+ fi
else
echo ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
@@ -100,18 +120,33 @@
python_need_rebuild
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- installation() {
- # need this for python-2.5 + setuptools in cases where
- # a package uses distutils but does not install anything
- # in site-packages. (eg. dev-java/java-config-2.x)
- # - liquidx (14/08/2006)
- pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
- [[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
-
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
- }
- python_execute_function installation "$@"
+ if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
+ installation() {
+ # need this for python-2.5 + setuptools in cases where
+ # a package uses distutils but does not install anything
+ # in site-packages. (eg. dev-java/java-config-2.x)
+ # - liquidx (14/08/2006)
+ pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
+ [[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
+
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
+ }
+ python_execute_function -s installation "$@"
+ else
+ installation() {
+ # need this for python-2.5 + setuptools in cases where
+ # a package uses distutils but does not install anything
+ # in site-packages. (eg. dev-java/java-config-2.x)
+ # - liquidx (14/08/2006)
+ pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
+ [[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
+
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ }
+ python_execute_function installation "$@"
+ fi
else
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-09-09 19:26 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-09-09 19:26 UTC (permalink / raw
To: gentoo-commits
arfrever 09/09/09 19:26:00
Modified: distutils.eclass
Log:
Add support for DISTUTILS_DISABLE_PYTHON_DEPENDENCY variable. Improve handling of documentation in distutils_src_install().
Revision Changes Path
1.62 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.62&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.62&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.61&r2=1.62
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- distutils.eclass 7 Sep 2009 02:34:10 -0000 1.61
+++ distutils.eclass 9 Sep 2009 19:26:00 -0000 1.62
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.61 2009/09/07 02:34:10 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.62 2009/09/09 19:26:00 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -24,8 +24,10 @@
;;
esac
-DEPEND="virtual/python"
-RDEPEND="${DEPEND}"
+if [[ -z "${DISTUTILS_DISABLE_PYTHON_DEPENDENCY}" ]]; then
+ DEPEND="virtual/python"
+ RDEPEND="${DEPEND}"
+fi
python="python"
# @ECLASS-VARIABLE: DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES
@@ -159,15 +161,17 @@
${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
- DDOCS="CHANGELOG KNOWN_BUGS MAINTAINERS PKG-INFO CONTRIBUTORS TODO NEWS"
- DDOCS="${DDOCS} Change* MANIFEST* README* AUTHORS"
+ local default_docs
+ default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS MANIFEST* NEWS PKG-INFO README* TODO"
local doc
- for doc in ${DDOCS}; do
- [[ -s "$doc" ]] && dodoc $doc
+ for doc in ${default_docs}; do
+ [[ -s "${doc}" ]] && dodoc "${doc}"
done
- [[ -n "${DOCS}" ]] && dodoc ${DOCS}
+ if [[ -n "${DOCS}" ]]; then
+ dodoc ${DOCS} || die "dodoc failed"
+ fi
}
# @FUNCTION: distutils_pkg_postrm
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-09-11 12:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-09-11 12:24 UTC (permalink / raw
To: gentoo-commits
arfrever 09/09/11 12:24:29
Modified: distutils.eclass
Log:
Fix detection of ez_setup in distutils_src_prepare(). Improve distutils_pkg_postinst() and distutils_pkg_postrm().
Revision Changes Path
1.63 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.63&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.63&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.62&r2=1.63
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- distutils.eclass 9 Sep 2009 19:26:00 -0000 1.62
+++ distutils.eclass 11 Sep 2009 12:24:29 -0000 1.63
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.62 2009/09/09 19:26:00 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.63 2009/09/11 12:24:29 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -66,10 +66,10 @@
# Delete ez_setup files to prevent packages from installing
# setuptools on their own.
- local ez_setup_py_existence
- [[ -f ez_setup.py ]] && ez_setup_py_existence="1"
+ local ez_setup_existence
+ [[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1"
rm -fr ez_setup*
- if [[ "${ez_setup_py_existence}" == "1" ]]; then
+ if [[ "${ez_setup_existence}" == "1" ]]; then
echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py
fi
@@ -174,12 +174,13 @@
fi
}
-# @FUNCTION: distutils_pkg_postrm
+# @FUNCTION: distutils_pkg_postinst
# @DESCRIPTION:
-# Generic pyc/pyo cleanup script. This function is exported.
-distutils_pkg_postrm() {
- if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
- die "${FUNCNAME}() can be used only in pkg_postrm() phase"
+# This is a generic optimization, you should override it if your package
+# installs modules in another directory. This function is exported.
+distutils_pkg_postinst() {
+ if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
+ die "${FUNCNAME}() can be used only in pkg_postinst() phase"
fi
local pylibdir pymod
@@ -191,30 +192,23 @@
done
fi
- if [[ -n "${PYTHON_MODNAME}" ]]; then
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
for pymod in ${PYTHON_MODNAME}; do
- for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
- if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- python_mod_cleanup "${pymod}"
- else
- python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}"
- fi
- fi
- done
+ python_mod_optimize "${pymod}"
done
else
- python_mod_cleanup
+ for pymod in ${PYTHON_MODNAME}; do
+ python_mod_optimize "$(python_get_sitedir)/${pymod}"
+ done
fi
}
-# @FUNCTION: distutils_pkg_postinst
+# @FUNCTION: distutils_pkg_postrm
# @DESCRIPTION:
-# This is a generic optimization, you should override it if your package
-# installs modules in another directory. This function is exported.
-distutils_pkg_postinst() {
- if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
- die "${FUNCNAME}() can be used only in pkg_postinst() phase"
+# Generic pyc/pyo cleanup script. This function is exported.
+distutils_pkg_postrm() {
+ if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
+ die "${FUNCNAME}() can be used only in pkg_postrm() phase"
fi
local pylibdir pymod
@@ -226,15 +220,20 @@
done
fi
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if [[ -n "${PYTHON_MODNAME}" ]]; then
for pymod in ${PYTHON_MODNAME}; do
- python_mod_optimize "${pymod}"
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ python_mod_cleanup "${pymod}"
+ else
+ for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
+ python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}"
+ fi
+ done
+ fi
done
else
- python_version
- for pymod in ${PYTHON_MODNAME}; do
- python_mod_optimize "/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}"
- done
+ python_mod_cleanup
fi
}
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-09-11 20:03 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-09-11 20:03 UTC (permalink / raw
To: gentoo-commits
arfrever 09/09/11 20:03:51
Modified: distutils.eclass
Log:
Disallow installation into /usr/local.
Revision Changes Path
1.64 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.64&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.64&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.63&r2=1.64
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- distutils.eclass 11 Sep 2009 12:24:29 -0000 1.63
+++ distutils.eclass 11 Sep 2009 20:03:51 -0000 1.64
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.63 2009/09/11 12:24:29 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.64 2009/09/11 20:03:51 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -161,6 +161,10 @@
${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
+ if [[ -e "${D}usr/local" ]]; then
+ die "Illegal installation into /usr/local"
+ fi
+
local default_docs
default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS MANIFEST* NEWS PKG-INFO README* TODO"
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-10-11 13:38 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-10-11 13:38 UTC (permalink / raw
To: gentoo-commits
arfrever 09/10/11 13:38:13
Modified: distutils.eclass
Log:
Optimize calls to python_mod_optimize() / python_mod_cleanup() in distutils_pkg_postinst() and distutils_pkg_postrm().
Revision Changes Path
1.65 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.65&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.65&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.64&r2=1.65
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- distutils.eclass 11 Sep 2009 20:03:51 -0000 1.64
+++ distutils.eclass 11 Oct 2009 13:38:12 -0000 1.65
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.64 2009/09/11 20:03:51 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.65 2009/10/11 13:38:12 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -197,9 +197,7 @@
fi
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- for pymod in ${PYTHON_MODNAME}; do
- python_mod_optimize "${pymod}"
- done
+ python_mod_optimize ${PYTHON_MODNAME}
else
for pymod in ${PYTHON_MODNAME}; do
python_mod_optimize "$(python_get_sitedir)/${pymod}"
@@ -225,17 +223,17 @@
fi
if [[ -n "${PYTHON_MODNAME}" ]]; then
- for pymod in ${PYTHON_MODNAME}; do
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- python_mod_cleanup "${pymod}"
- else
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ python_mod_cleanup ${PYTHON_MODNAME}
+ else
+ for pymod in ${PYTHON_MODNAME}; do
for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}"
fi
done
- fi
- done
+ done
+ fi
else
python_mod_cleanup
fi
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-11-06 0:35 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-11-06 0:35 UTC (permalink / raw
To: gentoo-commits
arfrever 09/11/06 00:35:30
Modified: distutils.eclass
Log:
Handle distribute_setup module in distutils_src_prepare().
Revision Changes Path
1.66 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.66&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.66&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.65&r2=1.66
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- distutils.eclass 11 Oct 2009 13:38:12 -0000 1.65
+++ distutils.eclass 6 Nov 2009 00:35:30 -0000 1.66
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.65 2009/10/11 13:38:12 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.66 2009/11/06 00:35:30 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -65,14 +65,23 @@
fi
# Delete ez_setup files to prevent packages from installing
- # setuptools on their own.
- local ez_setup_existence
+ # Setuptools on their own.
+ local ez_setup_existence="0"
[[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1"
rm -fr ez_setup*
if [[ "${ez_setup_existence}" == "1" ]]; then
echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py
fi
+ # Delete distribute_setup files to prevent packages from installing
+ # Distribute on their own.
+ local distribute_setup_existence="0"
+ [[ -d distribute_setup || -f distribute_setup.py ]] && distribute_setup_existence="1"
+ rm -fr distribute_setup*
+ if [[ "${distribute_setup_existence}" == "1" ]]; then
+ echo "def use_setuptools(*args, **kwargs): pass" > distribute_setup.py
+ fi
+
if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
python_copy_sources
fi
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-11-28 18:39 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-11-28 18:39 UTC (permalink / raw
To: gentoo-commits
arfrever 09/11/28 18:39:27
Modified: distutils.eclass
Log:
Add support for distutils_src_{compile,install}_{pre,post}_hook(). Use $(PYTHON ${PYVER}) instead of ${python} in distutils_src_compile() and distutils_src_install() to support multilib systems in older EAPIs.
Revision Changes Path
1.67 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.67&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.67&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.66&r2=1.67
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- distutils.eclass 6 Nov 2009 00:35:30 -0000 1.66
+++ distutils.eclass 28 Nov 2009 18:39:27 -0000 1.67
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.66 2009/11/06 00:35:30 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.67 2009/11/28 18:39:27 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -42,9 +42,18 @@
# @DESCRIPTION:
# Additional DOCS
+_distutils_hook() {
+ if [[ "$#" -ne 1 ]]; then
+ die "${FUNCNAME}() requires 1 argument"
+ fi
+ if [[ "$(type -t "distutils_src_${EBUILD_PHASE}_$1_hook")" == "function" ]]; then
+ "distutils_src_${EBUILD_PHASE}_$1_hook"
+ fi
+}
+
# @FUNCTION: distutils_src_unpack
# @DESCRIPTION:
-# The distutils src_unpack function, this function is exported
+# The distutils src_unpack function, this function is exported.
distutils_src_unpack() {
if [[ "${EBUILD_PHASE}" != "unpack" ]]; then
die "${FUNCNAME}() can be used only in src_unpack() phase"
@@ -58,7 +67,7 @@
# @FUNCTION: distutils_src_prepare
# @DESCRIPTION:
-# The distutils src_prepare function, this function is exported
+# The distutils src_prepare function, this function is exported.
distutils_src_prepare() {
if ! has "${EAPI:-0}" 0 1 && [[ "${EBUILD_PHASE}" != "prepare" ]]; then
die "${FUNCNAME}() can be used only in src_prepare() phase"
@@ -89,7 +98,9 @@
# @FUNCTION: distutils_src_compile
# @DESCRIPTION:
-# The distutils src_compile function, this function is exported
+# The distutils src_compile function, this function is exported.
+# In newer EAPIs this function calls distutils_src_compile_pre_hook() and
+# distutils_src_compile_post_hook(), if they are defined.
distutils_src_compile() {
if [[ "${EBUILD_PHASE}" != "compile" ]]; then
die "${FUNCNAME}() can be used only in src_compile() phase"
@@ -98,26 +109,37 @@
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
building() {
+ _distutils_hook pre
+
echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || return "$?"
+
+ _distutils_hook post
}
python_execute_function -s building "$@"
else
building() {
+ _distutils_hook pre
+
echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@" || return "$?"
+
+ _distutils_hook post
}
python_execute_function building "$@"
fi
else
- echo ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
- ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ python_version
+ echo "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
+ "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
fi
}
# @FUNCTION: distutils_src_install
# @DESCRIPTION:
# The distutils src_install function, this function is exported.
+# In newer EAPIs this function calls distutils_src_install_pre_hook() and
+# distutils_src_install_post_hook(), if they are defined.
# It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS,
# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS)
distutils_src_install() {
@@ -133,6 +155,8 @@
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
installation() {
+ _distutils_hook pre
+
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
@@ -141,11 +165,15 @@
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || return "$?"
+
+ _distutils_hook post
}
python_execute_function -s installation "$@"
else
installation() {
+ _distutils_hook pre
+
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
@@ -154,7 +182,9 @@
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@" || return "$?"
+
+ _distutils_hook post
}
python_execute_function installation "$@"
fi
@@ -163,11 +193,11 @@
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
# - liquidx (14/08/2006)
- pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
+ pylibdir="$("$(PYTHON "${PYVER}")" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
- echo ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
- ${python} setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+ echo "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
if [[ -e "${D}usr/local" ]]; then
@@ -251,7 +281,7 @@
# @FUNCTION: distutils_python_version
# @DESCRIPTION:
# Calls python_version, so that you can use something like
-# e.g. insinto ${ROOT}/usr/include/python${PYVER}
+# e.g. insinto ${ROOT}/usr/include/python${PYVER}
distutils_python_version() {
python_version
}
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2009-12-24 4:21 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2009-12-24 4:21 UTC (permalink / raw
To: gentoo-commits
arfrever 09/12/24 04:21:39
Modified: distutils.eclass
Log:
Disallow using of ${python}, distutils_python_version() and distutils_python_tkinter() in EAPI >=3. Add renaming of Python scripts containing versioned shebangs and generation of wrapper scripts.
Revision Changes Path
1.68 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.68&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.68&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.67&r2=1.68
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- distutils.eclass 28 Nov 2009 18:39:27 -0000 1.67
+++ distutils.eclass 24 Dec 2009 04:21:39 -0000 1.68
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.67 2009/11/28 18:39:27 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.68 2009/12/24 04:21:39 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -28,7 +28,12 @@
DEPEND="virtual/python"
RDEPEND="${DEPEND}"
fi
-python="python"
+
+if has "${EAPI:-0}" 0 1 2; then
+ python="python"
+else
+ python="die"
+fi
# @ECLASS-VARIABLE: DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES
# @DESCRIPTION:
@@ -38,6 +43,11 @@
# @DESCRIPTION:
# Global options passed to setup.py.
+# @ECLASS-VARIABLE: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS
+# @DESCRIPTION:
+# Set this to disable renaming of Python scripts containing versioned shebangs
+# and generation of wrapper scripts.
+
# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION:
# Additional DOCS
@@ -153,6 +163,24 @@
python_need_rebuild
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
+ declare -A wrapper_scripts=()
+
+ rename_scripts_with_versioned_shebangs() {
+ if [[ -d "${D}usr/bin" ]]; then
+ cd "${D}usr/bin"
+
+ local file
+ for file in *; do
+ if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]]+$ && "$(head -n1 "${file}")" =~ ^'#!'.*python[[:digit:]]+\.[[:digit:]]+ ]]; then
+ mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed"
+ wrapper_scripts+=(["${D}usr/bin/${file}"]=)
+ fi
+ done
+ fi
+ }
+ fi
+
if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
installation() {
_distutils_hook pre
@@ -167,6 +195,10 @@
echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || return "$?"
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
+ rename_scripts_with_versioned_shebangs
+ fi
+
_distutils_hook post
}
python_execute_function -s installation "$@"
@@ -184,10 +216,19 @@
echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@" || return "$?"
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
+ rename_scripts_with_versioned_shebangs
+ fi
+
_distutils_hook post
}
python_execute_function installation "$@"
fi
+
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${#wrapper_scripts[@]}" -ne "0" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
+ python_generate_wrapper_scripts "${!wrapper_scripts[@]}"
+ fi
+ unset wrapper_scripts
else
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
@@ -283,6 +324,10 @@
# Calls python_version, so that you can use something like
# e.g. insinto ${ROOT}/usr/include/python${PYVER}
distutils_python_version() {
+ if ! has "${EAPI:-0}" 0 1 2; then
+ die "${FUNCNAME}() cannot be used in this EAPI"
+ fi
+
python_version
}
@@ -290,5 +335,9 @@
# @DESCRIPTION:
# Checks for if tkinter support is compiled into python
distutils_python_tkinter() {
+ if ! has "${EAPI:-0}" 0 1 2; then
+ die "${FUNCNAME}() cannot be used in this EAPI"
+ fi
+
python_tkinter_exists
}
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-01-10 17:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-01-10 17:24 UTC (permalink / raw
To: gentoo-commits
arfrever 10/01/10 17:24:33
Modified: distutils.eclass
Log:
Use $(PYTHON -A) instead of $(PYTHON ${PYVER}).
Revision Changes Path
1.69 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.69&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.69&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.68&r2=1.69
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- distutils.eclass 24 Dec 2009 04:21:39 -0000 1.68
+++ distutils.eclass 10 Jan 2010 17:24:32 -0000 1.69
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.68 2009/12/24 04:21:39 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.69 2010/01/10 17:24:32 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -139,9 +139,8 @@
python_execute_function building "$@"
fi
else
- python_version
- echo "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
- "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
+ "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
fi
}
@@ -159,9 +158,6 @@
local pylibdir
- # Mark the package to be rebuilt after a python upgrade.
- python_need_rebuild
-
if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
declare -A wrapper_scripts=()
@@ -230,15 +226,18 @@
fi
unset wrapper_scripts
else
+ # Mark the package to be rebuilt after a Python upgrade.
+ python_need_rebuild
+
# need this for python-2.5 + setuptools in cases where
# a package uses distutils but does not install anything
# in site-packages. (eg. dev-java/java-config-2.x)
# - liquidx (14/08/2006)
- pylibdir="$("$(PYTHON "${PYVER}")" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
+ pylibdir="$("$(PYTHON -A)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
[[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
- echo "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
- "$(PYTHON "${PYVER}")" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+ echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
+ "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
if [[ -e "${D}usr/local" ]]; then
@@ -322,7 +321,7 @@
# @FUNCTION: distutils_python_version
# @DESCRIPTION:
# Calls python_version, so that you can use something like
-# e.g. insinto ${ROOT}/usr/include/python${PYVER}
+# e.g. insinto $(python_get_includedir)
distutils_python_version() {
if ! has "${EAPI:-0}" 0 1 2; then
die "${FUNCNAME}() cannot be used in this EAPI"
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-02-04 18:31 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-02-04 18:31 UTC (permalink / raw
To: gentoo-commits
arfrever 10/02/04 18:31:45
Modified: distutils.eclass
Log:
Delete support for DISTUTILS_DISABLE_PYTHON_DEPENDENCY and check PYTHON_DEPEND.
Support DISTUTILS_SRC_TEST and DISTUTILS_DISABLE_TEST_DEPENDENCY.
Add distutils_src_test().
Simplify distutils_src_compile() and distutils_src_install() by extracting of differing code to _distutils_get_build_dir() and _distutils_get_PYTHONPATH().
Delete no longer needed code in distutils_src_install().
Revision Changes Path
1.70 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.70&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.70&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.69&r2=1.70
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- distutils.eclass 10 Jan 2010 17:24:32 -0000 1.69
+++ distutils.eclass 4 Feb 2010 18:31:44 -0000 1.70
@@ -1,19 +1,17 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.69 2010/01/10 17:24:32 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.70 2010/02/04 18:31:44 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
-# <python@gentoo.org>
+# Gentoo Python Project <python@gentoo.org>
#
# Original author: Jon Nelson <jnelson@gentoo.org>
-# @BLURB: This eclass allows easier installation of distutils-based python modules
+# @BLURB: Eclass for packages with build systems using Distutils
# @DESCRIPTION:
-# The distutils eclass is designed to allow easier installation of
-# distutils-based python modules and their incorporation into
-# the Gentoo Linux system.
+# The distutils eclass defines phase functions for packages with build systems using Distutils
-inherit eutils multilib python
+inherit multilib python
case "${EAPI:-0}" in
0|1)
@@ -24,7 +22,7 @@
;;
esac
-if [[ -z "${DISTUTILS_DISABLE_PYTHON_DEPENDENCY}" ]]; then
+if [[ -z "${PYTHON_DEPEND}" ]]; then
DEPEND="virtual/python"
RDEPEND="${DEPEND}"
fi
@@ -32,6 +30,7 @@
if has "${EAPI:-0}" 0 1 2; then
python="python"
else
+ # Use "$(PYTHON)" or "$(PYTHON -A)" instead of "${python}".
python="die"
fi
@@ -43,6 +42,42 @@
# @DESCRIPTION:
# Global options passed to setup.py.
+# @ECLASS-VARIABLE: DISTUTILS_SRC_TEST
+# @DESCRIPTION:
+# Type of test command used by distutils_src_test().
+# IUSE and DEPEND are automatically adjusted, unless DISTUTILS_DISABLE_TEST_DEPENDENCY is set.
+# Valid values:
+# setup.py
+# nosetests
+# py.test
+# trial [arguments]
+
+# @ECLASS-VARIABLE: DISTUTILS_DISABLE_TEST_DEPENDENCY
+# @DESCRIPTION:
+# Disable modification of IUSE and DEPEND caused by setting of DISTUTILS_SRC_TEST.
+
+if [[ -n "${DISTUTILS_SRC_TEST}" && ! "${DISTUTILS_SRC_TEST}" =~ ^(setup\.py|nosetests|py\.test|trial(\ .*)?)$ ]]; then
+ die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'"
+fi
+
+if [[ -z "${DISTUTILS_DISABLE_TEST_DEPENDENCY}" ]]; then
+ if [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
+ IUSE="test"
+ DEPEND+="${DEPEND:+ }test? ( dev-python/nose )"
+ elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then
+ IUSE="test"
+ DEPEND+="${DEPEND:+ }test? ( dev-python/py )"
+ # trial requires an argument, which is usually equal to "${PN}".
+ elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then
+ IUSE="test"
+ DEPEND+="${DEPEND:+ }test? ( dev-python/twisted )"
+ fi
+fi
+
+if [[ -n "${DISTUTILS_SRC_TEST}" ]]; then
+ EXPORT_FUNCTIONS src_test
+fi
+
# @ECLASS-VARIABLE: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS
# @DESCRIPTION:
# Set this to disable renaming of Python scripts containing versioned shebangs
@@ -50,7 +85,23 @@
# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION:
-# Additional DOCS
+# Additional documentation files installed by distutils_src_install().
+
+_distutils_get_build_dir() {
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" && -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
+ echo "build-${PYTHON_ABI}"
+ else
+ echo "build"
+ fi
+}
+
+_distutils_get_PYTHONPATH() {
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" && -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
+ ls -d build-${PYTHON_ABI}/lib* 2> /dev/null
+ else
+ ls -d build/lib* 2> /dev/null
+ fi
+}
_distutils_hook() {
if [[ "$#" -ne 1 ]]; then
@@ -63,7 +114,7 @@
# @FUNCTION: distutils_src_unpack
# @DESCRIPTION:
-# The distutils src_unpack function, this function is exported.
+# The distutils src_unpack function. This function is exported.
distutils_src_unpack() {
if [[ "${EBUILD_PHASE}" != "unpack" ]]; then
die "${FUNCNAME}() can be used only in src_unpack() phase"
@@ -77,14 +128,13 @@
# @FUNCTION: distutils_src_prepare
# @DESCRIPTION:
-# The distutils src_prepare function, this function is exported.
+# The distutils src_prepare function. This function is exported.
distutils_src_prepare() {
if ! has "${EAPI:-0}" 0 1 && [[ "${EBUILD_PHASE}" != "prepare" ]]; then
die "${FUNCNAME}() can be used only in src_prepare() phase"
fi
- # Delete ez_setup files to prevent packages from installing
- # Setuptools on their own.
+ # Delete ez_setup files to prevent packages from installing Setuptools on their own.
local ez_setup_existence="0"
[[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1"
rm -fr ez_setup*
@@ -92,8 +142,7 @@
echo "def use_setuptools(*args, **kwargs): pass" > ez_setup.py
fi
- # Delete distribute_setup files to prevent packages from installing
- # Distribute on their own.
+ # Delete distribute_setup files to prevent packages from installing Distribute on their own.
local distribute_setup_existence="0"
[[ -d distribute_setup || -f distribute_setup.py ]] && distribute_setup_existence="1"
rm -fr distribute_setup*
@@ -108,58 +157,78 @@
# @FUNCTION: distutils_src_compile
# @DESCRIPTION:
-# The distutils src_compile function, this function is exported.
-# In newer EAPIs this function calls distutils_src_compile_pre_hook() and
-# distutils_src_compile_post_hook(), if they are defined.
+# The distutils src_compile function. This function is exported.
+# In ebuilds of packages supporting installation for multiple versions of Python, this function
+# calls distutils_src_compile_pre_hook() and distutils_src_compile_post_hook(), if they are defined.
distutils_src_compile() {
if [[ "${EBUILD_PHASE}" != "compile" ]]; then
die "${FUNCNAME}() can be used only in src_compile() phase"
fi
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
- building() {
- _distutils_hook pre
-
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || return "$?"
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ distutils_building() {
+ _distutils_hook pre
+
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
+
+ _distutils_hook post
+ }
+ python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@"
+ else
+ echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
+ "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ fi
+}
- _distutils_hook post
+# @FUNCTION: distutils_src_test
+# @DESCRIPTION:
+# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set.
+distutils_src_test() {
+ if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ distutils_testing() {
+ echo PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"
}
- python_execute_function -s building "$@"
+ python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@"
else
- building() {
- _distutils_hook pre
-
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" "$@" || return "$?"
-
- _distutils_hook post
- }
- python_execute_function building "$@"
+ echo PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+ fi
+ elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
+ python_execute_nosetests -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
+ elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then
+ python_execute_py.test -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
+ # trial requires an argument, which is usually equal to "${PN}".
+ elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then
+ local trial_arguments
+ if [[ "${DISTUTILS_SRC_TEST}" == "trial "* ]]; then
+ trial_arguments="${DISTUTILS_SRC_TEST#trial }"
+ else
+ trial_arguments="${PN}"
fi
+
+ python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${trial_arguments} "$@"
else
- echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
- "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'"
fi
}
# @FUNCTION: distutils_src_install
# @DESCRIPTION:
-# The distutils src_install function, this function is exported.
-# In newer EAPIs this function calls distutils_src_install_pre_hook() and
-# distutils_src_install_post_hook(), if they are defined.
-# It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS,
-# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS)
+# The distutils src_install function. This function is exported.
+# In ebuilds of packages supporting installation for multiple versions of Python, this function
+# calls distutils_src_install_pre_hook() and distutils_src_install_post_hook(), if they are defined.
+# It also installs some standard documentation files (AUTHORS, Change*, CHANGELOG, CONTRIBUTORS,
+# KNOWN_BUGS, MAINTAINERS, MANIFEST*, NEWS, PKG-INFO, README*, TODO).
distutils_src_install() {
if [[ "${EBUILD_PHASE}" != "install" ]]; then
die "${FUNCNAME}() can be used only in src_install() phase"
fi
- local pylibdir
-
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
+ if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
declare -A wrapper_scripts=()
rename_scripts_with_versioned_shebangs() {
@@ -177,51 +246,21 @@
}
fi
- if [[ -n "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
- installation() {
- _distutils_hook pre
-
- # need this for python-2.5 + setuptools in cases where
- # a package uses distutils but does not install anything
- # in site-packages. (eg. dev-java/java-config-2.x)
- # - liquidx (14/08/2006)
- pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
- [[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
+ distutils_installation() {
+ _distutils_hook pre
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || return "$?"
+ echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?"
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
- rename_scripts_with_versioned_shebangs
- fi
-
- _distutils_hook post
- }
- python_execute_function -s installation "$@"
- else
- installation() {
- _distutils_hook pre
-
- # need this for python-2.5 + setuptools in cases where
- # a package uses distutils but does not install anything
- # in site-packages. (eg. dev-java/java-config-2.x)
- # - liquidx (14/08/2006)
- pylibdir="$("$(PYTHON)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
- [[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
-
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@"
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "build-${PYTHON_ABI}" install --root="${D}" --no-compile "$@" || return "$?"
-
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
- rename_scripts_with_versioned_shebangs
- fi
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
+ rename_scripts_with_versioned_shebangs
+ fi
- _distutils_hook post
- }
- python_execute_function installation "$@"
- fi
+ _distutils_hook post
+ }
+ python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_installation "$@"
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${#wrapper_scripts[@]}" -ne "0" && "${BASH_VERSINFO[0]}" -ge "4" ]]; then
+ if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${#wrapper_scripts[@]}" -ne 0 && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
python_generate_wrapper_scripts "${!wrapper_scripts[@]}"
fi
unset wrapper_scripts
@@ -229,13 +268,6 @@
# Mark the package to be rebuilt after a Python upgrade.
python_need_rebuild
- # need this for python-2.5 + setuptools in cases where
- # a package uses distutils but does not install anything
- # in site-packages. (eg. dev-java/java-config-2.x)
- # - liquidx (14/08/2006)
- pylibdir="$("$(PYTHON -A)" -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
- [[ -n "${pylibdir}" ]] && dodir "${pylibdir}"
-
echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
"$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
@@ -259,8 +291,10 @@
# @FUNCTION: distutils_pkg_postinst
# @DESCRIPTION:
-# This is a generic optimization, you should override it if your package
-# installs modules in another directory. This function is exported.
+# The distutils pkg_postinst function. This function is exported.
+# When PYTHON_MODNAME variable is set, then this function calls python_mod_optimize() with modules
+# specified in PYTHON_MODNAME variable. Otherwise it calls python_mod_optimize() with module, whose
+# name is equal to name of current package, if this module exists.
distutils_pkg_postinst() {
if [[ "${EBUILD_PHASE}" != "postinst" ]]; then
die "${FUNCNAME}() can be used only in pkg_postinst() phase"
@@ -286,7 +320,10 @@
# @FUNCTION: distutils_pkg_postrm
# @DESCRIPTION:
-# Generic pyc/pyo cleanup script. This function is exported.
+# The distutils pkg_postrm function. This function is exported.
+# When PYTHON_MODNAME variable is set, then this function calls python_mod_cleanup() with modules
+# specified in PYTHON_MODNAME variable. Otherwise it calls python_mod_cleanup() with module, whose
+# name is equal to name of current package, if this module exists.
distutils_pkg_postrm() {
if [[ "${EBUILD_PHASE}" != "postrm" ]]; then
die "${FUNCNAME}() can be used only in pkg_postrm() phase"
@@ -320,10 +357,10 @@
# @FUNCTION: distutils_python_version
# @DESCRIPTION:
-# Calls python_version, so that you can use something like
-# e.g. insinto $(python_get_includedir)
+# Deprecated wrapper function for deprecated python_version().
distutils_python_version() {
if ! has "${EAPI:-0}" 0 1 2; then
+ eerror "Use PYTHON() and/or python_get_*() instead of ${FUNCNAME}()."
die "${FUNCNAME}() cannot be used in this EAPI"
fi
@@ -332,9 +369,10 @@
# @FUNCTION: distutils_python_tkinter
# @DESCRIPTION:
-# Checks for if tkinter support is compiled into python
+# Deprecated wrapper function for python_tkinter_exists().
distutils_python_tkinter() {
if ! has "${EAPI:-0}" 0 1 2; then
+ eerror "Use python_tkinter_exists() instead of ${FUNCNAME}()."
die "${FUNCNAME}() cannot be used in this EAPI"
fi
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-02-07 21:17 Peter Volkov (pva)
0 siblings, 0 replies; 35+ messages in thread
From: Peter Volkov (pva) @ 2010-02-07 21:17 UTC (permalink / raw
To: gentoo-commits
pva 10/02/07 21:17:15
Modified: distutils.eclass
Log:
revert dropped inherit eutils: 172 ebuilds are still broken with this change atm; after I fix them I'll revert this.
Revision Changes Path
1.71 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.71&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.71&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.70&r2=1.71
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- distutils.eclass 4 Feb 2010 18:31:44 -0000 1.70
+++ distutils.eclass 7 Feb 2010 21:17:15 -0000 1.71
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.70 2010/02/04 18:31:44 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.71 2010/02/07 21:17:15 pva Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -11,7 +11,7 @@
# @DESCRIPTION:
# The distutils eclass defines phase functions for packages with build systems using Distutils
-inherit multilib python
+inherit eutils multilib python
case "${EAPI:-0}" in
0|1)
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-02-08 9:35 Peter Volkov (pva)
0 siblings, 0 replies; 35+ messages in thread
From: Peter Volkov (pva) @ 2010-02-08 9:35 UTC (permalink / raw
To: gentoo-commits
pva 10/02/08 09:35:39
Modified: distutils.eclass
Log:
dropped inherit eutils: all ebuilds should be fixed in the tree.
Revision Changes Path
1.72 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.72&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.72&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.71&r2=1.72
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- distutils.eclass 7 Feb 2010 21:17:15 -0000 1.71
+++ distutils.eclass 8 Feb 2010 09:35:38 -0000 1.72
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.71 2010/02/07 21:17:15 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.72 2010/02/08 09:35:38 pva Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -11,7 +11,7 @@
# @DESCRIPTION:
# The distutils eclass defines phase functions for packages with build systems using Distutils
-inherit eutils multilib python
+inherit multilib python
case "${EAPI:-0}" in
0|1)
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-02-28 11:52 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-02-28 11:52 UTC (permalink / raw
To: gentoo-commits
arfrever 10/02/28 11:52:22
Modified: distutils.eclass
Log:
Do not export distutils_src_unpack() in EAPI >=2 and disallow using of distutils_src_unpack() in EAPI >=2.
Improve output of distutils_src_compile(), distutils_src_test() and distutils_src_install().
Check for Jython-related directories in distutils_pkg_postinst() and distutils_pkg_postrm().
Revision Changes Path
1.73 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.73&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.73&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.72&r2=1.73
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- distutils.eclass 8 Feb 2010 09:35:38 -0000 1.72
+++ distutils.eclass 28 Feb 2010 11:52:22 -0000 1.73
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.72 2010/02/08 09:35:38 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.73 2010/02/28 11:52:22 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -9,7 +9,7 @@
# Original author: Jon Nelson <jnelson@gentoo.org>
# @BLURB: Eclass for packages with build systems using Distutils
# @DESCRIPTION:
-# The distutils eclass defines phase functions for packages with build systems using Distutils
+# The distutils eclass defines phase functions for packages with build systems using Distutils.
inherit multilib python
@@ -18,19 +18,19 @@
EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm
;;
*)
- EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm
+ EXPORT_FUNCTIONS src_prepare src_compile src_install pkg_postinst pkg_postrm
;;
esac
if [[ -z "${PYTHON_DEPEND}" ]]; then
- DEPEND="virtual/python"
+ DEPEND="dev-lang/python"
RDEPEND="${DEPEND}"
fi
-if has "${EAPI:-0}" 0 1 2; then
+if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
python="python"
else
- # Use "$(PYTHON)" or "$(PYTHON -A)" instead of "${python}".
+ # Use "$(PYTHON)" instead of "${python}".
python="die"
fi
@@ -83,6 +83,11 @@
# Set this to disable renaming of Python scripts containing versioned shebangs
# and generation of wrapper scripts.
+# @ECLASS-VARIABLE: DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS
+# @DESCRIPTION:
+# List of paths to Python scripts, relative to ${D}, which are excluded from
+# renaming and generation of wrapper scripts.
+
# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION:
# Additional documentation files installed by distutils_src_install().
@@ -116,6 +121,10 @@
# @DESCRIPTION:
# The distutils src_unpack function. This function is exported.
distutils_src_unpack() {
+ if ! has "${EAPI:-0}" 0 1; then
+ die "${FUNCNAME}() cannot be used in this EAPI"
+ fi
+
if [[ "${EBUILD_PHASE}" != "unpack" ]]; then
die "${FUNCNAME}() can be used only in src_unpack() phase"
fi
@@ -123,7 +132,7 @@
unpack ${A}
cd "${S}"
- has "${EAPI:-0}" 0 1 && distutils_src_prepare
+ distutils_src_prepare
}
# @FUNCTION: distutils_src_prepare
@@ -165,19 +174,21 @@
die "${FUNCNAME}() can be used only in src_compile() phase"
fi
+ _python_set_color_variables
+
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
distutils_building() {
_distutils_hook pre
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"
+ echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
_distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@"
else
- echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"
- "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
fi
}
@@ -185,16 +196,18 @@
# @DESCRIPTION:
# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set.
distutils_src_test() {
+ _python_set_color_variables
+
if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
distutils_testing() {
- echo PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"
+ echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@"
else
- echo PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
- PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+ echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
fi
elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
python_execute_nosetests -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
@@ -227,6 +240,8 @@
die "${FUNCNAME}() can be used only in src_install() phase"
fi
+ _python_set_color_variables
+
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
declare -A wrapper_scripts=()
@@ -235,9 +250,12 @@
if [[ -d "${D}usr/bin" ]]; then
cd "${D}usr/bin"
- local file
+ local nonversioned_file file
for file in *; do
- if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]]+$ && "$(head -n1 "${file}")" =~ ^'#!'.*python[[:digit:]]+\.[[:digit:]]+ ]]; then
+ if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]](-jython)?+$ && "$(head -n1 "${file}")" =~ ^'#!'.*(python|jython-)[[:digit:]]+\.[[:digit:]]+ ]]; then
+ for nonversioned_file in "${DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS[@]}"; do
+ [[ "${nonversioned_file}" == "/usr/bin/${file}" ]] && continue 2
+ done
mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed"
wrapper_scripts+=(["${D}usr/bin/${file}"]=)
fi
@@ -249,7 +267,7 @@
distutils_installation() {
_distutils_hook pre
- echo "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"
+ echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"${_NORMAL}
"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?"
if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
@@ -268,8 +286,8 @@
# Mark the package to be rebuilt after a Python upgrade.
python_need_rebuild
- echo "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"
- "$(PYTHON -A)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+ echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
+ "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
if [[ -e "${D}usr/local" ]]; then
@@ -302,7 +320,7 @@
local pylibdir pymod
if [[ -z "${PYTHON_MODNAME}" ]]; then
- for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
fi
@@ -331,7 +349,7 @@
local pylibdir pymod
if [[ -z "${PYTHON_MODNAME}" ]]; then
- for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
fi
@@ -343,9 +361,9 @@
python_mod_cleanup ${PYTHON_MODNAME}
else
for pymod in ${PYTHON_MODNAME}; do
- for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
+ for pylibdir in "${ROOT}"usr/$(get_libdir)/python*; do
if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
- python_mod_cleanup "${pylibdir#${ROOT}}/site-packages/${pymod}"
+ python_mod_cleanup "${pylibdir#${ROOT%/}}/site-packages/${pymod}"
fi
done
done
@@ -359,7 +377,7 @@
# @DESCRIPTION:
# Deprecated wrapper function for deprecated python_version().
distutils_python_version() {
- if ! has "${EAPI:-0}" 0 1 2; then
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
eerror "Use PYTHON() and/or python_get_*() instead of ${FUNCNAME}()."
die "${FUNCNAME}() cannot be used in this EAPI"
fi
@@ -369,10 +387,10 @@
# @FUNCTION: distutils_python_tkinter
# @DESCRIPTION:
-# Deprecated wrapper function for python_tkinter_exists().
+# Deprecated wrapper function for deprecated python_tkinter_exists().
distutils_python_tkinter() {
- if ! has "${EAPI:-0}" 0 1 2; then
- eerror "Use python_tkinter_exists() instead of ${FUNCNAME}()."
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ eerror "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()."
die "${FUNCNAME}() cannot be used in this EAPI"
fi
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-03-04 17:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-03-04 17:49 UTC (permalink / raw
To: gentoo-commits
arfrever 10/03/04 17:49:03
Modified: distutils.eclass
Log:
Use prefix variables (bug #307669).
Support hooks in distutils_src_test().
Print deprecation warnings in distutils_python_version() and distutils_python_tkinter().
Revision Changes Path
1.74 eclass/distutils.eclass
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.74&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?rev=1.74&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/distutils.eclass?r1=1.73&r2=1.74
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- distutils.eclass 28 Feb 2010 11:52:22 -0000 1.73
+++ distutils.eclass 4 Mar 2010 17:49:03 -0000 1.74
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.73 2010/02/28 11:52:22 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.74 2010/03/04 17:49:03 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -22,15 +22,15 @@
;;
esac
-if [[ -z "${PYTHON_DEPEND}" ]]; then
+if [[ -z "$(declare -p PYTHON_DEPEND 2> /dev/null)" ]]; then
DEPEND="dev-lang/python"
RDEPEND="${DEPEND}"
fi
+# 'python' variable is deprecated. Use PYTHON() instead.
if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
python="python"
else
- # Use "$(PYTHON)" instead of "${python}".
python="die"
fi
@@ -85,7 +85,7 @@
# @ECLASS-VARIABLE: DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS
# @DESCRIPTION:
-# List of paths to Python scripts, relative to ${D}, which are excluded from
+# List of paths to Python scripts, relative to ${ED}, which are excluded from
# renaming and generation of wrapper scripts.
# @ECLASS-VARIABLE: DOCS
@@ -192,17 +192,45 @@
fi
}
+_distutils_src_test_hook() {
+ if [[ "$#" -ne 1 ]]; then
+ die "${FUNCNAME}() requires 1 arguments"
+ fi
+
+ if [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
+ return
+ fi
+
+ if [[ "$(type -t "distutils_src_test_pre_hook")" == "function" ]]; then
+ eval "python_execute_$1_pre_hook() {
+ distutils_src_test_pre_hook
+ }"
+ fi
+
+ if [[ "$(type -t "distutils_src_test_post_hook")" == "function" ]]; then
+ eval "python_execute_$1_post_hook() {
+ distutils_src_test_post_hook
+ }"
+ fi
+}
+
# @FUNCTION: distutils_src_test
# @DESCRIPTION:
# The distutils src_test function. This function is exported, when DISTUTILS_SRC_TEST variable is set.
+# In ebuilds of packages supporting installation for multiple versions of Python, this function
+# calls distutils_src_test_pre_hook() and distutils_src_test_post_hook(), if they are defined.
distutils_src_test() {
_python_set_color_variables
if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
distutils_testing() {
+ _distutils_hook pre
+
echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
- PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
+
+ _distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@"
else
@@ -210,8 +238,12 @@
PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
fi
elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
+ _distutils_src_test_hook nosetests
+
python_execute_nosetests -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then
+ _distutils_src_test_hook py.test
+
python_execute_py.test -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
# trial requires an argument, which is usually equal to "${PN}".
elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then
@@ -222,6 +254,8 @@
trial_arguments="${PN}"
fi
+ _distutils_src_test_hook trial
+
python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${trial_arguments} "$@"
else
die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'"
@@ -240,6 +274,7 @@
die "${FUNCNAME}() can be used only in src_install() phase"
fi
+ _python_initialize_prefix_variables
_python_set_color_variables
if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
@@ -247,8 +282,8 @@
declare -A wrapper_scripts=()
rename_scripts_with_versioned_shebangs() {
- if [[ -d "${D}usr/bin" ]]; then
- cd "${D}usr/bin"
+ if [[ -d "${ED}usr/bin" ]]; then
+ cd "${ED}usr/bin"
local nonversioned_file file
for file in *; do
@@ -257,7 +292,7 @@
[[ "${nonversioned_file}" == "/usr/bin/${file}" ]] && continue 2
done
mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed"
- wrapper_scripts+=(["${D}usr/bin/${file}"]=)
+ wrapper_scripts+=(["${ED}usr/bin/${file}"]=)
fi
done
fi
@@ -290,7 +325,7 @@
"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
fi
- if [[ -e "${D}usr/local" ]]; then
+ if [[ -e "${ED}usr/local" ]]; then
die "Illegal installation into /usr/local"
fi
@@ -318,9 +353,11 @@
die "${FUNCNAME}() can be used only in pkg_postinst() phase"
fi
+ _python_initialize_prefix_variables
+
local pylibdir pymod
if [[ -z "${PYTHON_MODNAME}" ]]; then
- for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share/jython-*/Lib; do
+ for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
fi
@@ -347,9 +384,11 @@
die "${FUNCNAME}() can be used only in pkg_postrm() phase"
fi
+ _python_initialize_prefix_variables
+
local pylibdir pymod
if [[ -z "${PYTHON_MODNAME}" ]]; then
- for pylibdir in "${ROOT}"usr/$(get_libdir)/python* "${ROOT}"/usr/share/jython-*/Lib; do
+ for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
fi
@@ -361,9 +400,9 @@
python_mod_cleanup ${PYTHON_MODNAME}
else
for pymod in ${PYTHON_MODNAME}; do
- for pylibdir in "${ROOT}"usr/$(get_libdir)/python*; do
+ for pylibdir in "${EROOT}"usr/$(get_libdir)/python*; do
if [[ -d "${pylibdir}/site-packages/${pymod}" ]]; then
- python_mod_cleanup "${pylibdir#${ROOT%/}}/site-packages/${pymod}"
+ python_mod_cleanup "${pylibdir#${EROOT%/}}/site-packages/${pymod}"
fi
done
done
@@ -382,6 +421,13 @@
die "${FUNCNAME}() cannot be used in this EAPI"
fi
+ _python_set_color_variables
+
+ eerror
+ eerror "${_RED}Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01.${_NORMAL}"
+ eerror "${_RED}Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables.${_NORMAL}"
+ eerror
+
python_version
}
@@ -394,5 +440,12 @@
die "${FUNCNAME}() cannot be used in this EAPI"
fi
+ _python_set_color_variables
+
+ eerror
+ eerror "${_RED}Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01.${_NORMAL}"
+ eerror "${_RED}Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}().${_NORMAL}"
+ eerror
+
python_tkinter_exists
}
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-05-25 15:07 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-05-25 15:07 UTC (permalink / raw
To: gentoo-commits
arfrever 10/05/25 15:07:05
Modified: distutils.eclass
Log:
Add sanity check in distutils_src_test().
Improve distutils_pkg_postinst() and distutils_pkg_postrm().
Revision Changes Path
1.75 eclass/distutils.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.75&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.75&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?r1=1.74&r2=1.75
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- distutils.eclass 4 Mar 2010 17:49:03 -0000 1.74
+++ distutils.eclass 25 May 2010 15:07:04 -0000 1.75
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.74 2010/03/04 17:49:03 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.75 2010/05/25 15:07:04 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -220,6 +220,10 @@
# In ebuilds of packages supporting installation for multiple versions of Python, this function
# calls distutils_src_test_pre_hook() and distutils_src_test_post_hook(), if they are defined.
distutils_src_test() {
+ if [[ "${EBUILD_PHASE}" != "test" ]]; then
+ die "${FUNCNAME}() can be used only in src_test() phase"
+ fi
+
_python_set_color_variables
if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
@@ -356,7 +360,7 @@
_python_initialize_prefix_variables
local pylibdir pymod
- if [[ -z "${PYTHON_MODNAME}" ]]; then
+ if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
@@ -364,12 +368,14 @@
done
fi
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- python_mod_optimize ${PYTHON_MODNAME}
- else
- for pymod in ${PYTHON_MODNAME}; do
- python_mod_optimize "$(python_get_sitedir)/${pymod}"
- done
+ if [[ -n "${PYTHON_MODNAME}" ]]; then
+ if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ python_mod_optimize ${PYTHON_MODNAME}
+ else
+ for pymod in ${PYTHON_MODNAME}; do
+ python_mod_optimize "$(python_get_sitedir)/${pymod}"
+ done
+ fi
fi
}
@@ -387,7 +393,7 @@
_python_initialize_prefix_variables
local pylibdir pymod
- if [[ -z "${PYTHON_MODNAME}" ]]; then
+ if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
@@ -407,8 +413,6 @@
done
done
fi
- else
- python_mod_cleanup
fi
}
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-07-17 23:03 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-07-17 23:03 UTC (permalink / raw
To: gentoo-commits
arfrever 10/07/17 23:03:29
Modified: distutils.eclass
Log:
Allow specification of custom path to setup file using DISTUTILS_SETUP_FILES array.
Clean unneeded code in distutils_python_version() and distutils_python_tkinter().
Revision Changes Path
1.76 eclass/distutils.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.76&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.76&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?r1=1.75&r2=1.76
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- distutils.eclass 25 May 2010 15:07:04 -0000 1.75
+++ distutils.eclass 17 Jul 2010 23:03:29 -0000 1.76
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.75 2010/05/25 15:07:04 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.76 2010/07/17 23:03:29 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -38,9 +38,13 @@
# @DESCRIPTION:
# Set this to use separate source directories for each enabled version of Python.
+# @ECLASS-VARIABLE: DISTUTILS_SETUP_FILES
+# @DESCRIPTION:
+# Paths to setup files.
+
# @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS
# @DESCRIPTION:
-# Global options passed to setup.py.
+# Global options passed to setup files.
# @ECLASS-VARIABLE: DISTUTILS_SRC_TEST
# @DESCRIPTION:
@@ -180,15 +184,21 @@
distutils_building() {
_distutils_hook pre
- echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
+ local setup_file
+ for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
+ echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
+ done
_distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@"
else
- echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ local setup_file
+ for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
+ echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ done
fi
}
@@ -231,15 +241,21 @@
distutils_testing() {
_distutils_hook pre
- echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
- PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
+ local setup_file
+ for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
+ echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
+ done
_distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@"
else
- echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
- PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+ local setup_file
+ for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
+ echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+ done
fi
elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
_distutils_src_test_hook nosetests
@@ -306,8 +322,11 @@
distutils_installation() {
_distutils_hook pre
- echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"${_NORMAL}
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?"
+ local setup_file
+ for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
+ echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?"
+ done
if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
rename_scripts_with_versioned_shebangs
@@ -325,8 +344,11 @@
# Mark the package to be rebuilt after a Python upgrade.
python_need_rebuild
- echo ${_BOLD}"$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
- "$(PYTHON)" setup.py "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+ local setup_file
+ for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
+ echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+ done
fi
if [[ -e "${ED}usr/local" ]]; then
@@ -416,40 +438,14 @@
fi
}
-# @FUNCTION: distutils_python_version
-# @DESCRIPTION:
-# Deprecated wrapper function for deprecated python_version().
+# Scheduled for deletion on 2011-01-01.
distutils_python_version() {
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- eerror "Use PYTHON() and/or python_get_*() instead of ${FUNCNAME}()."
- die "${FUNCNAME}() cannot be used in this EAPI"
- fi
-
- _python_set_color_variables
-
- eerror
- eerror "${_RED}Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01.${_NORMAL}"
- eerror "${_RED}Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables.${_NORMAL}"
- eerror
-
- python_version
+ eerror "Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables."
+ die "${FUNCNAME}() is banned"
}
-# @FUNCTION: distutils_python_tkinter
-# @DESCRIPTION:
-# Deprecated wrapper function for deprecated python_tkinter_exists().
+# Scheduled for deletion on 2011-01-01.
distutils_python_tkinter() {
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
- eerror "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()."
- die "${FUNCNAME}() cannot be used in this EAPI"
- fi
-
- _python_set_color_variables
-
- eerror
- eerror "${_RED}Deprecation Warning: ${FUNCNAME}() is deprecated and will be banned on 2010-07-01.${_NORMAL}"
- eerror "${_RED}Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}().${_NORMAL}"
- eerror
-
- python_tkinter_exists
+ eerror "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()."
+ die "${FUNCNAME}() is banned"
}
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-10-10 19:23 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-10-10 19:23 UTC (permalink / raw
To: gentoo-commits
arfrever 10/10/10 19:23:20
Modified: distutils.eclass
Log:
Use _python_package_supporting_installation_for_multiple_python_abis() instead of checking SUPPORT_PYTHON_ABIS variable.
Fix a typo in distutils_src_install().
Revision Changes Path
1.77 eclass/distutils.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.77&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.77&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?r1=1.76&r2=1.77
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- distutils.eclass 17 Jul 2010 23:03:29 -0000 1.76
+++ distutils.eclass 10 Oct 2010 19:23:20 -0000 1.77
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.76 2010/07/17 23:03:29 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.77 2010/10/10 19:23:20 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -97,7 +97,7 @@
# Additional documentation files installed by distutils_src_install().
_distutils_get_build_dir() {
- if [[ -n "${SUPPORT_PYTHON_ABIS}" && -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
+ if _python_package_supporting_installation_for_multiple_python_abis && [[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
echo "build-${PYTHON_ABI}"
else
echo "build"
@@ -105,7 +105,7 @@
}
_distutils_get_PYTHONPATH() {
- if [[ -n "${SUPPORT_PYTHON_ABIS}" && -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
+ if _python_package_supporting_installation_for_multiple_python_abis && [[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]]; then
ls -d build-${PYTHON_ABI}/lib* 2> /dev/null
else
ls -d build/lib* 2> /dev/null
@@ -180,7 +180,7 @@
_python_set_color_variables
- if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if _python_package_supporting_installation_for_multiple_python_abis; then
distutils_building() {
_distutils_hook pre
@@ -207,7 +207,7 @@
die "${FUNCNAME}() requires 1 arguments"
fi
- if [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if ! _python_package_supporting_installation_for_multiple_python_abis; then
return
fi
@@ -237,7 +237,7 @@
_python_set_color_variables
if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
- if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if _python_package_supporting_installation_for_multiple_python_abis; then
distutils_testing() {
_distutils_hook pre
@@ -297,7 +297,7 @@
_python_initialize_prefix_variables
_python_set_color_variables
- if [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if _python_package_supporting_installation_for_multiple_python_abis; then
if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
declare -A wrapper_scripts=()
@@ -307,7 +307,7 @@
local nonversioned_file file
for file in *; do
- if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]](-jython)?+$ && "$(head -n1 "${file}")" =~ ^'#!'.*(python|jython-)[[:digit:]]+\.[[:digit:]]+ ]]; then
+ if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]]+(-jython)?$ && "$(head -n1 "${file}")" =~ ^'#!'.*(python|jython-)[[:digit:]]+\.[[:digit:]]+ ]]; then
for nonversioned_file in "${DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS[@]}"; do
[[ "${nonversioned_file}" == "/usr/bin/${file}" ]] && continue 2
done
@@ -383,7 +383,7 @@
local pylibdir pymod
if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
- for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
+ for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
fi
@@ -391,7 +391,7 @@
fi
if [[ -n "${PYTHON_MODNAME}" ]]; then
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_for_multiple_python_abis; then
python_mod_optimize ${PYTHON_MODNAME}
else
for pymod in ${PYTHON_MODNAME}; do
@@ -416,7 +416,7 @@
local pylibdir pymod
if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
- for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"/usr/share/jython-*/Lib; do
+ for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
PYTHON_MODNAME="${PN}"
fi
@@ -424,7 +424,7 @@
fi
if [[ -n "${PYTHON_MODNAME}" ]]; then
- if ! has "${EAPI:-0}" 0 1 2 || [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ if ! has "${EAPI:-0}" 0 1 2 || _python_package_supporting_installation_for_multiple_python_abis; then
python_mod_cleanup ${PYTHON_MODNAME}
else
for pymod in ${PYTHON_MODNAME}; do
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-12-13 13:36 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-12-13 13:36 UTC (permalink / raw
To: gentoo-commits
arfrever 10/12/13 13:36:33
Modified: distutils.eclass
Log:
py.test script has been moved from dev-python/py to dev-python/pytest.
Revision Changes Path
1.78 eclass/distutils.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.78&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.78&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?r1=1.77&r2=1.78
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- distutils.eclass 10 Oct 2010 19:23:20 -0000 1.77
+++ distutils.eclass 13 Dec 2010 13:36:33 -0000 1.78
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.77 2010/10/10 19:23:20 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.78 2010/12/13 13:36:33 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -70,7 +70,7 @@
DEPEND+="${DEPEND:+ }test? ( dev-python/nose )"
elif [[ "${DISTUTILS_SRC_TEST}" == "py.test" ]]; then
IUSE="test"
- DEPEND+="${DEPEND:+ }test? ( dev-python/py )"
+ DEPEND+="${DEPEND:+ }test? ( dev-python/pytest )"
# trial requires an argument, which is usually equal to "${PN}".
elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then
IUSE="test"
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2010-12-24 15:05 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2010-12-24 15:05 UTC (permalink / raw
To: gentoo-commits
arfrever 10/12/24 15:05:24
Modified: distutils.eclass
Log:
Add optionally printed deprecation warning for already deprecated using of distutils.eclass in older EAPIs.
Deprecate DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS.
Use python_merge_intermediate_installation_images() in distutils_src_install().
Revision Changes Path
1.79 eclass/distutils.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.79&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.79&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?r1=1.78&r2=1.79
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- distutils.eclass 13 Dec 2010 13:36:33 -0000 1.78
+++ distutils.eclass 24 Dec 2010 15:05:24 -0000 1.79
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.78 2010/12/13 13:36:33 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.79 2010/12/24 15:05:24 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
@@ -27,6 +27,24 @@
RDEPEND="${DEPEND}"
fi
+if [[ -n "${PYTHON_DEPRECATION_WARNINGS}" ]]; then
+ if has "${EAPI:-0}" 0 1 && [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
+ ewarn
+ ewarn "\"${EBUILD}\":"
+ ewarn "Deprecation Warning: Usage of distutils.eclass in packages supporting installation"
+ ewarn "for multiple Python ABIs in EAPI <=1 is deprecated and will be banned on 2011-06-01."
+ ewarn "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
+ ewarn
+ elif has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
+ ewarn
+ ewarn "\"${EBUILD}\":"
+ ewarn "Deprecation Warning: Usage of distutils.eclass in packages not supporting installation"
+ ewarn "for multiple Python ABIs in EAPI <=2 is deprecated and will be banned on 2011-06-01."
+ ewarn "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
+ ewarn
+ fi
+fi
+
# 'python' variable is deprecated. Use PYTHON() instead.
if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
python="python"
@@ -86,11 +104,16 @@
# @DESCRIPTION:
# Set this to disable renaming of Python scripts containing versioned shebangs
# and generation of wrapper scripts.
+if [[ -n "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" ]]; then
+ ewarn
+ ewarn "\"${EBUILD}\":"
+ ewarn "Deprecation Warning: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS is deprecated"
+ ewarn "and will be banned on 2011-02-01. Use PYTHON_NONVERSIONED_EXECUTABLES=(\".*\")."
+ ewarn "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
+ ewarn
-# @ECLASS-VARIABLE: DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS
-# @DESCRIPTION:
-# List of paths to Python scripts, relative to ${ED}, which are excluded from
-# renaming and generation of wrapper scripts.
+ PYTHON_NONVERSIONED_EXECUTABLES=(".*")
+fi
# @ECLASS-VARIABLE: DOCS
# @DESCRIPTION:
@@ -298,48 +321,20 @@
_python_set_color_variables
if _python_package_supporting_installation_for_multiple_python_abis; then
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
- declare -A wrapper_scripts=()
-
- rename_scripts_with_versioned_shebangs() {
- if [[ -d "${ED}usr/bin" ]]; then
- cd "${ED}usr/bin"
-
- local nonversioned_file file
- for file in *; do
- if [[ -f "${file}" && ! "${file}" =~ [[:digit:]]+\.[[:digit:]]+(-jython)?$ && "$(head -n1 "${file}")" =~ ^'#!'.*(python|jython-)[[:digit:]]+\.[[:digit:]]+ ]]; then
- for nonversioned_file in "${DISTUTILS_NONVERSIONED_PYTHON_SCRIPTS[@]}"; do
- [[ "${nonversioned_file}" == "/usr/bin/${file}" ]] && continue 2
- done
- mv "${file}" "${file}-${PYTHON_ABI}" || die "Renaming of '${file}' failed"
- wrapper_scripts+=(["${ED}usr/bin/${file}"]=)
- fi
- done
- fi
- }
- fi
-
distutils_installation() {
_distutils_hook pre
local setup_file
for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
- echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@"${_NORMAL}
- "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --root="${D}" --no-compile "$@" || return "$?"
+ echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@" || return "$?"
done
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
- rename_scripts_with_versioned_shebangs
- fi
-
_distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_installation "$@"
- if [[ -z "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" && "${#wrapper_scripts[@]}" -ne 0 && "${BASH_VERSINFO[0]}" -ge 4 ]]; then
- python_generate_wrapper_scripts "${!wrapper_scripts[@]}"
- fi
- unset wrapper_scripts
+ python_merge_intermediate_installation_images "${T}/images"
else
# Mark the package to be rebuilt after a Python upgrade.
python_need_rebuild
^ permalink raw reply [flat|nested] 35+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass
@ 2011-04-12 18:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
0 siblings, 0 replies; 35+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis (arfrever) @ 2011-04-12 18:49 UTC (permalink / raw
To: gentoo-commits
arfrever 11/04/12 18:49:03
Modified: distutils.eclass
Log:
Unconditionally print deprecation warnings for usage of distutils.eclass in old EAPIs.
Support specifying current working directory in DISTUTILS_SETUP_FILES.
Support specifying Python ABI pattern in DISTUTILS_GLOBAL_OPTIONS in EAPI >=4.
Ban DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS.
Add sanity checks in some functions.
Disable installation of useless files in distutils_src_install().
Handle *-nspkg.pth files in distutils_src_install().
Support EAPI="4" in handling of DOCS in distutils_src_install.
Delete distutils_python_version() and distutils_python_tkinter().
Add distutils_get_intermediate_installation_image().
Revision Changes Path
1.80 eclass/distutils.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.80&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?rev=1.80&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/distutils.eclass?r1=1.79&r2=1.80
Index: distutils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- distutils.eclass 24 Dec 2010 15:05:24 -0000 1.79
+++ distutils.eclass 12 Apr 2011 18:49:03 -0000 1.80
@@ -1,12 +1,10 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.79 2010/12/24 15:05:24 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.80 2011/04/12 18:49:03 arfrever Exp $
# @ECLASS: distutils.eclass
# @MAINTAINER:
# Gentoo Python Project <python@gentoo.org>
-#
-# Original author: Jon Nelson <jnelson@gentoo.org>
# @BLURB: Eclass for packages with build systems using Distutils
# @DESCRIPTION:
# The distutils eclass defines phase functions for packages with build systems using Distutils.
@@ -27,7 +25,6 @@
RDEPEND="${DEPEND}"
fi
-if [[ -n "${PYTHON_DEPRECATION_WARNINGS}" ]]; then
if has "${EAPI:-0}" 0 1 && [[ -n "${SUPPORT_PYTHON_ABIS}" ]]; then
ewarn
ewarn "\"${EBUILD}\":"
@@ -43,7 +40,6 @@
ewarn "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
ewarn
fi
-fi
# 'python' variable is deprecated. Use PYTHON() instead.
if has "${EAPI:-0}" 0 1 2 && [[ -z "${SUPPORT_PYTHON_ABIS}" ]]; then
@@ -58,11 +54,17 @@
# @ECLASS-VARIABLE: DISTUTILS_SETUP_FILES
# @DESCRIPTION:
-# Paths to setup files.
+# Array of paths to setup files.
+# Syntax:
+# [current_working_directory|]path_to_setup_file
# @ECLASS-VARIABLE: DISTUTILS_GLOBAL_OPTIONS
# @DESCRIPTION:
-# Global options passed to setup files.
+# Array of global options passed to setup files.
+# Syntax in EAPI <4:
+# global_option
+# Syntax in EAPI >=4:
+# Python_ABI_pattern global_option
# @ECLASS-VARIABLE: DISTUTILS_SRC_TEST
# @DESCRIPTION:
@@ -100,19 +102,10 @@
EXPORT_FUNCTIONS src_test
fi
-# @ECLASS-VARIABLE: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS
-# @DESCRIPTION:
-# Set this to disable renaming of Python scripts containing versioned shebangs
-# and generation of wrapper scripts.
+# Scheduled for deletion on 2011-06-01.
if [[ -n "${DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS}" ]]; then
- ewarn
- ewarn "\"${EBUILD}\":"
- ewarn "Deprecation Warning: DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS is deprecated"
- ewarn "and will be banned on 2011-02-01. Use PYTHON_NONVERSIONED_EXECUTABLES=(\".*\")."
- ewarn "The ebuild needs to be fixed. Please report a bug, if it has not been already reported."
- ewarn
-
- PYTHON_NONVERSIONED_EXECUTABLES=(".*")
+ eerror "Use PYTHON_NONVERSIONED_EXECUTABLES=(\".*\") instead of DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS variable."
+ die "DISTUTILS_DISABLE_VERSIONING_OF_PYTHON_SCRIPTS variable is banned"
fi
# @ECLASS-VARIABLE: DOCS
@@ -144,6 +137,48 @@
fi
}
+_distutils_prepare_global_options() {
+ local element option pattern
+
+ if [[ -n "$(declare -p DISTUTILS_GLOBAL_OPTIONS 2> /dev/null)" && "$(declare -p DISTUTILS_GLOBAL_OPTIONS)" != "declare -a DISTUTILS_GLOBAL_OPTIONS="* ]]; then
+ die "DISTUTILS_GLOBAL_OPTIONS should be indexed array"
+ fi
+
+ if has "${EAPI:-0}" 0 1 2 3; then
+ _DISTUTILS_GLOBAL_OPTIONS=("${DISTUTILS_GLOBAL_OPTIONS[@]}")
+ else
+ _DISTUTILS_GLOBAL_OPTIONS=()
+
+ for element in "${DISTUTILS_GLOBAL_OPTIONS[@]}"; do
+ if [[ ! "${element}" =~ ^[^[:space:]]+\ . ]]; then
+ die "Element '${element}' of DISTUTILS_GLOBAL_OPTIONS array has invalid syntax"
+ fi
+ pattern="${element%% *}"
+ option="${element#* }"
+ if _python_check_python_abi_matching "${PYTHON_ABI}" "${pattern}"; then
+ _DISTUTILS_GLOBAL_OPTIONS+=("${option}")
+ fi
+ done
+ fi
+}
+
+_distutils_prepare_current_working_directory() {
+ if [[ "$1" == *"|"*"|"* ]]; then
+ die "Element '$1' of DISTUTILS_SETUP_FILES array has invalid syntax"
+ fi
+
+ if [[ "$1" == *"|"* ]]; then
+ echo "${_BOLD}[${1%|*}]${_NORMAL}"
+ pushd "${1%|*}" > /dev/null || die "Entering directory '${1%|*}' failed"
+ fi
+}
+
+_distutils_restore_current_working_directory() {
+ if [[ "$1" == *"|"* ]]; then
+ popd > /dev/null || die "Leaving directory '${1%|*}' failed"
+ fi
+}
+
# @FUNCTION: distutils_src_unpack
# @DESCRIPTION:
# The distutils src_unpack function. This function is exported.
@@ -170,8 +205,15 @@
die "${FUNCNAME}() can be used only in src_prepare() phase"
fi
+ _python_check_python_pkg_setup_execution
+
+ local distribute_setup_existence="0" ez_setup_existence="0"
+
+ if [[ "$#" -ne 0 ]]; then
+ die "${FUNCNAME}() does not accept arguments"
+ fi
+
# Delete ez_setup files to prevent packages from installing Setuptools on their own.
- local ez_setup_existence="0"
[[ -d ez_setup || -f ez_setup.py ]] && ez_setup_existence="1"
rm -fr ez_setup*
if [[ "${ez_setup_existence}" == "1" ]]; then
@@ -179,7 +221,6 @@
fi
# Delete distribute_setup files to prevent packages from installing Distribute on their own.
- local distribute_setup_existence="0"
[[ -d distribute_setup || -f distribute_setup.py ]] && distribute_setup_existence="1"
rm -fr distribute_setup*
if [[ "${distribute_setup_existence}" == "1" ]]; then
@@ -201,26 +242,40 @@
die "${FUNCNAME}() can be used only in src_compile() phase"
fi
+ _python_check_python_pkg_setup_execution
_python_set_color_variables
+ local setup_file
+
if _python_package_supporting_installation_for_multiple_python_abis; then
distutils_building() {
_distutils_hook pre
- local setup_file
+ _distutils_prepare_global_options
+
for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
- echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
- "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
+ _distutils_prepare_current_working_directory "${setup_file}"
+
+ echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build -b "$(_distutils_get_build_dir)" "$@" || return "$?"
+
+ _distutils_restore_current_working_directory "${setup_file}"
done
_distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_building "$@"
+ unset -f distutils_building
else
- local setup_file
+ _distutils_prepare_global_options
+
for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
- echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
- "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+ _distutils_prepare_current_working_directory "${setup_file}"
+
+ echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" build "$@" || die "Building failed"
+
+ _distutils_restore_current_working_directory "${setup_file}"
done
fi
}
@@ -257,27 +312,41 @@
die "${FUNCNAME}() can be used only in src_test() phase"
fi
+ _python_check_python_pkg_setup_execution
_python_set_color_variables
+ local arguments setup_file
+
if [[ "${DISTUTILS_SRC_TEST}" == "setup.py" ]]; then
if _python_package_supporting_installation_for_multiple_python_abis; then
distutils_testing() {
_distutils_hook pre
- local setup_file
+ _distutils_prepare_global_options
+
for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
- echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
- PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
+ _distutils_prepare_current_working_directory "${setup_file}"
+
+ echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@"${_NORMAL}
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") test "$@" || return "$?"
+
+ _distutils_restore_current_working_directory "${setup_file}"
done
_distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_testing "$@"
+ unset -f distutils_testing
else
- local setup_file
+ _distutils_prepare_global_options
+
for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
- echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
- PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+ _distutils_prepare_current_working_directory "${setup_file}"
+
+ echo ${_BOLD}PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@"${_NORMAL}
+ PYTHONPATH="$(_distutils_get_PYTHONPATH)" "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" test "$@" || die "Testing failed"
+
+ _distutils_restore_current_working_directory "${setup_file}"
done
fi
elif [[ "${DISTUTILS_SRC_TEST}" == "nosetests" ]]; then
@@ -290,16 +359,15 @@
python_execute_py.test -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- "$@"
# trial requires an argument, which is usually equal to "${PN}".
elif [[ "${DISTUTILS_SRC_TEST}" =~ ^trial(\ .*)?$ ]]; then
- local trial_arguments
if [[ "${DISTUTILS_SRC_TEST}" == "trial "* ]]; then
- trial_arguments="${DISTUTILS_SRC_TEST#trial }"
+ arguments="${DISTUTILS_SRC_TEST#trial }"
else
- trial_arguments="${PN}"
+ arguments="${PN}"
fi
_distutils_src_test_hook trial
- python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${trial_arguments} "$@"
+ python_execute_trial -P '$(_distutils_get_PYTHONPATH)' ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} -- ${arguments} "$@"
else
die "'DISTUTILS_SRC_TEST' variable has unsupported value '${DISTUTILS_SRC_TEST}'"
fi
@@ -311,56 +379,95 @@
# In ebuilds of packages supporting installation for multiple versions of Python, this function
# calls distutils_src_install_pre_hook() and distutils_src_install_post_hook(), if they are defined.
# It also installs some standard documentation files (AUTHORS, Change*, CHANGELOG, CONTRIBUTORS,
-# KNOWN_BUGS, MAINTAINERS, MANIFEST*, NEWS, PKG-INFO, README*, TODO).
+# KNOWN_BUGS, MAINTAINERS, NEWS, README*, TODO).
distutils_src_install() {
if [[ "${EBUILD_PHASE}" != "install" ]]; then
die "${FUNCNAME}() can be used only in src_install() phase"
fi
+ _python_check_python_pkg_setup_execution
_python_initialize_prefix_variables
_python_set_color_variables
+ local default_docs doc line nspkg_pth_file nspkg_pth_files=() setup_file
+
if _python_package_supporting_installation_for_multiple_python_abis; then
distutils_installation() {
_distutils_hook pre
- local setup_file
+ _distutils_prepare_global_options
+
for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
- echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@"${_NORMAL}
- "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@" || return "$?"
+ _distutils_prepare_current_working_directory "${setup_file}"
+
+ echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" $([[ -z "${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES}" ]] && echo build -b "$(_distutils_get_build_dir)") install --no-compile --root="${T}/images/${PYTHON_ABI}" "$@" || return "$?"
+
+ _distutils_restore_current_working_directory "${setup_file}"
done
_distutils_hook post
}
python_execute_function ${DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES:+-s} distutils_installation "$@"
+ unset -f distutils_installation
python_merge_intermediate_installation_images "${T}/images"
else
# Mark the package to be rebuilt after a Python upgrade.
python_need_rebuild
- local setup_file
+ _distutils_prepare_global_options
+
for setup_file in "${DISTUTILS_SETUP_FILES[@]-setup.py}"; do
- echo ${_BOLD}"$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
- "$(PYTHON)" "${setup_file}" "${DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+ _distutils_prepare_current_working_directory "${setup_file}"
+
+ echo ${_BOLD}"$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@"${_NORMAL}
+ "$(PYTHON)" "${setup_file#*|}" "${_DISTUTILS_GLOBAL_OPTIONS[@]}" install --root="${D}" --no-compile "$@" || die "Installation failed"
+
+ _distutils_restore_current_working_directory "${setup_file}"
+ done
+ fi
+
+ while read -d $'\0' -r nspkg_pth_file; do
+ nspkg_pth_files+=("${nspkg_pth_file}")
+ done < <(find "${ED}" -name "*-nspkg.pth" -type f -print0)
+
+ if [[ "${#nspkg_pth_files[@]}" -gt 0 ]]; then
+ einfo
+ einfo "Python namespaces:"
+ for nspkg_pth_file in "${nspkg_pth_files[@]}"; do
+ einfo " '${nspkg_pth_file#${ED%/}}':"
+ while read -r line; do
+ einfo " $(echo "${line}" | sed -e "s/.*types\.ModuleType('\([^']\+\)').*/\1/")"
+ done < "${nspkg_pth_file}"
+ if ! has "${EAPI:-0}" 0 1 2 3; then
+ rm -f "${nspkg_pth_file}" || die "Deletion of '${nspkg_pth_file}' failed"
+ fi
done
+ einfo
fi
if [[ -e "${ED}usr/local" ]]; then
die "Illegal installation into /usr/local"
fi
- local default_docs
- default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS MANIFEST* NEWS PKG-INFO README* TODO"
+ default_docs="AUTHORS Change* CHANGELOG CONTRIBUTORS KNOWN_BUGS MAINTAINERS NEWS README* TODO"
- local doc
for doc in ${default_docs}; do
[[ -s "${doc}" ]] && dodoc "${doc}"
done
- if [[ -n "${DOCS}" ]]; then
- dodoc ${DOCS} || die "dodoc failed"
+ if has "${EAPI:-0}" 0 1 2 3; then
+ if [[ -n "${DOCS}" ]]; then
+ dodoc ${DOCS} || die "dodoc failed"
+ fi
+ else
+ if [[ -n "${DOCS}" ]]; then
+ dodoc -r ${DOCS} || die "dodoc failed"
+ fi
fi
+
+ DISTUTILS_SRC_INSTALL_EXECUTED="1"
}
# @FUNCTION: distutils_pkg_postinst
@@ -374,9 +481,19 @@
die "${FUNCNAME}() can be used only in pkg_postinst() phase"
fi
+ _python_check_python_pkg_setup_execution
_python_initialize_prefix_variables
+ if [[ -z "${DISTUTILS_SRC_INSTALL_EXECUTED}" ]]; then
+ die "${FUNCNAME}() called illegally"
+ fi
+
local pylibdir pymod
+
+ if [[ "$#" -ne 0 ]]; then
+ die "${FUNCNAME}() does not accept arguments"
+ fi
+
if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
@@ -407,9 +524,19 @@
die "${FUNCNAME}() can be used only in pkg_postrm() phase"
fi
+ _python_check_python_pkg_setup_execution
_python_initialize_prefix_variables
+ if [[ -z "${DISTUTILS_SRC_INSTALL_EXECUTED}" ]]; then
+ die "${FUNCNAME}() called illegally"
+ fi
+
local pylibdir pymod
+
+ if [[ "$#" -ne 0 ]]; then
+ die "${FUNCNAME}() does not accept arguments"
+ fi
+
if [[ -z "$(declare -p PYTHON_MODNAME 2> /dev/null)" ]]; then
for pylibdir in "${EROOT}"usr/$(get_libdir)/python* "${EROOT}"usr/share/jython-*/Lib; do
if [[ -d "${pylibdir}/site-packages/${PN}" ]]; then
@@ -433,14 +560,29 @@
fi
}
-# Scheduled for deletion on 2011-01-01.
-distutils_python_version() {
- eerror "Use PYTHON() instead of python variable. Use python_get_*() instead of PYVER* variables."
- die "${FUNCNAME}() is banned"
-}
+# @FUNCTION: distutils_get_intermediate_installation_image
+# @DESCRIPTION:
+# Print path to intermediate installation image.
+#
+# This function can be used only in distutils_src_install_pre_hook() and distutils_src_install_post_hook().
+distutils_get_intermediate_installation_image() {
+ if [[ "${EBUILD_PHASE}" != "install" ]]; then
+ die "${FUNCNAME}() can be used only in src_install() phase"
+ fi
+
+ if ! _python_package_supporting_installation_for_multiple_python_abis; then
+ die "${FUNCNAME}() cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs"
+ fi
+
+ _python_check_python_pkg_setup_execution
+
+ if [[ ! "${FUNCNAME[1]}" =~ ^distutils_src_install_(pre|post)_hook$ ]]; then
+ die "${FUNCNAME}() can be used only in distutils_src_install_pre_hook() and distutils_src_install_post_hook()"
+ fi
+
+ if [[ "$#" -ne 0 ]]; then
+ die "${FUNCNAME}() does not accept arguments"
+ fi
-# Scheduled for deletion on 2011-01-01.
-distutils_python_tkinter() {
- eerror "Use PYTHON_USE_WITH=\"xml\" and python_pkg_setup() instead of ${FUNCNAME}()."
- die "${FUNCNAME}() is banned"
+ echo "${T}/images/${PYTHON_ABI}"
}
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2011-04-12 18:49 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 18:31 [gentoo-commits] gentoo-x86 commit in eclass: distutils.eclass Arfrever Frehtes Taifersar Arahesis (arfrever)
-- strict thread matches above, loose matches on Subject: below --
2011-04-12 18:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-12-24 15:05 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-12-13 13:36 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-10-10 19:23 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-07-17 23:03 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-05-25 15:07 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-03-04 17:49 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-28 11:52 Arfrever Frehtes Taifersar Arahesis (arfrever)
2010-02-08 9:35 Peter Volkov (pva)
2010-02-07 21:17 Peter Volkov (pva)
2010-01-10 17:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-12-24 4:21 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-28 18:39 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-11-06 0:35 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-10-11 13:38 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-11 20:03 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-11 12:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-09 19:26 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-07 2:34 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-09-05 16:45 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-12 2:24 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-05 18:34 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-08-02 0:30 Arfrever Frehtes Taifersar Arahesis (arfrever)
2009-02-18 14:43 Peter Volkov (pva)
2008-10-28 21:29 Ali Polatel (hawking)
2008-10-27 0:19 Ali Polatel (hawking)
2008-09-24 16:45 Ali Polatel (hawking)
2008-06-28 0:05 Luca Longinotti (chtekk)
2008-06-24 13:40 Ali Polatel (hawking)
2008-06-20 18:21 Ali Polatel (hawking)
2008-05-30 10:22 Ali Polatel (hawking)
2008-05-29 15:24 Ali Polatel (hawking)
2008-01-23 22:19 Ali Polatel (hawking)
2007-10-25 13:49 Ali Polatel (hawking)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox