commit:     87c55164677082145e716a0df4a54d816ff1f0af
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Sun May 14 09:25:25 2023 +0000
Commit:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
CommitDate: Thu May 25 07:17:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87c55164

x11-plugins/wmDownload: Fix error: call to undeclared function strtouq

Dont use strtouq while builing on non-glibc systems

Closes: https://bugs.gentoo.org/898922
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/31032
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org>

 .../wmDownload/files/wmDownload-strtouq-musl.patch | 24 ++++++++++++++
 x11-plugins/wmDownload/wmDownload-0.1.2a-r4.ebuild | 37 ++++++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/x11-plugins/wmDownload/files/wmDownload-strtouq-musl.patch 
b/x11-plugins/wmDownload/files/wmDownload-strtouq-musl.patch
new file mode 100644
index 000000000000..3a9a5d00b206
--- /dev/null
+++ b/x11-plugins/wmDownload/files/wmDownload-strtouq-musl.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/898922
+From: Brahmajit Das <brahmajit....@gmail.com>
+Date: Sun, 14 May 2023 14:39:59 +0530
+Subject: [PATCH] Don't use strtouq while building on non-glibc system
+
+Bug: https://bugs.gentoo.org/898922
+Signed-off-by: Brahmajit Das <brahmajit....@gmail.com>
+--- a/wmDownload.c
++++ b/wmDownload.c
+@@ -205,7 +205,11 @@ void checknetstats ()
+                               {
+                                       p = (char *)strtok (NULL, tokens);
+                                               
++#ifdef __GLIBC__
+                                       bytes = strtouq(p, NULL, 0);
++#else
++                                      bytes = strtoul(p, NULL, 0);
++#endif
+                                               
+                                       kbytes = (bytes == 0)?0:bytes/base;
+                                       bytes = bytes%base;
+-- 
+2.40.1
+

diff --git a/x11-plugins/wmDownload/wmDownload-0.1.2a-r4.ebuild 
b/x11-plugins/wmDownload/wmDownload-0.1.2a-r4.ebuild
new file mode 100644
index 000000000000..a71cdc57295a
--- /dev/null
+++ b/x11-plugins/wmDownload/wmDownload-0.1.2a-r4.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+DESCRIPTION="dockapp that displays how much data you've received on each eth 
and ppp device"
+SRC_URI="mirror://sourceforge/wmdownload/${P}.tar.gz"
+HOMEPAGE="http://wmdownload.sourceforge.net/";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=x11-libs/libdockapp-0.7:=
+       x11-libs/libX11
+       x11-libs/libXext
+       x11-libs/libXpm"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-makefile.patch
+       "${FILESDIR}"/${PN}-strtouq-musl.patch
+)
+DOCS=( CHANGELOG CREDITS HINTS README TODO )
+
+src_prepare() {
+       sed -e 's#<dockapp.h>#<libdockapp/dockapp.h>#' -i *.c || die
+       default
+}
+
+src_compile() {
+       emake CC="$(tc-getCC)" LIBDIR="/usr/$(get_libdir)"
+}

Reply via email to