public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-02-28 20:52 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-02-28 20:52 UTC (permalink / raw
  To: gentoo-commits

commit:     64a68921294a806d350e0155ed96b74099c53f08
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Sun Feb 26 18:12:51 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 18:12:51 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=64a68921

Change USE_PYTHON to PYTHON_COMPAT.

---
 eclass/python-distutils-ng.eclass |   42 ++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index 48de447..98e5721 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -15,18 +15,18 @@
 #
 # TODO: Document implementations!
 
-# @ECLASS-VARIABLE: USE_PYTHON
+# @ECLASS-VARIABLE: PYTHON_COMPAT
 # @DESCRIPTION:
-# This variable contains a space separated list of targets (see above) a package
-# is compatible to. It must be set before the `inherit' call. The default is to
-# enable all targets.
+# This variable contains a space separated list of implementations (see above) a
+# package is compatible to. It must be set before the `inherit' call. The
+# default is to enable all implementations.
 
-if [[ -z "${USE_PYTHON}" ]]; then
+if [[ -z "${PYTHON_COMPAT}" ]]; then
 	# Default: pure python, support all implementations
-	USE_PYTHON="  python2_5 python2_6 python2_7"
-	USE_PYTHON+=" python3_1 python3_2"
-	USE_PYTHON+=" jython2_5"
-	USE_PYTHON+=" pypy1_7 pypy1_8"
+	PYTHON_COMPAT="  python2_5 python2_6 python2_7"
+	PYTHON_COMPAT+=" python3_1 python3_2"
+	PYTHON_COMPAT+=" jython2_5"
+	PYTHON_COMPAT+=" pypy1_7 pypy1_8"
 fi
 
 # @ECLASS-VARIABLE: PYTHON_OPTIONAL
@@ -58,7 +58,7 @@ esac
 # @DESCRIPTION:
 # This function returns the full package atom of a Python implementation.
 #
-# `implementation' has to be one of the valid values for USE_PYTHON.
+# `implementation' has to be one of the valid values for PYTHON_COMPAT.
 _python-distutils-ng_generate_depend() {
 	local impl="${1/_/.}"
 	case "${impl}" in
@@ -105,7 +105,7 @@ else
 	REQUIRED_USE+="${required_use_str}"
 fi
 
-for impl in ${USE_PYTHON}; do
+for impl in ${PYTHON_COMPAT}; do
 	IUSE+=" python_targets_${impl} "
 	local dep_str="python_targets_${impl}? ( $(_python-distutils-ng_generate_depend "${impl}") )"
 
@@ -149,8 +149,8 @@ _python-distutils-ng_run_for_impl() {
 _python-distutils-ng_run_for_all_impls() {
 	local command="${1}"
 
-	for impl in ${USE_PYTHON}; do
-		use "python_targets_${impl}" ${USE_PYTHON} || continue
+	for impl in ${PYTHON_COMPAT}; do
+		use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
 		_python-distutils-ng_run_for_impl "${impl}" "${command}"
 	done
 }
@@ -248,8 +248,8 @@ python-distutils-ng_newscript() {
 
 	einfo "Installing ${source_file} for multiple implementations (default: ${default_impl})"
 	insinto /usr/bin
-	for impl in ${USE_PYTHON}; do
-		use "python_targets_${impl}" ${USE_PYTHON} || continue
+	for impl in ${PYTHON_COMPAT}; do
+		use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
 
 		newins "${source_file}" "${destination_file}-${impl}"
 		fperms 755 "/usr/bin/${destination_file}-${impl}"
@@ -279,8 +279,8 @@ python-distutils-ng_src_prepare() {
 	[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
 
 	# Try to run binary for each implementation:
-	for impl in ${USE_PYTHON}; do
-		use "python_targets_${impl}" ${USE_PYTHON} || continue
+	for impl in ${PYTHON_COMPAT}; do
+		use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
 		$(_python-distutils-ng_get_binary_for_implementation "${impl}") \
 			-c "import sys" || die
 	done
@@ -292,8 +292,8 @@ python-distutils-ng_src_prepare() {
 	fi
 
 	# Create a copy of S for each implementation:
-	for impl in ${USE_PYTHON}; do
-		use "python_targets_${impl}" ${USE_PYTHON} || continue
+	for impl in ${PYTHON_COMPAT}; do
+		use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
 
 		einfo "Creating copy for ${impl} in ${WORKDIR}/impl_${impl}"
 		mkdir -p "${WORKDIR}/impl_${impl}" || die
@@ -353,9 +353,9 @@ python-distutils-ng_src_install() {
 		python_install_all
 	fi
 
-	for impl in ${USE_PYTHON}; do
+	for impl in ${PYTHON_COMPAT}; do
 		[[ "${PYTHON_DISABLE_COMPILATION}" = "yes" ]] && continue
-		use "python_targets_${impl}" ${USE_PYTHON} || 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



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-02-29 17:38 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-02-29 17:38 UTC (permalink / raw
  To: gentoo-commits

commit:     a8e9c1353a96d317b1568da960148a62a589dc41
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Wed Feb 29 17:32:23 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Wed Feb 29 17:32:23 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=a8e9c135

Rename _python-distutils-ng_run_for_all_impls to _python-distutils-ng_run_for_each_impl.

---
 eclass/python-distutils-ng.eclass |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index 7be2653..b7d4219 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -140,13 +140,13 @@ _python-distutils-ng_run_for_impl() {
 	popd &> /dev/null
 }
 
-# @FUNCTION: _python-distutils-ng_run_for_all_impls
+# @FUNCTION: _python-distutils-ng_run_for_each_impl
 # @USAGE: command_to_run
 # @DESCRIPTION:
 # Run command_to_run for all enabled Python implementations.
 #
 # See also _python-distutils-ng_run_for_impl
-_python-distutils-ng_run_for_all_impls() {
+_python-distutils-ng_run_for_each_impl() {
 	local command="${1}"
 
 	for impl in ${PYTHON_COMPAT}; do
@@ -289,7 +289,7 @@ python-distutils-ng_src_prepare() {
 
 	# Run python_prepare for each implementation:
 	if type python_prepare &> /dev/null; then
-		_python-distutils-ng_run_for_all_impls python_prepare
+		_python-distutils-ng_run_for_each_impl python_prepare
 	fi
 }
 
@@ -298,7 +298,7 @@ python-distutils-ng_src_configure() {
 	[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
 
 	if type python_configure &> /dev/null; then
-		_python-distutils-ng_run_for_all_impls python_configure
+		_python-distutils-ng_run_for_each_impl python_configure
 	fi
 }
 
@@ -307,9 +307,9 @@ python-distutils-ng_src_compile() {
 	[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
 
 	if type python_compile &> /dev/null; then
-		_python-distutils-ng_run_for_all_impls python_compile
+		_python-distutils-ng_run_for_each_impl python_compile
 	else
-		_python-distutils-ng_run_for_all_impls \
+		_python-distutils-ng_run_for_each_impl \
 			_python-distutils-ng_default_distutils_compile
 	fi
 }
@@ -319,7 +319,7 @@ python-distutils-ng_src_test() {
 	[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
 
 	if type python_test &> /dev/null; then
-		_python-distutils-ng_run_for_all_impls python_test
+		_python-distutils-ng_run_for_each_impl python_test
 	fi
 }
 
@@ -328,9 +328,9 @@ python-distutils-ng_src_install() {
 	[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
 
 	if type python_install &> /dev/null; then
-		_python-distutils-ng_run_for_all_impls python_install
+		_python-distutils-ng_run_for_each_impl python_install
 	else
-		_python-distutils-ng_run_for_all_impls \
+		_python-distutils-ng_run_for_each_impl \
 			_python-distutils-ng_default_distutils_install
 	fi
 



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-02-29 17:38 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-02-29 17:38 UTC (permalink / raw
  To: gentoo-commits

commit:     56da8742836111f4f61195598b46db9a7482145f
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Wed Feb 29 17:32:10 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Wed Feb 29 17:32:10 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=56da8742

Fix python3_1 (was 2_1).

---
 eclass/python-distutils-ng.eclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index 0b9f005..7be2653 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -234,7 +234,7 @@ python-distutils-ng_newscript() {
 
 	if [[ -z "${default_impl}" ]]; then
 		# TODO: Pick default implementation
-		for impl in python{2_7,2_6,2_5,3_2,2_1} pypy{1_8,1_7} jython2_5; do
+		for impl in python{2_7,2_6,2_5,3_2,3_1} pypy{1_8,1_7} jython2_5; do
 			use "python_targets_${impl}" || continue
 			default_impl="${impl}"
 			break;



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-02-29 17:38 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-02-29 17:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c716cba7f7b7f0165d075452a2e4a24f7b8239d0
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Wed Feb 29 17:31:50 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Wed Feb 29 17:31:50 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=c716cba7

Remove src_unpack() - it does not do more than default one.

---
 eclass/python-distutils-ng.eclass |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index 98e5721..0b9f005 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -39,7 +39,7 @@ fi
 # Set the value to "yes" to skip compilation and/or optimization of Python
 # modules.
 
-EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install
+EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
 
 case "${EAPI}" in
 	0|1|2|3)
@@ -261,19 +261,6 @@ python-distutils-ng_newscript() {
 	dosym "${destination_file}-${default_impl}" "/usr/bin/${destination_file}"
 }
 
-# Phase function: src_unpack
-python-distutils-ng_src_unpack() {
-	[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }
-
-	if type python_unpack &> /dev/null; then
-		# This should not run anything specific to any single Python
-		# implementation, keep it generic:
-		python_unpack_all
-	else
-		[[ -n ${A} ]] && unpack ${A}
-	fi
-}
-
 # Phase function: src_prepare
 python-distutils-ng_src_prepare() {
 	[[ "${PYTHON_OPTIONAL}" = "yes" ]] && { use python || return; }



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-03-01 17:54 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-03-01 17:54 UTC (permalink / raw
  To: gentoo-commits

commit:     04df14590005e2efdb6b44b4d78554f452b0194d
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Wed Feb 29 20:59:17 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Wed Feb 29 20:59:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=04df1459

Add binary name for PyPy.

---
 eclass/python-distutils-ng.eclass |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index 0bc2edf..dcdafc2 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -87,7 +87,7 @@ _python-distutils-ng_get_binary_for_implementation() {
 		python?.?|jython?.?)
 			echo "/usr/bin/${impl}" ;;
 		pypy?.?)
-			echo "TODO" ;;
+			echo "/usr/bin/pypy-c${impl: -3}" ;;
 		*)
 			die "Unsupported implementation: ${1}" ;;
 	esac
@@ -234,7 +234,6 @@ python-distutils-ng_newscript() {
 	local default_impl="${PYTHON_DEFAULT_IMPLEMENTATION}"
 
 	if [[ -z "${default_impl}" ]]; then
-		# TODO: Pick default implementation
 		for impl in python{2_7,2_6,2_5,3_2,3_1} pypy{1_8,1_7} jython2_5; do
 			use "python_targets_${impl}" || continue
 			default_impl="${impl}"



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-03-01 17:54 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-03-01 17:54 UTC (permalink / raw
  To: gentoo-commits

commit:     2b1dbe72d6e114c476510579c8f9f228c8d3fa12
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Wed Feb 29 20:36:20 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Wed Feb 29 20:36:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=2b1dbe72

Set EPYTHON variable.

---
 eclass/python-distutils-ng.eclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index b7d4219..0bc2edf 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -132,6 +132,7 @@ _python-distutils-ng_run_for_impl() {
 
 	S="${WORKDIR}/impl_${impl}/${PACKAGE_SPECIFIC_S}"
 	PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")"
+	EPYTHON="${impl/_/.}"
 
 	einfo "Running ${command} in ${S} for ${impl}"
 



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-03-01 18:22 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-03-01 18:22 UTC (permalink / raw
  To: gentoo-commits

commit:     da3edb3f35e1cf06ff6eeee84d73d8ae07e2ce7c
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Thu Mar  1 18:21:18 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Thu Mar  1 18:21:18 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=da3edb3f

If only one Python implementation is enabled install the script as-is, do not create script.py-impl copy.

---
 eclass/python-distutils-ng.eclass |   51 ++++++++++++++++++++++++------------
 1 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index dcdafc2..6b63b28 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -217,14 +217,16 @@ python-distutils-ng_doscript() {
 # Install given script file in /usr/bin/ for all enabled implementations using
 # new_file_name as a base name.
 #
-# Each script copy will have the name mangled to "new_file_name-IMPLEMENTATION"
-# and new hash-bang line will be inserted to reference specific Python
-# interpreter.
+# If only one Python implementation is enabled the script will be installed
+# as-is. Otherwise each script copy will have the name mangled to
+# "new_file_name-IMPLEMENTATION". For every installed script new hash-bang line
+# will be inserted to reference specific Python interpreter.
 #
-# There will be also a symlink with name equal to new_file_name that will be a
-# symlink to default implementation, which defaults to value of
-# PYTHON_DEFAULT_IMPLEMENTATION, if not specified the function will pick default
-# implementation: it will the be first enabled from the following list:
+# In case of multiple implementations there will be also a symlink with name
+# equal to new_file_name that will be a symlink to default implementation, which
+# defaults to value of PYTHON_DEFAULT_IMPLEMENTATION, if not specified the
+# function will pick default implementation: it will the be first enabled one
+# from the following list:
 #   python2_7, python2_6, python2_5, python3_2, python3_1, pypy1_8, pypy1_7, jython2_5
 python-distutils-ng_newscript() {
 	[[ -n "${1}" ]] || die "Missing source file name"
@@ -232,12 +234,18 @@ python-distutils-ng_newscript() {
 	local source_file="${1}"
 	local destination_file="${2}"
 	local default_impl="${PYTHON_DEFAULT_IMPLEMENTATION}"
+	local enabled_impls=0
+
+	for impl in ${PYTHON_COMPAT}; do
+		use "python_targets_${impl}" || continue
+		enabled_impls=$((enabled_impls + 1))
+	done
 
 	if [[ -z "${default_impl}" ]]; then
 		for impl in python{2_7,2_6,2_5,3_2,3_1} pypy{1_8,1_7} jython2_5; do
 			use "python_targets_${impl}" || continue
 			default_impl="${impl}"
-			break;
+			break
 		done
 	else
 		use "python_targets_${impl}" || \
@@ -246,19 +254,28 @@ python-distutils-ng_newscript() {
 
 	[[ -n "${default_impl}" ]] || die "Could not select default implementation"
 
-	einfo "Installing ${source_file} for multiple implementations (default: ${default_impl})"
 	insinto /usr/bin
-	for impl in ${PYTHON_COMPAT}; do
-		use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
-
-		newins "${source_file}" "${destination_file}-${impl}"
-		fperms 755 "/usr/bin/${destination_file}-${impl}"
+	if [[ "${enabled_impls}" = "1" ]]; then
+		einfo "Installing ${source_file} for single implementation: ${default_impl}"
+		newins "${source_file}" "${destination_file}"
+		fperms 755 "/usr/bin/${destination_file}"
 		sed -i \
 			-e "1i#!$(_python-distutils-ng_get_binary_for_implementation "${impl}")" \
-			"${D}/usr/bin/${destination_file}-${impl}" || die
-	done
+			"${D}/usr/bin/${destination_file}" || die
+	else
+		einfo "Installing ${source_file} for multiple implementations (default: ${default_impl})"
+		for impl in ${PYTHON_COMPAT}; do
+			use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
+
+			newins "${source_file}" "${destination_file}-${impl}"
+			fperms 755 "/usr/bin/${destination_file}-${impl}"
+			sed -i \
+				-e "1i#!$(_python-distutils-ng_get_binary_for_implementation "${impl}")" \
+				"${D}/usr/bin/${destination_file}-${impl}" || die
+		done
 
-	dosym "${destination_file}-${default_impl}" "/usr/bin/${destination_file}"
+		dosym "${destination_file}-${default_impl}" "/usr/bin/${destination_file}"
+	fi
 }
 
 # Phase function: src_prepare



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-03-01 18:39 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-03-01 18:39 UTC (permalink / raw
  To: gentoo-commits

commit:     469f7e8ef78f71c45cab73f2a3e5fe02025582ac
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Thu Mar  1 18:39:01 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Thu Mar  1 18:39:01 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=469f7e8e

Allow specifying target directory for script installation with default value of /usr/bin.

---
 eclass/python-distutils-ng.eclass |   38 +++++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index 6b63b28..a001aa6 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -201,21 +201,24 @@ _python-distutils-ng_has_compileall_opt() {
 }
 
 # @FUNCTION: python-distutils-ng_doscript
-# @USAGE: script_file_name
+# @USAGE: script_file_name [destination_directory]
 # @DESCRIPTION:
-# Install given script file in /usr/bin/ for all enabled implementations using
-# original script name as a base name.
+# Install given script file in destination directory (for default value check
+# python-distutils-ng_newscript) for all enabled implementations using original
+# script name as a base name.
 #
-# See also python-distutils-ng_newscript
+# See also python-distutils-ng_newscript for more details.
 python-distutils-ng_doscript() {
-	python-distutils-ng_newscript "${1}" "$(basename "${1}")"
+	python-distutils-ng_newscript "${1}" "$(basename "${1}")" "${2}"
 }
 
 # @FUNCTION: python-distutils-ng_newscript
-# @USAGE: script_file_name new_file_name
+# @USAGE: script_file_name new_file_name [destination_directory]
 # @DESCRIPTION:
-# Install given script file in /usr/bin/ for all enabled implementations using
-# new_file_name as a base name.
+# Install given script file in destination directory for all enabled
+# implementations using new_file_name as a base name.
+#
+# Destination directory defaults to /usr/bin.
 #
 # If only one Python implementation is enabled the script will be installed
 # as-is. Otherwise each script copy will have the name mangled to
@@ -235,6 +238,8 @@ python-distutils-ng_newscript() {
 	local destination_file="${2}"
 	local default_impl="${PYTHON_DEFAULT_IMPLEMENTATION}"
 	local enabled_impls=0
+	local destination_directory="/usr/bin"
+	[[ -n "${3}" ]] && destination_directory="${3}"
 
 	for impl in ${PYTHON_COMPAT}; do
 		use "python_targets_${impl}" || continue
@@ -254,27 +259,28 @@ python-distutils-ng_newscript() {
 
 	[[ -n "${default_impl}" ]] || die "Could not select default implementation"
 
-	insinto /usr/bin
+	dodir "${destination_directory}"
+	insinto "${destination_directory}"
 	if [[ "${enabled_impls}" = "1" ]]; then
-		einfo "Installing ${source_file} for single implementation: ${default_impl}"
+		einfo "Installing ${source_file} for single implementation (${default_impl}) in ${destination_directory}"
 		newins "${source_file}" "${destination_file}"
-		fperms 755 "/usr/bin/${destination_file}"
+		fperms 755 "${destination_directory}/${destination_file}"
 		sed -i \
 			-e "1i#!$(_python-distutils-ng_get_binary_for_implementation "${impl}")" \
-			"${D}/usr/bin/${destination_file}" || die
+			"${D}${destination_directory}/${destination_file}" || die
 	else
-		einfo "Installing ${source_file} for multiple implementations (default: ${default_impl})"
+		einfo "Installing ${source_file} for multiple implementations (default: ${default_impl}) in ${destination_directory}"
 		for impl in ${PYTHON_COMPAT}; do
 			use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
 
 			newins "${source_file}" "${destination_file}-${impl}"
-			fperms 755 "/usr/bin/${destination_file}-${impl}"
+			fperms 755 "${destination_directory}/${destination_file}-${impl}"
 			sed -i \
 				-e "1i#!$(_python-distutils-ng_get_binary_for_implementation "${impl}")" \
-				"${D}/usr/bin/${destination_file}-${impl}" || die
+				"${D}${destination_directory}/${destination_file}-${impl}" || die
 		done
 
-		dosym "${destination_file}-${default_impl}" "/usr/bin/${destination_file}"
+		dosym "${destination_file}-${default_impl}" "${destination_directory}/${destination_file}"
 	fi
 }
 



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-03-03 10:06 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-03-03 10:06 UTC (permalink / raw
  To: gentoo-commits

commit:     2e4beca59ccb101db4aac170a922c4d9d0239a78
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Sat Mar  3 10:03:30 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Sat Mar  3 10:03:30 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=2e4beca5

Rename PACKAGE_SPECIFIC_S.

---
 eclass/python-distutils-ng.eclass |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index a001aa6..ca6eaa8 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -118,7 +118,7 @@ for impl in ${PYTHON_COMPAT}; do
 	fi
 done
 
-PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
+_PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
 
 # @FUNCTION: _python-distutils-ng_run_for_impl
 # @USAGE: implementation command_to_run
@@ -130,7 +130,7 @@ _python-distutils-ng_run_for_impl() {
 	local impl="${1}"
 	local command="${2}"
 
-	S="${WORKDIR}/impl_${impl}/${PACKAGE_SPECIFIC_S}"
+	S="${WORKDIR}/impl_${impl}/${_PACKAGE_SPECIFIC_S}"
 	PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")"
 	EPYTHON="${impl/_/.}"
 
@@ -307,7 +307,7 @@ python-distutils-ng_src_prepare() {
 
 		einfo "Creating copy for ${impl} in ${WORKDIR}/impl_${impl}"
 		mkdir -p "${WORKDIR}/impl_${impl}" || die
-		cp -pr "${S}" "${WORKDIR}/impl_${impl}/${PACKAGE_SPECIFIC_S}" || die
+		cp -pr "${S}" "${WORKDIR}/impl_${impl}/${_PACKAGE_SPECIFIC_S}" || die
 	done
 
 	# Run python_prepare for each implementation:
@@ -357,7 +357,7 @@ python-distutils-ng_src_install() {
 			_python-distutils-ng_default_distutils_install
 	fi
 
-	S="${WORKDIR}/${PACKAGE_SPECIFIC_S}"
+	S="${WORKDIR}/${_PACKAGE_SPECIFIC_S}"
 	if type python_install_all &> /dev/null; then
 		einfo "Running python_install_all in ${S} for all"
 		python_install_all



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] dev/nelchael:master commit in: eclass/
@ 2012-03-03 18:02 Krzysztof Pawlik
  0 siblings, 0 replies; 10+ messages in thread
From: Krzysztof Pawlik @ 2012-03-03 18:02 UTC (permalink / raw
  To: gentoo-commits

commit:     d2da3fa38c166446de16e6806ea3860d6c461a12
Author:     Krzysztof Pawlik <none <AT> none>
AuthorDate: Sat Mar  3 18:02:47 2012 +0000
Commit:     Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
CommitDate: Sat Mar  3 18:02:47 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=d2da3fa3

Documentation for eclass.

---
 eclass/python-distutils-ng.eclass |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index ca6eaa8..3260d1b 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -13,7 +13,19 @@
 # The Python eclass is designed to allow an easier installation of Python
 # packages and their incorporation into the Gentoo Linux system.
 #
-# TODO: Document implementations!
+# This eclass provides functions for following phases:
+#  - src_prepare - you can define python_prepare_all function that will be run
+#    before creating implementation-specific directory and python_prepare
+#    function that will be run for each implementation
+#  - src_configure - you can define python_configure function that will be run
+#    for each implementation
+#  - src_compile - you can define python_compile function that will be run for
+#    each implementation, default function will run `setup.py build'
+#  - src_test - you can define python_test function that will be run for each
+#    implementation
+#  - src_install - you can define python_install function that will be run for
+#    each implementation and python_install_all that will be run in original
+#    directory (so it wil lnot contain any implementation-specific files)
 
 # @ECLASS-VARIABLE: PYTHON_COMPAT
 # @DESCRIPTION:



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-03 18:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-03 10:06 [gentoo-commits] dev/nelchael:master commit in: eclass/ Krzysztof Pawlik
  -- strict thread matches above, loose matches on Subject: below --
2012-03-03 18:02 Krzysztof Pawlik
2012-03-01 18:39 Krzysztof Pawlik
2012-03-01 18:22 Krzysztof Pawlik
2012-03-01 17:54 Krzysztof Pawlik
2012-03-01 17:54 Krzysztof Pawlik
2012-02-29 17:38 Krzysztof Pawlik
2012-02-29 17:38 Krzysztof Pawlik
2012-02-29 17:38 Krzysztof Pawlik
2012-02-28 20:52 Krzysztof Pawlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox