commit:     eb531d515eaf50be0a91564c4dd49359c7d86251
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Thu Aug  3 20:43:04 2023 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Sep  6 07:00:06 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb531d51

app-misc/hddled: Fix call to undeclared function TEMP_FAILURE_RETRY

Closes: https://bugs.gentoo.org/894550
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/32163
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 ...hddled-0.3-fix-missing-temp_failure_retry.patch | 19 +++++++++
 app-misc/hddled/hddled-0.3-r1.ebuild               | 49 ++++++++++++++++++++++
 2 files changed, 68 insertions(+)

diff --git 
a/app-misc/hddled/files/hddled-0.3-fix-missing-temp_failure_retry.patch 
b/app-misc/hddled/files/hddled-0.3-fix-missing-temp_failure_retry.patch
new file mode 100644
index 000000000000..cff8347a212a
--- /dev/null
+++ b/app-misc/hddled/files/hddled-0.3-fix-missing-temp_failure_retry.patch
@@ -0,0 +1,19 @@
+Bug: https://bugs.gentoo.org/894550
+--- a/hddled.c
++++ b/hddled.c
+@@ -43,6 +43,15 @@
+ 
+ #define PACKAGE_STRING    "hddled 0.3"
+ #define PACKAGE_BUGREPORT "hdd...@very.puzzling.org"
++/* taken from glibc unistd.h and fixes musl */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(expression) \
++  (__extension__                                                              
\
++    ({ long int __result;                                                     
\
++       do __result = (long int) (expression);                                 
\
++       while (__result == -1L && errno == EINTR);                             
\
++       __result; }))
++#endif
+ 
+ #define VMSTAT "/proc/vmstat"
+ 

diff --git a/app-misc/hddled/hddled-0.3-r1.ebuild 
b/app-misc/hddled/hddled-0.3-r1.ebuild
new file mode 100644
index 000000000000..52a7e3a46975
--- /dev/null
+++ b/app-misc/hddled/hddled-0.3-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="Show hard disk activity using the scroll lock LED"
+HOMEPAGE="http://members.optusnet.com.au/foonly/whirlpool/code/";
+SRC_URI="mirror://gentoo/${P}.c.xz"
+S="${WORKDIR}"
+
+LICENSE="Unlicense"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="X"
+
+DEPEND="X? ( x11-libs/libX11 )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.3-fix-missing-temp_failure_retry.patch"
+)
+
+src_prepare() {
+       mv ${P}.c ${PN}.c || die
+       default
+}
+
+src_compile() {
+       if use elibc_musl ; then
+               append-libs -largp
+       fi
+
+       $(tc-getCC) ${CFLAGS} ${CPPFLAGS} -o ${PN} ${PN}.c ${LDFLAGS} ${LIBS} 
|| die
+
+       if use X ; then
+               $(tc-getCC) ${CFLAGS} ${CPPFLAGS} -DX -lX11 -o x${PN} ${PN}.c 
${LDFLAGS} ${LIBS} || die
+       fi
+}
+
+src_install() {
+       dobin ${PN}
+
+       if use X ; then
+               dobin x${PN}
+               elog "X version was renamed to x${PN}"
+       fi
+}

Reply via email to