From nobody Thu Oct 14 12:00:17 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 132981816ECF; Thu, 14 Oct 2021 12:00:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HVSdY6yS5z4jtm; Thu, 14 Oct 2021 12:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEEC112D3D; Thu, 14 Oct 2021 12:00:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19EC0Hl0009091; Thu, 14 Oct 2021 12:00:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19EC0H6E009076; Thu, 14 Oct 2021 12:00:17 GMT (envelope-from git) Date: Thu, 14 Oct 2021 12:00:17 GMT Message-Id: <202110141200.19EC0H6E009076@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Rene Ladan Subject: git: 8921a9619400 - main - sysutils/wmcpuload: revive and update to 1.1.1 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rene X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8921a96194000bc7891ed5d04053b5d5ebaf956c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/ports/commit/?id=8921a96194000bc7891ed5d04053b5d5ebaf956c commit 8921a96194000bc7891ed5d04053b5d5ebaf956c Author: Boris Korzun AuthorDate: 2021-10-14 11:54:57 +0000 Commit: Rene Ladan CommitDate: 2021-10-14 11:58:48 +0000 sysutils/wmcpuload: revive and update to 1.1.1 Pass maintainership to submitter. PR: 254397 --- MOVED | 1 - sysutils/Makefile | 1 + sysutils/wmcpuload/Makefile | 32 +++++++++++++ sysutils/wmcpuload/distinfo | 3 ++ sysutils/wmcpuload/files/patch-src_cpu__freebsd.c | 57 +++++++++++++++++++++++ sysutils/wmcpuload/pkg-descr | 4 ++ 6 files changed, 97 insertions(+), 1 deletion(-) diff --git a/MOVED b/MOVED index 3f08725ee375..cdc33649495c 100644 --- a/MOVED +++ b/MOVED @@ -14799,7 +14799,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..d788e4baecc6 --- /dev/null +++ b/sysutils/wmcpuload/Makefile @@ -0,0 +1,32 @@ +# Created by: Soeren Boll Overgaard + +PORTNAME= wmcpuload +DISTVERSION= 1.1.1 + +CATEGORIES= sysutils windowmaker +MASTER_SITES= https://www.dockapps.net/download/ + +MAINTAINER= drtr0jan@yandex.ru +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 diff --git a/sysutils/wmcpuload/distinfo b/sysutils/wmcpuload/distinfo new file mode 100644 index 000000000000..45403e11b1f2 --- /dev/null +++ b/sysutils/wmcpuload/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1634212712 +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 + #include "cpu.h" + +-#include ++#include ++#include + #include + + #include +@@ -27,27 +28,21 @@ + # include + #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