1 |
commit: a4a19cca5de67ffb9d50c61f3fe1273dd6aa348e |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 23 04:43:49 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 23 04:43:53 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4a19cca |
7 |
|
8 |
sys-process/nmon: fix musl build |
9 |
|
10 |
Closes: https://bugs.gentoo.org/712472 |
11 |
Thanks-to: Jory A. Pratt <anarchy <AT> gentoo.org> |
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
sys-process/nmon/files/nmon-16n-musl.patch | 29 +++++++++++++++++++++++++++++ |
15 |
sys-process/nmon/nmon-16n.ebuild | 12 +++++++----- |
16 |
2 files changed, 36 insertions(+), 5 deletions(-) |
17 |
|
18 |
diff --git a/sys-process/nmon/files/nmon-16n-musl.patch b/sys-process/nmon/files/nmon-16n-musl.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..a26008cc3bf4 |
21 |
--- /dev/null |
22 |
+++ b/sys-process/nmon/files/nmon-16n-musl.patch |
23 |
@@ -0,0 +1,29 @@ |
24 |
+https://bugs.gentoo.org/712472 |
25 |
+ |
26 |
+From: Mike Crute <mike@×××××.us> |
27 |
+Date: Sun, 31 May 2020 19:26:32 +0000 |
28 |
+Subject: [PATCH] Add glibc compatibility to nmon |
29 |
+ |
30 |
+musl is missing some compatibility with glibc which this patch adds to the nmon |
31 |
+source. The fstab.h header was not used and fails to build if it's included. |
32 |
+ |
33 |
+--- a/nmon.c |
34 |
++++ b/nmon.c |
35 |
+@@ -42,6 +42,9 @@ |
36 |
+ pi_delayacct_blkio_ticks |
37 |
+ */ |
38 |
+ |
39 |
++/* Fix compatibility for glibc */ |
40 |
++#define __STRING(x) #x |
41 |
++ |
42 |
+ /* note: RAW assumes you are using the index "i" to select the CPU */ |
43 |
+ #define RAW(member) (long)((long)(p->cpuN[i].member) - (long)(q->cpuN[i].member)) |
44 |
+ #define RAWTOTAL(member) (long)((long)(p->cpu_total.member) - (long)(q->cpu_total.member)) |
45 |
+@@ -583,7 +586,6 @@ |
46 |
+ int isroot = 0; |
47 |
+ |
48 |
+ #include <mntent.h> |
49 |
+-#include <fstab.h> |
50 |
+ #include <sys/stat.h> |
51 |
+ #include <sys/statfs.h> |
52 |
+ #include <net/if.h> |
53 |
|
54 |
diff --git a/sys-process/nmon/nmon-16n.ebuild b/sys-process/nmon/nmon-16n.ebuild |
55 |
index f4d4553ac6e5..1aee09867d35 100644 |
56 |
--- a/sys-process/nmon/nmon-16n.ebuild |
57 |
+++ b/sys-process/nmon/nmon-16n.ebuild |
58 |
@@ -6,10 +6,10 @@ EAPI=8 |
59 |
inherit flag-o-matic toolchain-funcs |
60 |
|
61 |
MY_P="lmon${PV}" |
62 |
- |
63 |
-DESCRIPTION="Nigel's performance MONitor for CPU, memory, network, disks, etc..." |
64 |
+DESCRIPTION="Nigel's performance MONitor for CPU, memory, network, disks, etc" |
65 |
HOMEPAGE="http://nmon.sourceforge.net/" |
66 |
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.c" |
67 |
+S="${WORKDIR}" |
68 |
|
69 |
LICENSE="GPL-3" |
70 |
SLOT="0" |
71 |
@@ -19,7 +19,9 @@ RDEPEND="sys-libs/ncurses:=" |
72 |
DEPEND="${RDEPEND}" |
73 |
BDEPEND="virtual/pkgconfig" |
74 |
|
75 |
-S="${WORKDIR}" |
76 |
+PATCHES=( |
77 |
+ "${FILESDIR}"/${PN}-16n-musl.patch |
78 |
+) |
79 |
|
80 |
src_unpack() { |
81 |
cp "${DISTDIR}"/${MY_P}.c "${S}"/${PN}.c || die |
82 |
@@ -27,13 +29,13 @@ src_unpack() { |
83 |
|
84 |
src_configure() { |
85 |
local cflags=( |
86 |
- ## recommended by upstream to be always on |
87 |
+ # Recommended by upstream to be always on |
88 |
-DGETUSER |
89 |
-DJFS |
90 |
-DLARGEMEM |
91 |
-DKERNEL_2_6_18 |
92 |
|
93 |
- ## archs |
94 |
+ # Arches |
95 |
$(usex amd64 -DX86 '') |
96 |
$(usex x86 -DX86 '') |
97 |
$(usex arm -DARM '') |