1 |
commit: 5ee30ef790d2a621dda91db7c7989ecc0196df71 |
2 |
Author: Kai Krakow <kai <AT> kaishome <DOT> de> |
3 |
AuthorDate: Sun Aug 26 16:17:14 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 24 06:20:54 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ee30ef7 |
7 |
|
8 |
games-util/gamemode: New ebuild suggestion |
9 |
|
10 |
GameMode from Feral Interactive is a systemd daemon allowing games to |
11 |
adjust the system to performance mode. It is supported by newer Feral |
12 |
titles and also supports other games by preloading a lib. |
13 |
|
14 |
Closes: https://bugs.gentoo.org/652906 |
15 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
16 |
Signed-off-by: Kai Krakow <kai <AT> kaishome.de> |
17 |
Co-authored-by: Mike Lothian <mike <AT> fireburn.co.uk> |
18 |
Co-authored-by: Erik Badman <erik.badman <AT> yahoo.com> |
19 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
20 |
Closes: https://github.com/gentoo/gentoo/pull/9700 |
21 |
|
22 |
games-util/gamemode/Manifest | 1 + |
23 |
games-util/gamemode/gamemode-1.2.ebuild | 102 +++++++++++++++++++++++++++++++ |
24 |
games-util/gamemode/gamemode-9999.ebuild | 102 +++++++++++++++++++++++++++++++ |
25 |
games-util/gamemode/metadata.xml | 16 +++++ |
26 |
profiles/features/selinux/package.mask | 1 + |
27 |
5 files changed, 222 insertions(+) |
28 |
|
29 |
diff --git a/games-util/gamemode/Manifest b/games-util/gamemode/Manifest |
30 |
new file mode 100644 |
31 |
index 00000000000..9efa7de80bd |
32 |
--- /dev/null |
33 |
+++ b/games-util/gamemode/Manifest |
34 |
@@ -0,0 +1 @@ |
35 |
+DIST gamemode-1.2.tar.xz 38536 BLAKE2B af39b8c0585c522afa72238b8332a6a5301d36b3c53e50652a78c41788eae9f5cb319cad06eaf6f345c50f934e188df4c78d70efbad919dd6897d3350d14e568 SHA512 233602e5e93b6cfcc742510dafb00dc826000d0c8618a693e9a579dc3b31c546d22c0545084cfb78c6085226e6b0e26c066078bc1871d36d5fb90828cf63cea9 |
36 |
|
37 |
diff --git a/games-util/gamemode/gamemode-1.2.ebuild b/games-util/gamemode/gamemode-1.2.ebuild |
38 |
new file mode 100644 |
39 |
index 00000000000..6ac471006aa |
40 |
--- /dev/null |
41 |
+++ b/games-util/gamemode/gamemode-1.2.ebuild |
42 |
@@ -0,0 +1,102 @@ |
43 |
+# Copyright 1999-2018 Gentoo Foundation |
44 |
+# Distributed under the terms of the GNU General Public License v2 |
45 |
+ |
46 |
+EAPI=6 |
47 |
+ |
48 |
+MULTILIB_COMPAT=( abi_x86_{32,64} ) |
49 |
+ |
50 |
+inherit meson multilib-minimal ninja-utils user |
51 |
+ |
52 |
+DESCRIPTION="Optimise Linux system performance on demand" |
53 |
+HOMEPAGE="https://github.com/FeralInteractive/gamemode" |
54 |
+ |
55 |
+if [[ ${PV} == "9999" ]] ; then |
56 |
+ EGIT_REPO_URI="https://github.com/FeralInteractive/gamemode.git" |
57 |
+ GAMEMODE_GIT_PTR="master" |
58 |
+ inherit git-r3 |
59 |
+else |
60 |
+ GAMEMODE_GIT_PTR="${PV}" |
61 |
+ SRC_URI="https://github.com/FeralInteractive/gamemode/releases/download/${GAMEMODE_GIT_PTR}/${P}.tar.xz" |
62 |
+ KEYWORDS="~amd64 ~x86" |
63 |
+fi |
64 |
+ |
65 |
+LICENSE="BSD" |
66 |
+SLOT="0" |
67 |
+IUSE="" |
68 |
+ |
69 |
+RDEPEND=" |
70 |
+ >=sys-apps/systemd-236[${MULTILIB_USEDEP}] |
71 |
+" |
72 |
+DEPEND="${RDEPEND}" |
73 |
+ |
74 |
+pkg_pretend() { |
75 |
+ elog |
76 |
+ elog "GameMode needs a kernel capable of SCHED_ISO to use its soft realtime" |
77 |
+ elog "feature. Examples of kernels providing that are sys-kernel/ck-source" |
78 |
+ elog "and sys-kernel/pf-sources." |
79 |
+ elog |
80 |
+ elog "Support for soft realtime is completely optional. It may provide the" |
81 |
+ elog "following benefits with systems having at least four CPU cores:" |
82 |
+ elog |
83 |
+ elog " * more CPU shares allocated exclusively to the game" |
84 |
+ elog " * reduced input lag and reduced thread latency" |
85 |
+ elog " * more consistent frame times resulting in less microstutters" |
86 |
+ elog |
87 |
+ elog "You probably won't benefit from soft realtime mode and thus don't need" |
88 |
+ elog "SCHED_ISO if:" |
89 |
+ elog |
90 |
+ elog " * Your CPU has less than four cores because the game may experience" |
91 |
+ elog " priority inversion with the graphics driver (thus heuristics" |
92 |
+ elog " automatically disable SCHED_ISO usage then)" |
93 |
+ elog " * Your game uses busy-loops to interface with the graphics driver" |
94 |
+ elog " but you may still force SCHED_ISO per configuation file, YMMV," |
95 |
+ elog " it depends on the graphics driver implementation, i.e. usage of" |
96 |
+ elog " __GL_THREADED_OPTIMIZATIONS or similar." |
97 |
+ elog " * If your game causes more than 70% CPU usage across all cores," |
98 |
+ elog " SCHED_ISO automatically turns off and on depending on usage and" |
99 |
+ elog " is processed with higher-than-normal priority then (renice)." |
100 |
+ elog " This auto-switching may result in a lesser game experience." |
101 |
+ elog |
102 |
+ elog "For more info look at:" |
103 |
+ elog "https://github.com/FeralInteractive/gamemode/blob/${GAMEMODE_GIT_PTR}/README.md" |
104 |
+ elog |
105 |
+} |
106 |
+ |
107 |
+multilib_src_configure() { |
108 |
+ local myconf=() |
109 |
+ if ! multilib_is_native_abi; then |
110 |
+ myconf+=( |
111 |
+ -Dwith-examples=false |
112 |
+ -Dwith-daemon=false |
113 |
+ ) |
114 |
+ fi |
115 |
+ meson_src_configure "${myconf[@]}" |
116 |
+} |
117 |
+ |
118 |
+multilib_src_compile() { |
119 |
+ eninja |
120 |
+} |
121 |
+ |
122 |
+multilib_src_install() { |
123 |
+ DESTDIR="${D}" eninja install |
124 |
+ insinto /etc/security/limits.d |
125 |
+ newins - 45-gamemode.conf <<-EOF |
126 |
+ @gamemode - nice -10 |
127 |
+ EOF |
128 |
+} |
129 |
+ |
130 |
+pkg_postinst() { |
131 |
+ enewgroup gamemode |
132 |
+ |
133 |
+ elog |
134 |
+ elog "GameMode can renice your games. You need to be in the gamemode group for this to work." |
135 |
+ elog "Run the following command as root to add your user:" |
136 |
+ elog "# gpasswd -a USER gamemode # with USER = your user name" |
137 |
+ elog |
138 |
+ |
139 |
+ elog "Enable and start the daemon in your systemd user instance, then add" |
140 |
+ elog "LD_PRELOAD=\$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so %command%" |
141 |
+ elog "to the start options of any steam game to enable the performance" |
142 |
+ elog "governor as you start the game." |
143 |
+ elog |
144 |
+} |
145 |
|
146 |
diff --git a/games-util/gamemode/gamemode-9999.ebuild b/games-util/gamemode/gamemode-9999.ebuild |
147 |
new file mode 100644 |
148 |
index 00000000000..6ac471006aa |
149 |
--- /dev/null |
150 |
+++ b/games-util/gamemode/gamemode-9999.ebuild |
151 |
@@ -0,0 +1,102 @@ |
152 |
+# Copyright 1999-2018 Gentoo Foundation |
153 |
+# Distributed under the terms of the GNU General Public License v2 |
154 |
+ |
155 |
+EAPI=6 |
156 |
+ |
157 |
+MULTILIB_COMPAT=( abi_x86_{32,64} ) |
158 |
+ |
159 |
+inherit meson multilib-minimal ninja-utils user |
160 |
+ |
161 |
+DESCRIPTION="Optimise Linux system performance on demand" |
162 |
+HOMEPAGE="https://github.com/FeralInteractive/gamemode" |
163 |
+ |
164 |
+if [[ ${PV} == "9999" ]] ; then |
165 |
+ EGIT_REPO_URI="https://github.com/FeralInteractive/gamemode.git" |
166 |
+ GAMEMODE_GIT_PTR="master" |
167 |
+ inherit git-r3 |
168 |
+else |
169 |
+ GAMEMODE_GIT_PTR="${PV}" |
170 |
+ SRC_URI="https://github.com/FeralInteractive/gamemode/releases/download/${GAMEMODE_GIT_PTR}/${P}.tar.xz" |
171 |
+ KEYWORDS="~amd64 ~x86" |
172 |
+fi |
173 |
+ |
174 |
+LICENSE="BSD" |
175 |
+SLOT="0" |
176 |
+IUSE="" |
177 |
+ |
178 |
+RDEPEND=" |
179 |
+ >=sys-apps/systemd-236[${MULTILIB_USEDEP}] |
180 |
+" |
181 |
+DEPEND="${RDEPEND}" |
182 |
+ |
183 |
+pkg_pretend() { |
184 |
+ elog |
185 |
+ elog "GameMode needs a kernel capable of SCHED_ISO to use its soft realtime" |
186 |
+ elog "feature. Examples of kernels providing that are sys-kernel/ck-source" |
187 |
+ elog "and sys-kernel/pf-sources." |
188 |
+ elog |
189 |
+ elog "Support for soft realtime is completely optional. It may provide the" |
190 |
+ elog "following benefits with systems having at least four CPU cores:" |
191 |
+ elog |
192 |
+ elog " * more CPU shares allocated exclusively to the game" |
193 |
+ elog " * reduced input lag and reduced thread latency" |
194 |
+ elog " * more consistent frame times resulting in less microstutters" |
195 |
+ elog |
196 |
+ elog "You probably won't benefit from soft realtime mode and thus don't need" |
197 |
+ elog "SCHED_ISO if:" |
198 |
+ elog |
199 |
+ elog " * Your CPU has less than four cores because the game may experience" |
200 |
+ elog " priority inversion with the graphics driver (thus heuristics" |
201 |
+ elog " automatically disable SCHED_ISO usage then)" |
202 |
+ elog " * Your game uses busy-loops to interface with the graphics driver" |
203 |
+ elog " but you may still force SCHED_ISO per configuation file, YMMV," |
204 |
+ elog " it depends on the graphics driver implementation, i.e. usage of" |
205 |
+ elog " __GL_THREADED_OPTIMIZATIONS or similar." |
206 |
+ elog " * If your game causes more than 70% CPU usage across all cores," |
207 |
+ elog " SCHED_ISO automatically turns off and on depending on usage and" |
208 |
+ elog " is processed with higher-than-normal priority then (renice)." |
209 |
+ elog " This auto-switching may result in a lesser game experience." |
210 |
+ elog |
211 |
+ elog "For more info look at:" |
212 |
+ elog "https://github.com/FeralInteractive/gamemode/blob/${GAMEMODE_GIT_PTR}/README.md" |
213 |
+ elog |
214 |
+} |
215 |
+ |
216 |
+multilib_src_configure() { |
217 |
+ local myconf=() |
218 |
+ if ! multilib_is_native_abi; then |
219 |
+ myconf+=( |
220 |
+ -Dwith-examples=false |
221 |
+ -Dwith-daemon=false |
222 |
+ ) |
223 |
+ fi |
224 |
+ meson_src_configure "${myconf[@]}" |
225 |
+} |
226 |
+ |
227 |
+multilib_src_compile() { |
228 |
+ eninja |
229 |
+} |
230 |
+ |
231 |
+multilib_src_install() { |
232 |
+ DESTDIR="${D}" eninja install |
233 |
+ insinto /etc/security/limits.d |
234 |
+ newins - 45-gamemode.conf <<-EOF |
235 |
+ @gamemode - nice -10 |
236 |
+ EOF |
237 |
+} |
238 |
+ |
239 |
+pkg_postinst() { |
240 |
+ enewgroup gamemode |
241 |
+ |
242 |
+ elog |
243 |
+ elog "GameMode can renice your games. You need to be in the gamemode group for this to work." |
244 |
+ elog "Run the following command as root to add your user:" |
245 |
+ elog "# gpasswd -a USER gamemode # with USER = your user name" |
246 |
+ elog |
247 |
+ |
248 |
+ elog "Enable and start the daemon in your systemd user instance, then add" |
249 |
+ elog "LD_PRELOAD=\$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so %command%" |
250 |
+ elog "to the start options of any steam game to enable the performance" |
251 |
+ elog "governor as you start the game." |
252 |
+ elog |
253 |
+} |
254 |
|
255 |
diff --git a/games-util/gamemode/metadata.xml b/games-util/gamemode/metadata.xml |
256 |
new file mode 100644 |
257 |
index 00000000000..05078a2e782 |
258 |
--- /dev/null |
259 |
+++ b/games-util/gamemode/metadata.xml |
260 |
@@ -0,0 +1,16 @@ |
261 |
+<?xml version="1.0" encoding="UTF-8"?> |
262 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
263 |
+<pkgmetadata> |
264 |
+ <maintainer type="person"> |
265 |
+ <email>hurikhan77+bgo@×××××.com</email> |
266 |
+ <name>Kai Krakow</name> |
267 |
+ </maintainer> |
268 |
+ <maintainer type="project"> |
269 |
+ <email>proxy-maint@g.o</email> |
270 |
+ <name>Proxy Maintainers</name> |
271 |
+ </maintainer> |
272 |
+ <upstream> |
273 |
+ <bugs-to>https://github.com/FeralInteractive/gamemode/issues</bugs-to> |
274 |
+ <remote-id type="github">FeralInteractive/gamemode</remote-id> |
275 |
+ </upstream> |
276 |
+</pkgmetadata> |
277 |
|
278 |
diff --git a/profiles/features/selinux/package.mask b/profiles/features/selinux/package.mask |
279 |
index 370aa149e56..0cd856701fd 100644 |
280 |
--- a/profiles/features/selinux/package.mask |
281 |
+++ b/profiles/features/selinux/package.mask |
282 |
@@ -45,3 +45,4 @@ sys-apps/dbus-broker |
283 |
>=app-admin/abrt-2.10 |
284 |
app-admin/gnome-abrt |
285 |
>=dev-libs/libreport-2.9 |
286 |
+games-util/gamemode |