Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-util/gamemode/
Date: Mon, 28 Sep 2020 11:34:35
Message-Id: 1601292779.4a975c706fc60db759e21afc764983bb9de56315.juippis@gentoo
1 commit: 4a975c706fc60db759e21afc764983bb9de56315
2 Author: Kai Krakow <kai <AT> kaishome <DOT> de>
3 AuthorDate: Sun Sep 20 11:15:29 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 28 11:32:59 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a975c70
7
8 games-util/gamemode: Bump to 1.6
9
10 Closes: https://bugs.gentoo.org/696460
11 Package-Manager: Portage-3.0.4, Repoman-3.0.1
12 Signed-off-by: Kai Krakow <kai <AT> kaishome.de>
13 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
14
15 games-util/gamemode/Manifest | 1 +
16 games-util/gamemode/gamemode-1.6.ebuild | 132 ++++++++++++++++++++++++++++++++
17 2 files changed, 133 insertions(+)
18
19 diff --git a/games-util/gamemode/Manifest b/games-util/gamemode/Manifest
20 index 9efa7de80bd..f355f07bddd 100644
21 --- a/games-util/gamemode/Manifest
22 +++ b/games-util/gamemode/Manifest
23 @@ -1 +1,2 @@
24 DIST gamemode-1.2.tar.xz 38536 BLAKE2B af39b8c0585c522afa72238b8332a6a5301d36b3c53e50652a78c41788eae9f5cb319cad06eaf6f345c50f934e188df4c78d70efbad919dd6897d3350d14e568 SHA512 233602e5e93b6cfcc742510dafb00dc826000d0c8618a693e9a579dc3b31c546d22c0545084cfb78c6085226e6b0e26c066078bc1871d36d5fb90828cf63cea9
25 +DIST gamemode-1.6.tar.xz 69916 BLAKE2B 2fbb680de4043a004a91005647208fd9ca25de250bffe97acc0cabea47dba90d1ef670478582203d616704ea1f5a771115aadef4971e1e41f078104116b08cc4 SHA512 7cb4f4dd51b35e3a0164092342be56ce70bf1a81a8ff071725b429378cf92a100e263bc33890d5f5e281ad87fb72e2f820cb716c5aedf14f387610dcb59eb690
26
27 diff --git a/games-util/gamemode/gamemode-1.6.ebuild b/games-util/gamemode/gamemode-1.6.ebuild
28 new file mode 100644
29 index 00000000000..0af83005b8c
30 --- /dev/null
31 +++ b/games-util/gamemode/gamemode-1.6.ebuild
32 @@ -0,0 +1,132 @@
33 +# Copyright 2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +MULTILIB_COMPAT=( abi_x86_{32,64} )
39 +
40 +inherit meson multilib-minimal ninja-utils systemd
41 +
42 +DESCRIPTION="Optimise Linux system performance on demand"
43 +HOMEPAGE="https://github.com/FeralInteractive/gamemode"
44 +
45 +if [[ ${PV} == "9999" ]] ; then
46 + EGIT_REPO_URI="https://github.com/FeralInteractive/gamemode.git"
47 + GAMEMODE_GIT_PTR="master"
48 + inherit git-r3
49 +else
50 + GAMEMODE_GIT_PTR="${PV}"
51 + SRC_URI="https://github.com/FeralInteractive/gamemode/releases/download/${GAMEMODE_GIT_PTR}/${P}.tar.xz"
52 + KEYWORDS="~amd64 ~x86"
53 +fi
54 +
55 +LICENSE="BSD"
56 +SLOT="0"
57 +IUSE="systemd elogind"
58 +
59 +REQUIRED_USE="^^ ( systemd elogind )"
60 +
61 +RDEPEND="
62 + acct-group/gamemode
63 + dev-libs/inih
64 + sys-apps/dbus[${MULTILIB_USEDEP},systemd(+)=,elogind(-)=]
65 + sys-auth/polkit
66 + sys-libs/libcap
67 +"
68 +DEPEND="${RDEPEND}"
69 +
70 +DOCS=(
71 + CHANGELOG.md
72 + LICENSE.txt
73 + README.md
74 + example/gamemode.ini
75 +)
76 +
77 +pkg_pretend() {
78 + elog
79 + elog "GameMode needs a kernel capable of SCHED_ISO to use its soft realtime"
80 + elog "feature. Examples of kernels providing that are sys-kernel/ck-source"
81 + elog "and sys-kernel/pf-sources."
82 + elog
83 + elog "Support for soft realtime is completely optional. It may provide the"
84 + elog "following benefits with systems having at least four CPU cores:"
85 + elog
86 + elog " * more CPU shares allocated exclusively to the game"
87 + elog " * reduced input lag and reduced thread latency"
88 + elog " * more consistent frame times resulting in less microstutters"
89 + elog
90 + elog "You probably won't benefit from soft realtime mode and thus don't need"
91 + elog "SCHED_ISO if:"
92 + elog
93 + elog " * Your CPU has less than four cores because the game may experience"
94 + elog " priority inversion with the graphics driver (thus heuristics"
95 + elog " automatically disable SCHED_ISO usage then)"
96 + elog " * Your game uses busy-loops to interface with the graphics driver"
97 + elog " but you may still force SCHED_ISO per configuation file, YMMV,"
98 + elog " it depends on the graphics driver implementation, i.e. usage of"
99 + elog " __GL_THREADED_OPTIMIZATIONS or similar."
100 + elog " * If your game causes more than 70% CPU usage across all cores,"
101 + elog " SCHED_ISO automatically turns off and on depending on usage and"
102 + elog " is processed with higher-than-normal priority then (renice)."
103 + elog " This auto-switching may result in a lesser game experience."
104 + elog
105 + elog "For more info look at:"
106 + elog "https://github.com/FeralInteractive/gamemode/blob/${GAMEMODE_GIT_PTR}/README.md"
107 + elog
108 +}
109 +
110 +multilib_src_configure() {
111 + local emesonargs=(
112 + -Dwith-sd-bus-provider=$(usex systemd "systemd" "elogind")
113 + -Dwith-systemd-user-unit-dir="$(systemd_get_userunitdir)"
114 + )
115 + if ! multilib_is_native_abi; then
116 + emesonargs+=(
117 + -Dwith-examples=false
118 + -Dwith-sd-bus-provider=no-daemon
119 + )
120 + fi
121 +
122 + meson_src_configure
123 +}
124 +
125 +multilib_src_compile() {
126 + eninja
127 +}
128 +
129 +multilib_src_install() {
130 + DESTDIR="${D}" eninja install
131 + if multilib_is_native_abi; then
132 + insinto /etc/security/limits.d
133 + newins - 45-gamemode.conf <<-EOF
134 + @gamemode - nice -10
135 + EOF
136 + fi
137 +}
138 +
139 +pkg_postinst() {
140 + elog
141 + elog "GameMode has optional support for adjusting nice and ioprio of games"
142 + elog "running with it. You may need to adjust your PAM limits to make use"
143 + elog "of this. You need to be in the gamemode group for this to work."
144 + elog
145 + elog "Run the following command as root to add your user:"
146 + elog "# gpasswd -a USER gamemode # with USER = your user name"
147 + elog
148 + elog "You can run the following command to test your settings:"
149 + elog
150 + elog "# gamemoded -t"
151 + elog
152 + elog "GameMode supports GPU optimizations. It defaults to OFF. Any"
153 + elog "damage resulting from usage of this is your own responsibility."
154 + elog
155 + elog "systemd user sessions will automatically run the daemon on demand,"
156 + elog "it does not need to be enabled explicitly. Games not supporting"
157 + elog "GameMode natively can still make use of it, just add"
158 + elog
159 + elog "gamemoderun %command%"
160 + elog
161 + elog "to the start options of any steam game to enable optimizations"
162 + elog "automatically as you start the game."
163 + elog
164 +}