commit:     5a73ea6f8e5b1dc3d10cbb7d34db4ec1bff161ae
Author:     Alfred Persson Forsberg <cat <AT> catcream <DOT> org>
AuthorDate: Tue Jul  5 17:39:16 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 01:44:23 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a73ea6f

games-util/gamemode: Fix build on musl

This simple patch includes signal.h in daemon/gamemode-context.c to fix 
building gamemode on musl
libc.

This has been tested Gentoo musl and Alpine (also Gentoo glibc to
ensure no multiple defined symbols/other errors for glibc).

> ../daemon/gamemode-context.c: In function 'game_mode_context_auto_expire':
> ../daemon/gamemode-context.c:421:29: error: implicit declaration of function 
> 'kill' [-Werror=implicit-function-declaration]
>   421 |                         if (kill(client->pid, 0) != 0) {
>       |                             ^~~~
> ../daemon/gamemode-context.c:421:29: warning: nested extern declaration of 
> 'kill' [-Wnested-externs]

https://github.com/FeralInteractive/gamemode/pull/368
Signed-off-by: Alfred Persson Forsberg <cat <AT> catcream.org>
Closes: https://github.com/gentoo/gentoo/pull/26234
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/gamemode-1.6.1-signal_h-musl.patch       | 39 ++++++++++++++++++++++
 games-util/gamemode/gamemode-1.6.1.ebuild          |  2 ++
 2 files changed, 41 insertions(+)

diff --git a/games-util/gamemode/files/gamemode-1.6.1-signal_h-musl.patch 
b/games-util/gamemode/files/gamemode-1.6.1-signal_h-musl.patch
new file mode 100644
index 000000000000..8689157969bc
--- /dev/null
+++ b/games-util/gamemode/files/gamemode-1.6.1-signal_h-musl.patch
@@ -0,0 +1,39 @@
+https://github.com/FeralInteractive/gamemode/pull/368
+
+From 4079d246805e9ce6c1f5ee49116013eb9f5225d7 Mon Sep 17 00:00:00 2001
+From: Alfred Persson Forsberg <[email protected]>
+Date: Tue, 5 Jul 2022 17:18:19 +0000
+Subject: [PATCH] Fix build on musl libc
+
+This simple patch includes signal.h in daemon/gamemode-context.c to fix 
building gamemode on musl
+libc.
+
+This has been tested Gentoo musl and Alpine (also Gentoo glibc to
+ensure no multiple defined symbols/other errors for glibc).
+
+> ../daemon/gamemode-context.c: In function 'game_mode_context_auto_expire':
+> ../daemon/gamemode-context.c:421:29: error: implicit declaration of function 
'kill' [-Werror=implicit-function-declaration]
+>   421 |                         if (kill(client->pid, 0) != 0) {
+>       |                             ^~~~
+> ../daemon/gamemode-context.c:421:29: warning: nested extern declaration of 
'kill' [-Wnested-externs]
+
+Signed-off-by: Alfred Persson Forsberg <[email protected]>
+---
+ daemon/gamemode-context.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/daemon/gamemode-context.c b/daemon/gamemode-context.c
+index 3b5a61b..feba2b1 100644
+--- a/daemon/gamemode-context.c
++++ b/daemon/gamemode-context.c
+@@ -45,6 +45,7 @@ POSSIBILITY OF SUCH DAMAGE.
+ #include <assert.h>
+ #include <fcntl.h>
+ #include <pthread.h>
++#include <signal.h>
+ #include <stdatomic.h>
+ #include <stdlib.h>
+ #include <sys/time.h>
+-- 
+2.35.1
+

diff --git a/games-util/gamemode/gamemode-1.6.1.ebuild 
b/games-util/gamemode/gamemode-1.6.1.ebuild
index 1c2a2df1c374..1db1b4752c61 100644
--- a/games-util/gamemode/gamemode-1.6.1.ebuild
+++ b/games-util/gamemode/gamemode-1.6.1.ebuild
@@ -42,6 +42,8 @@ DOCS=(
        example/gamemode.ini
 )
 
+PATCHES=( "${FILESDIR}/${PN}-1.6.1-signal_h-musl.patch" )
+
 pkg_pretend() {
        elog
        elog "GameMode needs a kernel capable of SCHED_ISO to use its soft 
realtime"

Reply via email to