Mailing List Archive

[PATCH x11-overlay] Convert packages to python-single-r1.
I have used the python-single-r1 eclass both for packages which build
Python libraries and those who unly use them in build-time. This is
necessary in order to ensure that the dependencies are properly
versioned as well.

This shows an important weakness of python-any-r1 design but I intend to
fix it at some point. See https://bugs.gentoo.org/show_bug.cgi?id=453248
---
media-libs/mesa/mesa-9999.ebuild | 13 +++++++++----
x11-libs/libxcb/libxcb-9999.ebuild | 16 ++++++++++++----
x11-libs/xpyb/xpyb-9999.ebuild | 15 +++++++++++----
x11-proto/xcb-proto/xcb-proto-9999.ebuild | 22 +++++++---------------
4 files changed, 39 insertions(+), 27 deletions(-)

diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild
index 6e79a23..4cb3488 100644
--- a/media-libs/mesa/mesa-9999.ebuild
+++ b/media-libs/mesa/mesa-9999.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $

-EAPI=4
+EAPI=5

EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"

@@ -11,7 +11,10 @@ if [[ ${PV} = 9999* ]]; then
EXPERIMENTAL="true"
fi

-inherit base autotools multilib flag-o-matic toolchain-funcs ${GIT_ECLASS}
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit base autotools multilib flag-o-matic toolchain-funcs python-single-r1 \
+ ${GIT_ECLASS}

OPENGL_DIR="xorg-x11"

@@ -117,8 +120,7 @@ DEPEND="${RDEPEND}
r600-llvm-compiler? ( >=sys-devel/llvm-3.1 )
video_cards_radeonsi? ( >=sys-devel/llvm-3.1 )
)
- =dev-lang/python-2*
- dev-libs/libxml2[python]
+ dev-libs/libxml2[python,${PYTHON_USEDEP}]
sys-devel/bison
sys-devel/flex
virtual/pkgconfig
@@ -141,6 +143,8 @@ QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
pkg_setup() {
# workaround toc-issue wrt #386545
use ppc64 && append-flags -mminimal-toc
+
+ python-single-r1_pkg_setup
}

src_unpack() {
@@ -263,6 +267,7 @@ src_configure() {
$(use_enable xorg) \
--with-dri-drivers=${DRI_DRIVERS} \
--with-gallium-drivers=${GALLIUM_DRIVERS} \
+ PYTHON2="${PYTHON}" \
${myconf}
}

diff --git a/x11-libs/libxcb/libxcb-9999.ebuild b/x11-libs/libxcb/libxcb-9999.ebuild
index dfe0a82..6f340cf 100644
--- a/x11-libs/libxcb/libxcb-9999.ebuild
+++ b/x11-libs/libxcb/libxcb-9999.ebuild
@@ -2,10 +2,13 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $

-EAPI=4
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7,3_1,3_2,3_3} )
+PYTHON_REQ_USE='xml'

XORG_DOC=doc
-inherit xorg-2
+inherit python-single-r1 xorg-2

DESCRIPTION="X C-language Bindings library"
HOMEPAGE="http://xcb.freedesktop.org/"
@@ -20,9 +23,14 @@ RDEPEND="dev-libs/libpthread-stubs
x11-libs/libXau
x11-libs/libXdmcp"
DEPEND="${RDEPEND}
- dev-lang/python[xml]
dev-libs/libxslt
- >=x11-proto/xcb-proto-1.7"
+ >=x11-proto/xcb-proto-1.7[${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ xorg-2_pkg_setup
+}

src_configure() {
XORG_CONFIGURE_OPTIONS=(
diff --git a/x11-libs/xpyb/xpyb-9999.ebuild b/x11-libs/xpyb/xpyb-9999.ebuild
index 3dee03d..adf6635 100644
--- a/x11-libs/xpyb/xpyb-9999.ebuild
+++ b/x11-libs/xpyb/xpyb-9999.ebuild
@@ -2,8 +2,10 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $

-EAPI=4
-inherit xorg-2
+EAPI=5
+
+PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} )
+inherit python-single-r1 xorg-2

EGIT_REPO_URI="git://anongit.freedesktop.org/git/xcb/xpyb"
#SRC_URI="http://xcb.freedesktop.org/dist/${P}.tar.bz2"
@@ -14,12 +16,17 @@ KEYWORDS="~amd64 ~x86"
IUSE="selinux"

RDEPEND=">=x11-libs/libxcb-1.1
- >=dev-lang/python-2.5
- >=x11-proto/xcb-proto-1.2"
+ >=x11-proto/xcb-proto-1.2[${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}"
DEPEND="${RDEPEND}"

DOCS=( NEWS README )

+pkg_setup() {
+ python-single-r1_pkg_setup
+ xorg-2_pkg_setup
+}
+
src_configure() {
XORG_CONFIGURE_OPTIONS=(
$(use_enable selinux xselinux)
diff --git a/x11-proto/xcb-proto/xcb-proto-9999.ebuild b/x11-proto/xcb-proto/xcb-proto-9999.ebuild
index 9fd53a0..cb7269f 100644
--- a/x11-proto/xcb-proto/xcb-proto-9999.ebuild
+++ b/x11-proto/xcb-proto/xcb-proto-9999.ebuild
@@ -2,10 +2,10 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $

-EAPI=4
-PYTHON_DEPEND="*"
+EAPI=5
+PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} )

-inherit python xorg-2
+inherit python-single-r1 xorg-2

DESCRIPTION="X C-language Bindings protocol headers"
HOMEPAGE="http://xcb.freedesktop.org/"
@@ -16,19 +16,11 @@ EGIT_REPO_URI="git://anongit.freedesktop.org/git/xcb/proto"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""

-RDEPEND=""
+RDEPEND="${PYTHON_DEPS}"
DEPEND="${RDEPEND}
dev-libs/libxml2"

-src_prepare() {
- python_clean_py-compile_files
- xorg-2_src_prepare
-}
-
-pkg_postinst() {
- python_mod_optimize xcbgen
-}
-
-pkg_postrm() {
- python_mod_cleanup xcbgen
+pkg_setup() {
+ python-single-r1_pkg_setup
+ xorg-2_pkg_setup
}
--
1.8.1.1