summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/hddled')
-rw-r--r--app-misc/hddled/files/hddled-0.3-fix-missing-temp_failure_retry.patch19
-rw-r--r--app-misc/hddled/hddled-0.3-r1.ebuild49
-rw-r--r--app-misc/hddled/metadata.xml2
3 files changed, 69 insertions, 1 deletions
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 "hddled@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
+}
diff --git a/app-misc/hddled/metadata.xml b/app-misc/hddled/metadata.xml
index 6f49eba8f496..85e4ed814fa2 100644
--- a/app-misc/hddled/metadata.xml
+++ b/app-misc/hddled/metadata.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
</pkgmetadata>