commit:     5d2a2b302b1f169bd6c0337ab8b5365300edfd46
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Mon Jun 12 11:24:17 2023 +0000
Commit:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
CommitDate: Wed Jun 14 14:10:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d2a2b30

app-admin/mcelog: Fix call to undeclared library function strncpy on musl

Closes: https://bugs.gentoo.org/894316
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/31397
Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>

 app-admin/mcelog/files/mcelog-194-musl-fix.patch | 21 +++++++++
 app-admin/mcelog/mcelog-194-r1.ebuild            | 55 ++++++++++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git a/app-admin/mcelog/files/mcelog-194-musl-fix.patch 
b/app-admin/mcelog/files/mcelog-194-musl-fix.patch
new file mode 100644
index 000000000000..6ea3c1f79303
--- /dev/null
+++ b/app-admin/mcelog/files/mcelog-194-musl-fix.patch
@@ -0,0 +1,21 @@
+https://github.com/andikleen/mcelog/pull/115
+From: Brahmajit Das <[email protected]>
+Date: Mon, 12 Jun 2023 10:56:44 +0000
+Subject: [PATCH] client: Fix build w/ musl libc
+
+Refer: https://github.com/andikleen/mcelog/pull/115
+Bug: https://bugs.gentoo.org/894316
+Signed-off-by: Brahmajit Das <[email protected]>
+--- a/client.c
++++ b/client.c
+@@ -19,6 +19,7 @@
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #include <unistd.h>
++#include <string.h>
+ #include "mcelog.h"
+ #include "client.h"
+ #include "paths.h"
+-- 
+2.41.0
+

diff --git a/app-admin/mcelog/mcelog-194-r1.ebuild 
b/app-admin/mcelog/mcelog-194-r1.ebuild
new file mode 100644
index 000000000000..07ee8eae7fe6
--- /dev/null
+++ b/app-admin/mcelog/mcelog-194-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit linux-info python-any-r1 systemd toolchain-funcs
+
+DESCRIPTION="A tool to log and decode Machine Check Exceptions"
+HOMEPAGE="http://mcelog.org/";
+SRC_URI="https://github.com/andikleen/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-mcelog )"
+DEPEND="${PYTHON_DEPS}"
+
+# TODO: add mce-inject to the tree to support test phase
+RESTRICT="test"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-194-musl-fix.patch
+       "${FILESDIR}"/${PN}-0.8_pre1-timestamp-${PN}.patch
+       "${FILESDIR}"/${PN}-129-debugflags.patch
+)
+
+pkg_pretend() {
+       if [[ ${MERGE_TYPE} != buildonly ]]; then
+               local CONFIG_CHECK="~X86_MCE"
+               kernel_is -ge 4 12 && CONFIG_CHECK+=" ~X86_MCELOG_LEGACY"
+               check_extra_config
+       fi
+}
+
+src_prepare() {
+       default
+       tc-export CC
+       python_fix_shebang genconfig.py
+}
+
+src_install() {
+       default
+
+       insinto /etc/logrotate.d/
+       newins ${PN}.logrotate ${PN}
+
+       newinitd "${FILESDIR}"/${PN}.init-r1 ${PN}
+       systemd_dounit ${PN}.service
+
+       dodoc *.pdf
+}

Reply via email to