From 4d87fa20f0151b8b7397c4a89a9f5127a0e041f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 27 Oct 2012 12:45:53 +0200 Subject: [PATCH 07/11] Convert x11-misc/redshift to python-r1 (example). This serves as an example how the new functions can be used. --- gx86/x11-misc/redshift/redshift-1.7-r1.ebuild | 33 ++++++++++++--------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/gx86/x11-misc/redshift/redshift-1.7-r1.ebuild b/gx86/x11-misc/redshift/redshift-1.7-r1.ebuild index f3bd210..589e571 100644 --- a/gx86/x11-misc/redshift/redshift-1.7-r1.ebuild +++ b/gx86/x11-misc/redshift/redshift-1.7-r1.ebuild @@ -3,12 +3,9 @@ # $Header: /var/cvsroot/gentoo-x86/x11-misc/redshift/redshift-1.7-r1.ebuild,v 1.5 2012/08/16 20:40:38 hasufell Exp $ EAPI=4 +PYTHON_COMPAT=( python{2_6,2_7} ) -PYTHON_DEPEND="gtk? 2:2.6" -SUPPORT_PYTHON_ABIS="1" -RESTRICT_PYTHON_ABIS="2.[45] 3.*" - -inherit autotools eutils gnome2-utils python +inherit autotools eutils gnome2-utils python-r1 DESCRIPTION="A screen color temperature adjusting software" HOMEPAGE="http://jonls.dk/redshift/" @@ -24,7 +21,8 @@ COMMON_DEPEND=">=x11-libs/libX11-1.4 x11-libs/libxcb geoclue? ( app-misc/geoclue ) gnome? ( dev-libs/glib:2 - >=gnome-base/gconf-2 )" + >=gnome-base/gconf-2 ) + gtk? ( ${PYTHON_DEPS} )" RDEPEND="${COMMON_DEPEND} gtk? ( >=dev-python/pygtk-2 dev-python/pyxdg )" @@ -32,12 +30,14 @@ DEPEND="${COMMON_DEPEND} nls? ( sys-devel/gettext )" src_prepare() { - >py-compile epatch "${FILESDIR}"/${P}-make-conditionals.patch + epatch_user eautoreconf } src_configure() { + python_export_best + econf \ --disable-silent-rules \ $(use_enable nls) \ @@ -53,17 +53,12 @@ src_configure() { src_install() { default - # handle multiple python abi support - per_abi_install() { - cp "${D}"/usr/bin/gtk-redshift "${D}"/usr/bin/gtk-redshift-${PYTHON_ABI} || die - python_convert_shebangs ${PYTHON_ABI} "${D}"/usr/bin/gtk-redshift-${PYTHON_ABI} - emake DESTDIR="${D}" pythondir="$(python_get_sitedir)" -C src/gtk-redshift install - } + if use gtk; then + python_foreach_impl \ + emake DESTDIR="${D}" pythondir="$(python_get_sitedir)" \ + -C src/gtk-redshift install - if use gtk ; then - rm -R "${D}"/usr/$(get_libdir)/python* || die - python_execute_function per_abi_install - python_generate_wrapper_scripts -f "${D}"/usr/bin/gtk-redshift + python_replicate_scripts "${D}"/usr/bin/gtk-redshift fi } @@ -72,9 +67,9 @@ pkg_preinst() { } pkg_postinst() { - use gtk && { gnome2_icon_cache_update; python_mod_optimize gtk_${PN}; } + use gtk && gnome2_icon_cache_update } pkg_postrm() { - use gtk && { gnome2_icon_cache_update; python_mod_cleanup gtk_${PN}; } + use gtk && gnome2_icon_cache_update } -- 1.7.12.4