commit: 6f9dc03814c38c48464696d53c168b4b287d3272
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 25 22:07:28 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Nov 25 22:07:28 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=6f9dc038
dev-libs/libpeas: simplify multi-Python impl support
Simplify the multi-Python implementation support to reuse the upstream
build system. We can't properly support plugins for more than one
version of Python 2 and more than one version of Python 3 anyway, so no
point in wrapping the build to pretend supporting more.
Package-Manager: portage-2.2.14
Manifest-Sign-Key: EFB4464E!
---
dev-libs/libpeas/libpeas-1.12.1.ebuild | 52 ++++++++++++----------------------
dev-libs/libpeas/libpeas-9999.ebuild | 52 ++++++++++++----------------------
2 files changed, 36 insertions(+), 68 deletions(-)
diff --git a/dev-libs/libpeas/libpeas-1.12.1.ebuild
b/dev-libs/libpeas/libpeas-1.12.1.ebuild
index ccacf2e..8d5a6c1 100644
--- a/dev-libs/libpeas/libpeas-1.12.1.ebuild
+++ b/dev-libs/libpeas/libpeas-1.12.1.ebuild
@@ -34,49 +34,33 @@ DEPEND="${RDEPEND}
virtual/pkgconfig
"
-if_use_python_python_foreach_impl() {
- if use python; then
- python_foreach_impl run_in_build_dir "$@"
- else
- "$@"
- fi
-}
-
-src_prepare() {
- use python && python_copy_sources
- if_use_python_python_foreach_impl gnome2_src_prepare
-}
-
src_configure() {
- local myconf="
+ local myconf=(
$(use_enable glade glade-catalog)
$(use_enable gtk)
$(use_enable seed)
--disable-deprecation
- --disable-static"
+ --disable-static
+
+ # possibly overriden below
+ --disable-python{2,3}
+ )
# Wtf, --disable-gcov, --enable-gcov=no, --enable-gcov, all enable gcov
# What do we do about gdb, valgrind, gcov, etc?
- configuration() {
- local myconf="$@"
- [[ ${EPYTHON} == python2* ]] && myconf+=" --enable-python2
--disable-python3 PYTHON2_CONFIG=/usr/bin/python-config"
- [[ ${EPYTHON} == python3* ]] && myconf+=" --enable-python3
--disable-python2 PYTHON3_CONFIG=/usr/bin/python-config"
- gnome2_src_configure ${myconf}
+ python_configure() {
+ local v
+ python_is_python3 && v=3 || v=2
+ myconf+=(
+ "--enable-python${v}"
+ # it is just 'PYTHON' for py3 in the build system
+ "PYTHON${v#3}=${PYTHON}"
+ "PYTHON${v}_CONFIG=${PYTHON}-config"
+ )
}
+ use python && python_foreach_impl python_configure
- if use python; then
- python_foreach_impl run_in_build_dir configuration ${myconf}
- else
- gnome2_src_configure ${myconf}
- fi
-}
-
-src_compile() {
- if_use_python_python_foreach_impl gnome2_src_compile
-}
-
-src_install() {
- if_use_python_python_foreach_impl gnome2_src_install
+ gnome2_src_configure "${myconf[@]}"
}
src_test() {
@@ -86,5 +70,5 @@ src_test() {
# >>> from gi.repository import Gtk
# >>> Gtk.IconTheme.get_default().has_icon("gtk-about")
# This should return True, it returns False for Xvfb
- if_use_python_python_foreach_impl Xemake check
+ Xemake check
}
diff --git a/dev-libs/libpeas/libpeas-9999.ebuild
b/dev-libs/libpeas/libpeas-9999.ebuild
index ed81c96..0a8665d 100644
--- a/dev-libs/libpeas/libpeas-9999.ebuild
+++ b/dev-libs/libpeas/libpeas-9999.ebuild
@@ -46,49 +46,33 @@ if [[ ${PV} = 9999 ]]; then
DEPEND="${DEPEND} doc? ( >=dev-util/gtk-doc-1.11 )"
fi
-if_use_python_python_foreach_impl() {
- if use python; then
- python_foreach_impl run_in_build_dir "$@"
- else
- "$@"
- fi
-}
-
-src_prepare() {
- use python && python_copy_sources
- if_use_python_python_foreach_impl gnome2_src_prepare
-}
-
src_configure() {
- local myconf="
+ local myconf=(
$(use_enable glade glade-catalog)
$(use_enable gtk)
$(use_enable seed)
--disable-deprecation
- --disable-static"
+ --disable-static
+
+ # possibly overriden below
+ --disable-python{2,3}
+ )
# Wtf, --disable-gcov, --enable-gcov=no, --enable-gcov, all enable gcov
# What do we do about gdb, valgrind, gcov, etc?
- configuration() {
- local myconf="$@"
- [[ ${EPYTHON} == python2* ]] && myconf+=" --enable-python2
--disable-python3 PYTHON2_CONFIG=/usr/bin/python-config"
- [[ ${EPYTHON} == python3* ]] && myconf+=" --enable-python3
--disable-python2 PYTHON3_CONFIG=/usr/bin/python-config"
- gnome2_src_configure ${myconf}
+ python_configure() {
+ local v
+ python_is_python3 && v=3 || v=2
+ myconf+=(
+ "--enable-python${v}"
+ # it is just 'PYTHON' for py3 in the build system
+ "PYTHON${v#3}=${PYTHON}"
+ "PYTHON${v}_CONFIG=${PYTHON}-config"
+ )
}
+ use python && python_foreach_impl python_configure
- if use python; then
- python_foreach_impl run_in_build_dir configuration ${myconf}
- else
- gnome2_src_configure ${myconf}
- fi
-}
-
-src_compile() {
- if_use_python_python_foreach_impl gnome2_src_compile
-}
-
-src_install() {
- if_use_python_python_foreach_impl gnome2_src_install
+ gnome2_src_configure "${myconf[@]}"
}
src_test() {
@@ -98,5 +82,5 @@ src_test() {
# >>> from gi.repository import Gtk
# >>> Gtk.IconTheme.get_default().has_icon("gtk-about")
# This should return True, it returns False for Xvfb
- if_use_python_python_foreach_impl Xemake check
+ Xemake check
}