Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/tuned/, sys-apps/tuned/files/
Date: Fri, 15 Jul 2016 06:42:33
Message-Id: 1468564822.519ea089efa6a481624a643cea7d143f702a8681.dlan@gentoo
1 commit: 519ea089efa6a481624a643cea7d143f702a8681
2 Author: Yixun Lan <dlan <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 15 06:36:17 2016 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 15 06:40:22 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=519ea089
7
8 sys-apps/tuned: fix missing dev-python/pygobject dep
9
10 Gentoo-Bug: 587636
11
12 Package-Manager: portage-2.3.0_rc1
13 Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>
14
15 sys-apps/tuned/files/tuned-2.6.0-pygobject.patch | 46 ++++++++++++++++++++
16 sys-apps/tuned/tuned-2.6.0-r2.ebuild | 54 ++++++++++++++++++++++++
17 2 files changed, 100 insertions(+)
18
19 diff --git a/sys-apps/tuned/files/tuned-2.6.0-pygobject.patch b/sys-apps/tuned/files/tuned-2.6.0-pygobject.patch
20 new file mode 100644
21 index 0000000..832a413
22 --- /dev/null
23 +++ b/sys-apps/tuned/files/tuned-2.6.0-pygobject.patch
24 @@ -0,0 +1,46 @@
25 +From 8b60a06dbc90e96c5b08a43e062286c979f7b333 Mon Sep 17 00:00:00 2001
26 +From: Yixun Lan <dlan@g.o>
27 +Date: Fri, 15 Jul 2016 14:17:47 +0800
28 +Subject: [PATCH] pygobject: fix import Gtk without specify version error
29 +
30 +Signed-off-by: Yixun Lan <dlan@g.o>
31 +---
32 + tuned-gui.py | 22 +++++++++++++++++++---
33 + 1 file changed, 19 insertions(+), 3 deletions(-)
34 +
35 +diff --git a/tuned-gui.py b/tuned-gui.py
36 +index b525e8d..0555404 100755
37 +--- a/tuned-gui.py
38 ++++ b/tuned-gui.py
39 +@@ -24,9 +24,25 @@ Created on Oct 15, 2013
40 +
41 + @author: mstana
42 + '''
43 +-
44 +-import gi.repository.GObject as GObject
45 +-import gi.repository.Gtk as Gtk
46 ++try:
47 ++ import gi
48 ++except ImportError:
49 ++ raise ImportError("Gtk3 backend requires pygobject to be installed.")
50 ++
51 ++try:
52 ++ gi.require_version("Gtk", "3.0")
53 ++except AttributeError:
54 ++ raise ImportError(
55 ++ "pygobject version too old -- it must have require_version")
56 ++except ValueError:
57 ++ raise ImportError(
58 ++ "Gtk3 backend requires the GObject introspection bindings for Gtk 3 "
59 ++ "to be installed.")
60 ++
61 ++try:
62 ++ from gi.repository import Gtk, GObject
63 ++except ImportError:
64 ++ raise ImportError("Gtk3 backend requires pygobject to be installed.")
65 +
66 + import sys
67 + import os
68 +--
69 +2.9.0
70 +
71
72 diff --git a/sys-apps/tuned/tuned-2.6.0-r2.ebuild b/sys-apps/tuned/tuned-2.6.0-r2.ebuild
73 new file mode 100644
74 index 0000000..728b7de
75 --- /dev/null
76 +++ b/sys-apps/tuned/tuned-2.6.0-r2.ebuild
77 @@ -0,0 +1,54 @@
78 +# Copyright 1999-2016 Gentoo Foundation
79 +# Distributed under the terms of the GNU General Public License v2
80 +# $Id$
81 +
82 +EAPI=5
83 +
84 +PYTHON_COMPAT=( python2_7 )
85 +
86 +inherit python-single-r1 systemd
87 +
88 +DESCRIPTION="Daemon for monitoring and adaptive tuning of system devices"
89 +HOMEPAGE="https://fedorahosted.org/tuned/"
90 +SRC_URI="https://fedorahosted.org/releases/t/u/tuned/${P}.tar.bz2"
91 +
92 +LICENSE="GPL-2"
93 +SLOT="0"
94 +KEYWORDS="~amd64 ~x86"
95 +IUSE=""
96 +
97 +COMMON_DEPEND="${PYTHON_DEPS}
98 + dev-python/configobj[${PYTHON_USEDEP}]
99 + dev-python/decorator[${PYTHON_USEDEP}]
100 + dev-python/pyudev[${PYTHON_USEDEP}]
101 + dev-python/dbus-python[${PYTHON_USEDEP}]
102 + dev-python/pygobject:3[${PYTHON_USEDEP}]
103 +"
104 +DEPEND="${COMMON_DEPEND}"
105 +RDEPEND="${COMMON_DEPEND}
106 + sys-apps/dbus
107 + sys-power/powertop
108 + dev-util/systemtap
109 +"
110 +
111 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
112 +
113 +src_prepare() {
114 + epatch "${FILESDIR}"/${P}-pygobject.patch
115 +
116 + sed -i \
117 + -e "/^UNITDIR = /s:\$(shell rpm --eval '%{_unitdir}'):$(systemd_get_unitdir):" \
118 + -e "/\$(DESTDIR)\/run\/tuned/d" \
119 + Makefile ||die
120 +
121 + sed -i \
122 + -i "s:/usr/bin/lsblk:/bin/lsblk:g" \
123 + tuned/plugins/plugin_mounts.py || die
124 +}
125 +
126 +src_install() {
127 + default
128 + newinitd "${FILESDIR}"/tuned.initd tuned
129 +
130 + python_fix_shebang "${ED}"
131 +}