public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Krzysztof Pawlik (nelchael)" <nelchael@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-distutils-ng.eclass
Date: Fri,  4 May 2012 08:31:43 +0000 (UTC)	[thread overview]
Message-ID: <20120504083143.9CA362004B@flycatcher.gentoo.org> (raw)

nelchael    12/05/04 08:31:43

  Modified:             ChangeLog python-distutils-ng.eclass
  Log:
  Let distutils compile python modules, see bug #413957.

Revision  Changes    Path
1.236                eclass/ChangeLog

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.236&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.236&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.235&r2=1.236

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -r1.235 -r1.236
--- ChangeLog	3 May 2012 00:31:58 -0000	1.235
+++ ChangeLog	4 May 2012 08:31:43 -0000	1.236
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.235 2012/05/03 00:31:58 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.236 2012/05/04 08:31:43 nelchael Exp $
+
+  04 May 2012; Krzysztof Pawlik <nelchael@gentoo.org>
+  python-distutils-ng.eclass:
+  Let distutils compile python modules, see bug #413957.
 
   03 May 2012; Mike Gilbert <floppym@gentoo.org> python-distutils-ng.eclass:
   Declare local S in _python-distutils-ng_run_for_impl.



1.16                 eclass/python-distutils-ng.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-distutils-ng.eclass?rev=1.16&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-distutils-ng.eclass?rev=1.16&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-distutils-ng.eclass?r1=1.15&r2=1.16

Index: python-distutils-ng.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- python-distutils-ng.eclass	3 May 2012 00:31:58 -0000	1.15
+++ python-distutils-ng.eclass	4 May 2012 08:31:43 -0000	1.16
@@ -1,6 +1,6 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v 1.15 2012/05/03 00:31:58 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v 1.16 2012/05/04 08:31:43 nelchael Exp $
 
 # @ECLASS: python-distutils-ng
 # @MAINTAINER:
@@ -171,37 +171,17 @@
 # @DESCRIPTION:
 # Default src_install for distutils-based packages.
 _python-distutils-ng_default_distutils_install() {
-	"${PYTHON}" setup.py install --no-compile --root="${D}/" || die
-}
+	local compile_flags="--compile -O2"
 
-# @FUNCTION: _python-distutils-ng_has_compileall
-# @USAGE: implementation
-# @RETURN: 0 if given implementation has compileall module
-# @DESCRIPTION:
-# This function is used to decide whenever to compile Python modules for given
-# implementation.
-_python-distutils-ng_has_compileall() {
 	case "${1}" in
-		python?_?|jython?_?)
-			return 0 ;;
-		*)
-			return 1 ;;
+		jython*)
+			# Jython does not support optimizations
+			compile_flags="--compile" ;;
 	esac
-}
 
-# @FUNCTION: _python-distutils-ng_has_compileall_opt
-# @USAGE: implementation
-# @RETURN: 0 if given implementation has compileall module and supports # optimizations
-# @DESCRIPTION:
-# This function is used to decide whenever to compile and optimize Python
-# modules for given implementation.
-_python-distutils-ng_has_compileall_opt() {
-	case "${1}" in
-		python?_?)
-			return 0 ;;
-		*)
-			return 1 ;;
-	esac
+	unset PYTHONDONTWRITEBYTECODE
+	[[ -n "${PYTHON_DISABLE_COMPILATION}" ]] && compile_flags="--no-compile"
+	"${PYTHON}" setup.py install ${compile_flags} --root="${D%/}/" || die
 }
 
 # @FUNCTION: python-distutils-ng_redoscript
@@ -390,26 +370,4 @@
 		python_install_all
 		popd &> /dev/null
 	fi
-
-	for impl in ${PYTHON_COMPAT}; do
-		[[ "${PYTHON_DISABLE_COMPILATION}" = "yes" ]] && continue
-		use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
-
-		PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")"
-		for accessible_path in $(${PYTHON} -c 'import sys; print(" ".join(sys.path))'); do
-			[[ -d "${D}/${accessible_path}" ]] || continue
-
-			_python-distutils-ng_has_compileall "${impl}" || continue
-			ebegin "Compiling ${accessible_path} for ${impl}"
-			${PYTHON} \
-				-m compileall -q -f "${D}/${accessible_path}" || die
-			eend $?
-
-			_python-distutils-ng_has_compileall_opt "${impl}" || continue
-			ebegin "Optimizing ${accessible_path} for ${impl}"
-			PYTHONOPTIMIZE=1 ${PYTHON} \
-				-m compileall -q -f "${D}/${accessible_path}" || die
-			eend $?
-		done;
-	done
 }






             reply	other threads:[~2012-05-04  8:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04  8:31 Krzysztof Pawlik (nelchael) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-09-29 15:04 [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-distutils-ng.eclass Michal Gorny (mgorny)
2012-10-30 17:22 Michal Gorny (mgorny)
2012-09-26 12:07 Julian Ospald (hasufell)
2012-06-10 14:23 Mike Gilbert (floppym)
2012-05-24 18:18 Mike Gilbert (floppym)
2012-05-21 18:10 Krzysztof Pawlik (nelchael)
2012-05-21 17:33 Krzysztof Pawlik (nelchael)
2012-05-21 17:30 Krzysztof Pawlik (nelchael)
2012-05-14 19:23 Krzysztof Pawlik (nelchael)
2012-05-06  3:20 Mike Gilbert (floppym)
2012-05-05 18:03 Mike Gilbert (floppym)
2012-05-05 18:00 Mike Gilbert (floppym)
2012-05-03  0:31 Mike Gilbert (floppym)
2012-05-02 21:40 Mike Gilbert (floppym)
2012-04-30  8:25 Krzysztof Pawlik (nelchael)
2012-04-03 19:21 Krzysztof Pawlik (nelchael)
2012-04-03 19:12 Krzysztof Pawlik (nelchael)
2012-03-30 16:41 Krzysztof Pawlik (nelchael)
2012-03-28 14:21 Marien Zwart (marienz)
2012-03-26 20:33 Krzysztof Pawlik (nelchael)
2012-03-26 19:12 Krzysztof Pawlik (nelchael)
2012-03-26 18:27 Krzysztof Pawlik (nelchael)
2012-03-26 16:24 Krzysztof Pawlik (nelchael)
2012-03-26  6:12 Justin Lecher (jlec)
2012-03-25 18:48 Krzysztof Pawlik (nelchael)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120504083143.9CA362004B@flycatcher.gentoo.org \
    --to=nelchael@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox