FreeBSD Bugzilla – Attachment 228580 Details for
Bug 254397
sysutils/wmcpuload: revert deletion, fixed unfetchable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
wmcpuload.patch
0001-RESTORE-PORT-sysutils-wmcpuload-Resurrect-port-lcd.patch (text/plain), 5.16 KB, created by
Boris Korzun
on 2021-10-11 07:29:47 UTC
(
hide
)
Description:
wmcpuload.patch
Filename:
MIME Type:
Creator:
Boris Korzun
Created:
2021-10-11 07:29:47 UTC
Size:
5.16 KB
patch
obsolete
>From 05a9a221dc542bd3b1bd3ea68683d09346e1cb11 Mon Sep 17 00:00:00 2001 >From: Boris Korzun <korzun@miatel.ru> >Date: Mon, 11 Oct 2021 10:26:17 +0300 >Subject: [PATCH] [RESTORE PORT] sysutils/wmcpuload: Resurrect port, "lcd" > >--- > MOVED | 1 - > sysutils/Makefile | 1 + > sysutils/wmcpuload/Makefile | 32 +++++++++++ > sysutils/wmcpuload/distinfo | 2 + > .../wmcpuload/files/patch-src_cpu__freebsd.c | 57 +++++++++++++++++++ > sysutils/wmcpuload/pkg-descr | 4 ++ > 6 files changed, 96 insertions(+), 1 deletion(-) > create mode 100644 sysutils/wmcpuload/Makefile > create mode 100644 sysutils/wmcpuload/distinfo > create mode 100644 sysutils/wmcpuload/files/patch-src_cpu__freebsd.c > create mode 100644 sysutils/wmcpuload/pkg-descr > >diff --git a/MOVED b/MOVED >index 1287c0a1a27b..008a287b66c0 100644 >--- a/MOVED >+++ b/MOVED >@@ -14800,7 +14800,6 @@ sysutils/tmate-slave||2020-05-05|Has expired: Broken for more than 6 months > sysutils/tss||2020-05-05|Has expired: Broken for more than 6 months > sysutils/vstrip||2020-05-05|Has expired: Broken for more than 6 months > sysutils/watchdog||2020-05-05|Has expired: Broken for more than 6 months >-sysutils/wmcpuload||2020-05-05|Has expired: Broken for more than 6 months > sysutils/wtail||2020-05-05|Has expired: Broken for more than 6 months > textproc/csv2latex||2020-05-05|Has expired: Broken for more than 6 months > textproc/da-hyphen||2020-05-05|Has expired: Broken for more than 6 months >diff --git a/sysutils/Makefile b/sysutils/Makefile >index dd95b1febebe..e835799e41a5 100644 >--- a/sysutils/Makefile >+++ b/sysutils/Makefile >@@ -1518,6 +1518,7 @@ > SUBDIR += wmbluecpu > SUBDIR += wmbsdbatt > SUBDIR += wmcube >+ SUBDIR += wmcpuload > SUBDIR += wmdiskmon > SUBDIR += wmflame > SUBDIR += wmmemfree >diff --git a/sysutils/wmcpuload/Makefile b/sysutils/wmcpuload/Makefile >new file mode 100644 >index 000000000000..7220cfdb91a5 >--- /dev/null >+++ b/sysutils/wmcpuload/Makefile >@@ -0,0 +1,32 @@ >+# Created by: Soeren Boll Overgaard <boll@tolkien.dk> >+ >+PORTNAME= wmcpuload >+DISTVERSION= 1.1.1 >+ >+CATEGORIES= sysutils windowmaker >+MASTER_SITES= https://www.dockapps.net/download/ >+ >+MAINTAINER= xride@FreeBSD.org >+COMMENT= "lcd" dockapp for windowmaker, which displays the current cpuload >+LICENSE= GPLv2 >+ >+USES= xorg >+USE_XORG+= x11 xext xpm >+GNU_CONFIGURE= yes >+ >+PORTDOCS= ChangeLog README >+PLIST_FILES= "@(,kmem,2555) bin/wmcpuload" \ >+ man/man1/wmcpuload.1.gz >+ >+OPTIONS_DEFINE= DOCS >+ >+post-patch: >+ @${REINPLACE_CMD} '/SETGID_FLAGS=/d' ${WRKSRC}/configure >+ >+post-install: >+ @${MKDIR} ${STAGEDIR}${DOCSDIR} >+.for file in ${PORTDOCS} >+ ${INSTALL_DATA} ${WRKSRC}/${file} ${STAGEDIR}${DOCSDIR} >+.endfor >+ >+.include <bsd.port.mk> >diff --git a/sysutils/wmcpuload/distinfo b/sysutils/wmcpuload/distinfo >new file mode 100644 >index 000000000000..208a439737ce >--- /dev/null >+++ b/sysutils/wmcpuload/distinfo >@@ -0,0 +1,2 @@ >+SHA256 (wmcpuload-1.1.1.tar.gz) = 8f08b2b937db105b677a9e4df2a67259d2580071e28456c0e6cd77db15f0648c >+SIZE (wmcpuload-1.1.1.tar.gz) = 167751 >diff --git a/sysutils/wmcpuload/files/patch-src_cpu__freebsd.c b/sysutils/wmcpuload/files/patch-src_cpu__freebsd.c >new file mode 100644 >index 000000000000..058a807aee01 >--- /dev/null >+++ b/sysutils/wmcpuload/files/patch-src_cpu__freebsd.c >@@ -0,0 +1,57 @@ >+--- src/cpu_freebsd.c.orig 2016-10-20 13:55:48 UTC >++++ src/cpu_freebsd.c >+@@ -16,7 +16,8 @@ >+ #include <string.h> >+ #include "cpu.h" >+ >+-#include <kvm.h> >++#include <sys/sysctl.h> >++#include <sys/types.h> >+ #include <fcntl.h> >+ >+ #include <sys/param.h> >+@@ -27,27 +28,21 @@ >+ # include <sys/resource.h> >+ #endif /* __FreeBSD_version < 500101 */ >+ >+-static kvm_t *kd = NULL; >+-static struct nlist nlst[] = { {"_cp_time"}, {0} }; >++static int sysctl_mib[2] = { -1, -1 }; >++static size_t sysctl_len; >+ >+ void >+ cpu_init(void) >+ { >+ >+- kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open"); >++ sysctl_len = 2; >++ sysctlnametomib("kern.cp_time", sysctl_mib, &sysctl_len); >+ >+- if (kd == NULL) { >+- fprintf(stderr, "can't open kernel virtual memory"); >++ if (sysctl_mib[0] == -1) { >++ fprintf(stderr, "unknown sysctl kern.cp_time"); >+ exit(1); >+ } >+ >+- kvm_nlist(kd, nlst); >+- >+- if (nlst[0].n_type == 0) { >+- fprintf(stderr, "error extracting symbols"); >+- exit(1); >+- } >+- >+ /* drop setgid & setuid (the latter should not be there really) */ >+ seteuid(getuid()); >+ setegid(getgid()); >+@@ -66,8 +61,8 @@ cpu_get_usage(cpu_options *opts) >+ int used, total, result; >+ unsigned long int cpu_time[CPUSTATES]; >+ >+- if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time)) != >+- sizeof(cpu_time)) >++ sysctl_len = sizeof(cpu_time); >++ if (sysctl(sysctl_mib, 2, &cpu_time, &sysctl_len, NULL, 0) == -1) >+ return 0; >+ >+ /* calculate usage */ >diff --git a/sysutils/wmcpuload/pkg-descr b/sysutils/wmcpuload/pkg-descr >new file mode 100644 >index 000000000000..f52440126a82 >--- /dev/null >+++ b/sysutils/wmcpuload/pkg-descr >@@ -0,0 +1,4 @@ >+This is a port of wmcpuload, which displays the current cpu-load in a >+simulated lcd-display, which supports background lighting. >+ >+WWW: https://www.dockapps.net/wmcpuload >-- >2.32.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 254397
:
223414
|
223415
| 228580