diff options
author | Yixun Lan <dlan@gentoo.org> | 2016-07-15 14:36:17 +0800 |
---|---|---|
committer | Yixun Lan <dlan@gentoo.org> | 2016-07-15 14:40:22 +0800 |
commit | 519ea089efa6a481624a643cea7d143f702a8681 (patch) | |
tree | c6122570c4495e75bfd70102d9d442e147a4cee1 /sys-apps | |
parent | media-video/smtube: Correct dependency on USE=ssl (diff) | |
download | gentoo-519ea089efa6a481624a643cea7d143f702a8681.tar.gz gentoo-519ea089efa6a481624a643cea7d143f702a8681.tar.bz2 gentoo-519ea089efa6a481624a643cea7d143f702a8681.zip |
sys-apps/tuned: fix missing dev-python/pygobject dep
Gentoo-Bug: 587636
Package-Manager: portage-2.3.0_rc1
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/tuned/files/tuned-2.6.0-pygobject.patch | 46 | ||||
-rw-r--r-- | sys-apps/tuned/tuned-2.6.0-r2.ebuild | 54 |
2 files changed, 100 insertions, 0 deletions
diff --git a/sys-apps/tuned/files/tuned-2.6.0-pygobject.patch b/sys-apps/tuned/files/tuned-2.6.0-pygobject.patch new file mode 100644 index 000000000000..832a413641db --- /dev/null +++ b/sys-apps/tuned/files/tuned-2.6.0-pygobject.patch @@ -0,0 +1,46 @@ +From 8b60a06dbc90e96c5b08a43e062286c979f7b333 Mon Sep 17 00:00:00 2001 +From: Yixun Lan <dlan@gentoo.org> +Date: Fri, 15 Jul 2016 14:17:47 +0800 +Subject: [PATCH] pygobject: fix import Gtk without specify version error + +Signed-off-by: Yixun Lan <dlan@gentoo.org> +--- + tuned-gui.py | 22 +++++++++++++++++++--- + 1 file changed, 19 insertions(+), 3 deletions(-) + +diff --git a/tuned-gui.py b/tuned-gui.py +index b525e8d..0555404 100755 +--- a/tuned-gui.py ++++ b/tuned-gui.py +@@ -24,9 +24,25 @@ Created on Oct 15, 2013 + + @author: mstana + ''' +- +-import gi.repository.GObject as GObject +-import gi.repository.Gtk as Gtk ++try: ++ import gi ++except ImportError: ++ raise ImportError("Gtk3 backend requires pygobject to be installed.") ++ ++try: ++ gi.require_version("Gtk", "3.0") ++except AttributeError: ++ raise ImportError( ++ "pygobject version too old -- it must have require_version") ++except ValueError: ++ raise ImportError( ++ "Gtk3 backend requires the GObject introspection bindings for Gtk 3 " ++ "to be installed.") ++ ++try: ++ from gi.repository import Gtk, GObject ++except ImportError: ++ raise ImportError("Gtk3 backend requires pygobject to be installed.") + + import sys + import os +-- +2.9.0 + diff --git a/sys-apps/tuned/tuned-2.6.0-r2.ebuild b/sys-apps/tuned/tuned-2.6.0-r2.ebuild new file mode 100644 index 000000000000..728b7ded82a0 --- /dev/null +++ b/sys-apps/tuned/tuned-2.6.0-r2.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) + +inherit python-single-r1 systemd + +DESCRIPTION="Daemon for monitoring and adaptive tuning of system devices" +HOMEPAGE="https://fedorahosted.org/tuned/" +SRC_URI="https://fedorahosted.org/releases/t/u/tuned/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +COMMON_DEPEND="${PYTHON_DEPS} + dev-python/configobj[${PYTHON_USEDEP}] + dev-python/decorator[${PYTHON_USEDEP}] + dev-python/pyudev[${PYTHON_USEDEP}] + dev-python/dbus-python[${PYTHON_USEDEP}] + dev-python/pygobject:3[${PYTHON_USEDEP}] +" +DEPEND="${COMMON_DEPEND}" +RDEPEND="${COMMON_DEPEND} + sys-apps/dbus + sys-power/powertop + dev-util/systemtap +" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +src_prepare() { + epatch "${FILESDIR}"/${P}-pygobject.patch + + sed -i \ + -e "/^UNITDIR = /s:\$(shell rpm --eval '%{_unitdir}'):$(systemd_get_unitdir):" \ + -e "/\$(DESTDIR)\/run\/tuned/d" \ + Makefile ||die + + sed -i \ + -i "s:/usr/bin/lsblk:/bin/lsblk:g" \ + tuned/plugins/plugin_mounts.py || die +} + +src_install() { + default + newinitd "${FILESDIR}"/tuned.initd tuned + + python_fix_shebang "${ED}" +} |