summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/distutils-r1.eclass46
-rw-r--r--eclass/python-any-r1.eclass2
-rw-r--r--eclass/python-r1.eclass244
-rw-r--r--eclass/python-utils-r1.eclass6
-rw-r--r--xfce-extra/tumbler/Manifest1
-rw-r--r--xfce-extra/tumbler/tumbler-0.1.92.1.ebuild57
6 files changed, 262 insertions, 94 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 1376326c9579..167af95eaed6 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: distutils-r1.eclass
@@ -191,6 +191,12 @@ fi
# (allowing any implementation). If multiple values are specified,
# implementations matching any of the patterns will be accepted.
#
+# The patterns can be either fnmatch-style patterns (matched via bash
+# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
+# appropriately all enabled Python 2/3 implementations (alike
+# python_is_python3). Remember to escape or quote the fnmatch patterns
+# to prevent accidental shell filename expansion.
+#
# If the restriction needs to apply conditionally to a USE flag,
# the variable should be set conditionally as well (e.g. in an early
# phase function or other convenient location).
@@ -666,23 +672,20 @@ distutils-r1_run_phase() {
_distutils-r1_run_common_phase() {
local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
- if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- local best_impl patterns=( "${DISTUTILS_ALL_SUBPHASE_IMPLS[@]-*}" )
- _distutils_try_impl() {
- local pattern
- for pattern in "${patterns[@]}"; do
- if [[ ${EPYTHON} == ${pattern} ]]; then
- best_impl=${MULTIBUILD_VARIANT}
- fi
- done
- }
- python_foreach_impl _distutils_try_impl
- unset -f _distutils_try_impl
-
- local PYTHON_COMPAT=( "${best_impl}" )
+ if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
+ # reuse the dedicated code branch
+ _distutils-r1_run_foreach_impl "${@}"
+ else
+ local -x EPYTHON PYTHON
+ local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
+ python_setup "${DISTUTILS_ALL_SUBPHASE_IMPLS[@]}"
+
+ local MULTIBUILD_VARIANTS=( "${EPYTHON/./_}" )
+ # store for restoring after distutils-r1_run_phase.
+ local _DISTUTILS_INITIAL_CWD=${PWD}
+ multibuild_foreach_variant \
+ distutils-r1_run_phase "${@}"
fi
-
- _distutils-r1_run_foreach_impl "${@}"
}
# @FUNCTION: _distutils-r1_run_foreach_impl
@@ -693,15 +696,6 @@ _distutils-r1_run_common_phase() {
_distutils-r1_run_foreach_impl() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${DISTUTILS_NO_PARALLEL_BUILD} ]]; then
- [[ ${EAPI} == [45] ]] || die "DISTUTILS_NO_PARALLEL_BUILD is banned in EAPI ${EAPI}"
-
- eqawarn "DISTUTILS_NO_PARALLEL_BUILD is no longer meaningful. Now all builds"
- eqawarn "are non-parallel. Please remove it from the ebuild."
-
- unset DISTUTILS_NO_PARALLEL_BUILD # avoid repeated warnings
- fi
-
# store for restoring after distutils-r1_run_phase.
local _DISTUTILS_INITIAL_CWD=${PWD}
set -- distutils-r1_run_phase "${@}"
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 69f7bb736d22..e4d2d46bc706 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -224,7 +224,7 @@ python_gen_any_dep() {
local depstr=${1}
[[ ${depstr} ]] || die "No dependency string provided"
- local PYTHON_PKG_DEP out=
+ local i PYTHON_PKG_DEP out=
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
python_export "${i}" PYTHON_PKG_DEP
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index 8de0a851856c..5ec23d23d8cc 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -231,7 +231,7 @@ _python_set_globals() {
PYTHON_DEPS=${deps}
PYTHON_REQUIRED_USE=${requse}
PYTHON_USEDEP=${usedep}
- readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_USEDEP
+ readonly PYTHON_DEPS PYTHON_REQUIRED_USE
fi
}
_python_set_globals
@@ -242,10 +242,25 @@ if [[ ! ${_PYTHON_R1} ]]; then
# @FUNCTION: _python_validate_useflags
# @INTERNAL
# @DESCRIPTION:
-# Enforce the proper setting of PYTHON_TARGETS.
+# Enforce the proper setting of PYTHON_TARGETS, if PYTHON_COMPAT_OVERRIDE
+# is not in effect. If it is, just warn that the flags will be ignored.
_python_validate_useflags() {
debug-print-function ${FUNCNAME} "${@}"
+ if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
+ if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
+ ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python"
+ ewarn "implementations will be enabled:"
+ ewarn
+ ewarn " ${PYTHON_COMPAT_OVERRIDE}"
+ ewarn
+ ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored."
+ _PYTHON_COMPAT_OVERRIDE_WARNED=1
+ fi
+ # we do not use flags with PCO
+ return
+ fi
+
local i
for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
@@ -453,6 +468,86 @@ python_gen_impl_dep() {
echo "${matches[@]}"
}
+# @FUNCTION: python_gen_any_dep
+# @USAGE: <dependency-block> [<impl-pattern>...]
+# @DESCRIPTION:
+# Generate an any-of dependency that enforces a version match between
+# the Python interpreter and Python packages. <dependency-block> needs
+# to list one or more dependencies with verbatim '${PYTHON_USEDEP}'
+# references (quoted!) that will get expanded inside the function.
+# Optionally, patterns may be specified to restrict the dependency
+# to a subset of Python implementations supported by the ebuild.
+#
+# The patterns can be either fnmatch-style patterns (matched via bash
+# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
+# appropriately all enabled Python 2/3 implementations (alike
+# python_is_python3). Remember to escape or quote the fnmatch patterns
+# to prevent accidental shell filename expansion.
+#
+# This should be used along with an appropriate python_check_deps()
+# that checks which of the any-of blocks were matched, and python_setup
+# call that enables use of the matched implementation.
+#
+# Example use:
+# @CODE
+# DEPEND="$(python_gen_any_dep '
+# dev-python/foo[${PYTHON_USEDEP}]
+# || ( dev-python/bar[${PYTHON_USEDEP}]
+# dev-python/baz[${PYTHON_USEDEP}] )' -2)"
+#
+# python_check_deps() {
+# has_version "dev-python/foo[${PYTHON_USEDEP}]" \
+# && { has_version "dev-python/bar[${PYTHON_USEDEP}]" \
+# || has_version "dev-python/baz[${PYTHON_USEDEP}]"; }
+# }
+#
+# src_compile() {
+# python_foreach_impl usual_code
+#
+# # some common post-build task that requires Python 2
+# python_setup -2
+# emake frobnicate
+# }
+# @CODE
+#
+# Example value:
+# @CODE
+# || (
+# (
+# dev-lang/python:2.7
+# dev-python/foo[python_targets_python2_7(-)?,python_single_target_python2_7(+)?]
+# || ( dev-python/bar[python_targets_python2_7(-)?,python_single_target_python2_7(+)?]
+# dev-python/baz[python_targets_python2_7(-)?,python_single_target_python2_7(+)?] )
+# )
+# (
+# dev-lang/python:3.3
+# dev-python/foo[python_targets_python3_3(-)?,python_single_target_python3_3(+)?]
+# || ( dev-python/bar[python_targets_python3_3(-)?,python_single_target_python3_3(+)?]
+# dev-python/baz[python_targets_python3_3(-)?,python_single_target_python3_3(+)?] )
+# )
+# )
+# @CODE
+python_gen_any_dep() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ local depstr=${1}
+ [[ ${depstr} ]] || die "No dependency string provided"
+ shift
+
+ local i PYTHON_PKG_DEP out=
+ for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
+ if _python_impl_matches "${i}" "${@-*}"; then
+ local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
+ python_export "${i}" PYTHON_PKG_DEP
+
+ local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
+ # note: need to strip '=' slot operator for || deps
+ out="( ${PYTHON_PKG_DEP%=} ${i_depstr} ) ${out}"
+ fi
+ done
+ echo "|| ( ${out})"
+}
+
# @ECLASS-VARIABLE: BUILD_DIR
# @DESCRIPTION:
# The current build directory. In global scope, it is supposed to
@@ -490,23 +585,13 @@ python_copy_sources() {
# @DESCRIPTION:
# Set up the enabled implementation list.
_python_obtain_impls() {
- if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
- if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
- ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python"
- ewarn "implementations will be enabled:"
- ewarn
- ewarn " ${PYTHON_COMPAT_OVERRIDE}"
- ewarn
- ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored."
- _PYTHON_COMPAT_OVERRIDE_WARNED=1
- fi
+ _python_validate_useflags
+ if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
return
fi
- _python_validate_useflags
-
MULTIBUILD_VARIANTS=()
local impl
@@ -555,47 +640,30 @@ python_foreach_impl() {
multibuild_foreach_variant _python_multibuild_wrapper "${@}"
}
-# @FUNCTION: python_parallel_foreach_impl
-# @USAGE: <command> [<args>...]
+# @FUNCTION: python_setup
+# @USAGE: [<impl-pattern>...]
# @DESCRIPTION:
-# Run the given command for each of the enabled Python implementations.
-# If additional parameters are passed, they will be passed through
-# to the command.
+# Find the best (most preferred) Python implementation that is suitable
+# for running common Python code. Set the Python build environment up
+# for that implementation. This function has two modes of operation:
+# pure and any-of dep.
#
-# The function will return 0 status if all invocations succeed.
-# Otherwise, the return code from first failing invocation will
-# be returned.
+# The pure mode is used if python_check_deps() function is not declared.
+# In this case, an implementation is considered suitable if it is
+# supported (in PYTHON_COMPAT), enabled (via USE flags) and matches
+# at least one of the patterns passed (or '*' if no patterns passed).
#
-# For each command being run, EPYTHON, PYTHON and BUILD_DIR are set
-# locally, and the former two are exported to the command environment.
+# Implementation restrictions in the pure mode need to be accompanied
+# by appropriate REQUIRED_USE constraints. Otherwise, the eclass may
+# fail at build time due to unsatisfied dependencies.
#
-# This command used to be the parallel variant of python_foreach_impl.
-# However, the parallel run support has been removed to simplify
-# the eclasses and make them more predictable and therefore it is now
-# only a deprecated alias to python_foreach_impl.
-python_parallel_foreach_impl() {
- debug-print-function ${FUNCNAME} "${@}"
-
- [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}"
-
- if [[ ! ${_PYTHON_PARALLEL_WARNED} ]]; then
- eqawarn "python_parallel_foreach_impl() is no longer meaningful. All runs"
- eqawarn "are non-parallel now. Please replace the call with python_foreach_impl."
-
- _PYTHON_PARALLEL_WARNED=1
- fi
-
- local MULTIBUILD_VARIANTS
- _python_obtain_impls
- multibuild_foreach_variant _python_multibuild_wrapper "${@}"
-}
-
-# @FUNCTION: python_setup
-# @USAGE: [<impl-pattern>...]
-# @DESCRIPTION:
-# Find the best (most preferred) Python implementation that is enabled
-# and matches at least one of the patterns passed (or '*' if no patterns
-# passed). Set the Python build environment up for that implementation.
+# The any-of dep mode is used if python_check_deps() is declared.
+# In this mode, an implementation is considered suitable if it is
+# supported, matches at least one of the patterns and python_check_deps()
+# has successful return code. USE flags are not considered.
+#
+# The python_check_deps() function in the any-of mode needs to be
+# accompanied by appropriate any-of dependencies.
#
# The patterns can be either fnmatch-style patterns (matched via bash
# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate
@@ -607,13 +675,28 @@ python_parallel_foreach_impl() {
# of python_foreach_impl calls (e.g. for shared processes like doc
# building). python_foreach_impl sets up the build environment itself.
#
-# If the specific commands support only a subset of Python
-# implementations, patterns need to be passed to restrict the allowed
-# implementations.
-#
-# Example:
+# Pure mode example:
# @CODE
# DEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )"
+# REQUIRED_USE="doc? ( $(python_gen_useflags 'python2*') )"
+#
+# src_compile() {
+# #...
+# if use doc; then
+# python_setup 'python2*'
+# make doc
+# fi
+# }
+# @CODE
+#
+# Any-of mode example:
+# @CODE
+# DEPEND="doc? (
+# $(python_gen_any_dep 'dev-python/epydoc[${PYTHON_USEDEP}]' 'python2*') )"
+#
+# python_check_deps() {
+# has_version "dev-python/epydoc[${PYTHON_USEDEP}]"
+# }
#
# src_compile() {
# #...
@@ -626,16 +709,48 @@ python_parallel_foreach_impl() {
python_setup() {
debug-print-function ${FUNCNAME} "${@}"
- local best_impl patterns=( "${@-*}" )
- _python_try_impl() {
- if _python_impl_matches "${EPYTHON}" "${patterns[@]}"; then
- best_impl=${EPYTHON}
+ _python_validate_useflags
+ local pycompat=( "${PYTHON_COMPAT[@]}" )
+ if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
+ pycompat=( ${PYTHON_COMPAT_OVERRIDE} )
+ fi
+
+ local has_check_deps
+ declare -f python_check_deps >/dev/null && has_check_deps=1
+
+ # (reverse iteration -- newest impl first)
+ local found
+ for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do
+ local impl=${_PYTHON_SUPPORTED_IMPLS[i]}
+
+ # check PYTHON_COMPAT[_OVERRIDE]
+ has "${impl}" "${pycompat[@]}" || continue
+
+ # match USE flags only if override is not in effect
+ # and python_check_deps() is not defined
+ if [[ ! ${PYTHON_COMPAT_OVERRIDE} && ! ${has_check_deps} ]]; then
+ use "python_targets_${impl}" || continue
fi
- }
- python_foreach_impl _python_try_impl
- unset -f _python_try_impl
- if [[ ! ${best_impl} ]]; then
+ # check patterns
+ _python_impl_matches "${impl}" "${@-*}" || continue
+
+ python_export "${impl}" EPYTHON PYTHON
+
+ # if python_check_deps() is declared, switch into any-of mode
+ if [[ ${has_check_deps} ]]; then
+ # first check if the interpreter is installed
+ python_is_installed "${impl}" || continue
+ # then run python_check_deps
+ local PYTHON_USEDEP="python_targets_${impl}(-),python_single_target_${impl}(+)"
+ python_check_deps || continue
+ fi
+
+ found=1
+ break
+ done
+
+ if [[ ! ${found} ]]; then
eerror "${FUNCNAME}: none of the enabled implementation matched the patterns."
eerror " patterns: ${@-'(*)'}"
eerror "Likely a REQUIRED_USE constraint (possibly USE-conditional) is missing."
@@ -644,7 +759,6 @@ python_setup() {
die "${FUNCNAME}: no enabled implementation satisfy requirements"
fi
- python_export "${best_impl}" EPYTHON PYTHON
python_wrapper_setup
}
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 0bf7e7ec1a3e..68fb9ba2578d 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -169,7 +169,8 @@ _python_set_impls() {
# Check whether the specified <impl> matches at least one
# of the patterns following it. Return 0 if it does, 1 otherwise.
#
-# <impl> should be in PYTHON_COMPAT form. The patterns can be either:
+# <impl> can be in PYTHON_COMPAT or EPYTHON form. The patterns can be
+# either:
# a) fnmatch-style patterns, e.g. 'python2*', 'pypy'...
# b) '-2' to indicate all Python 2 variants (= !python_is_python3)
# c) '-3' to indicate all Python 3 variants (= python_is_python3)
@@ -186,7 +187,8 @@ _python_impl_matches() {
elif [[ ${pattern} == -3 ]]; then
python_is_python3 "${impl}"
return
- elif [[ ${impl} == ${pattern} ]]; then
+ # unify value style to allow lax matching
+ elif [[ ${impl/./_} == ${pattern/./_} ]]; then
return 0
fi
done
diff --git a/xfce-extra/tumbler/Manifest b/xfce-extra/tumbler/Manifest
index a30a7f6c3802..c720faff3116 100644
--- a/xfce-extra/tumbler/Manifest
+++ b/xfce-extra/tumbler/Manifest
@@ -1,2 +1,3 @@
DIST tumbler-0.1.31.tar.bz2 550650 SHA256 d0fd329273ff6ac98885eade4c3d8c87a4dd0816f713646130808bfa90b87173 SHA512 8c5fc914be28b899155a8c3b3fec21c5e74c26569ae1bf6a18ae87c930927828570027d77d3ec0435b8db9449a9ea933da9ae5e00f7fdf13a335c0a25bb14d04 WHIRLPOOL 9d21da3fe29f3f175b95e01aec6d378803d54ab64213f16b0f559e304998905cedc15de7b00a5267dd5ed324568e7a03209432ba200206a9e65d694eccb7f803
DIST tumbler-0.1.90.tar.bz2 559444 SHA256 1ae8ee8805f9c6574a15efcf325afb905c294366bdb65e9276bb42ac117f68aa SHA512 e1c04b76985facab0e0341c4920b039365f898aec002ec3f2d80272640b5f94b6202fbf3ed8824af0b861c47d3aa8007b74f0c9cb267acd6b0861fd4090963e9 WHIRLPOOL 919a1da021107a218e435061f262380efc81112700eacfd1b5acc3d76d547746179a9b941a55052582e311f473d59c17d1370dc485008b2b5f1cd74d7a15c9ae
+DIST tumbler-0.1.92.1.tar.bz2 569278 SHA256 77185e0322b882f206c94ed1236cdf1b944c26a075f8de03b752696923597418 SHA512 36935a626616e2184b6a1991150bf4f83ba3851fc6f643dbb277bc4374d007d43913b39aa4f33a42b4dbb930046286f085e4bf67e3135d7e45a88fb67639e138 WHIRLPOOL fbcc7ca7a73ddc16ea16c62f2a2cb93d65a8401c70e27957f7bad8cadf60b416bc66886c139f0a4d95791aca0d896a1efd2351d38c0f46782ee7c292ccd95950
diff --git a/xfce-extra/tumbler/tumbler-0.1.92.1.ebuild b/xfce-extra/tumbler/tumbler-0.1.92.1.ebuild
new file mode 100644
index 000000000000..2c88b7bc9274
--- /dev/null
+++ b/xfce-extra/tumbler/tumbler-0.1.92.1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="A thumbnail service for Thunar"
+HOMEPAGE="https://docs.xfce.org/xfce/thunar/start"
+SRC_URI="mirror://xfce/src/apps/${PN}/${PV%.*.*}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="curl ffmpeg gstreamer jpeg odf pdf raw"
+
+COMMON_DEPEND=">=dev-libs/glib-2.26:2=
+ media-libs/freetype:2=
+ media-libs/libpng:0=
+ >=sys-apps/dbus-1.6:=
+ >=x11-libs/gdk-pixbuf-2.14:2=
+ curl? ( >=net-misc/curl-7.25:= )
+ ffmpeg? ( >=media-video/ffmpegthumbnailer-2.0.8:= )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ jpeg? ( virtual/jpeg:0= )
+ odf? ( >=gnome-extra/libgsf-1.14.20:= )
+ pdf? ( >=app-text/poppler-0.12.4[cairo] )
+ raw? ( >=media-libs/libopenraw-0.0.8:=[gtk] )"
+RDEPEND="${COMMON_DEPEND}
+ >=xfce-base/thunar-1.4
+ gstreamer? ( media-plugins/gst-plugins-meta:1.0 )"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gtk-doc-am
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+src_configure() {
+ local myconf=(
+ $(use_enable curl cover-thumbnailer)
+ $(use_enable jpeg jpeg-thumbnailer)
+ $(use_enable ffmpeg ffmpeg-thumbnailer)
+ $(use_enable gstreamer gstreamer-thumbnailer)
+ $(use_enable odf odf-thumbnailer)
+ $(use_enable pdf poppler-thumbnailer)
+ $(use_enable raw raw-thumbnailer)
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+
+ find "${D}" -name '*.la' -delete || die
+}