SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
27
sysutils/tmux-mem-cpu-load/Makefile
Normal file
27
sysutils/tmux-mem-cpu-load/Makefile
Normal file
|
@ -0,0 +1,27 @@
|
|||
COMMENT = CPU, RAM memory, and load monitor for use with tmux(1)
|
||||
|
||||
GH_ACCOUNT = thewtex
|
||||
GH_PROJECT = tmux-mem-cpu-load
|
||||
GH_TAGNAME = v3.8.0
|
||||
|
||||
CATEGORIES = sysutils
|
||||
|
||||
MAINTAINER = Robert Nagy <robert@openbsd.org>
|
||||
|
||||
HOMEPAGE = https://github.com/thewtex/tmux-mem-cpu-load
|
||||
|
||||
# Apachev2
|
||||
PERMIT_PACKAGE = Yes
|
||||
|
||||
MODULES = devel/cmake
|
||||
|
||||
COMPILER = base-clang ports-gcc base-gcc
|
||||
|
||||
WANTLIB += c m ${COMPILER_LIBCXX}
|
||||
|
||||
post-install:
|
||||
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/tmux-mem-cpu-load/
|
||||
${INSTALL_DATA} ${WRKSRC}/README.rst \
|
||||
${PREFIX}/share/doc/tmux-mem-cpu-load/
|
||||
|
||||
.include <bsd.port.mk>
|
2
sysutils/tmux-mem-cpu-load/distinfo
Normal file
2
sysutils/tmux-mem-cpu-load/distinfo
Normal file
|
@ -0,0 +1,2 @@
|
|||
SHA256 (tmux-mem-cpu-load-3.8.0.tar.gz) = 3rm97e4qqK0OHpXaTC/9/dDSBSiKw8muQsdwzsTfZhU=
|
||||
SIZE (tmux-mem-cpu-load-3.8.0.tar.gz) = 35245
|
22
sysutils/tmux-mem-cpu-load/patches/patch-common_cpu_h
Normal file
22
sysutils/tmux-mem-cpu-load/patches/patch-common_cpu_h
Normal file
|
@ -0,0 +1,22 @@
|
|||
Fix CP_STATES definition
|
||||
|
||||
Index: common/cpu.h
|
||||
--- common/cpu.h.orig
|
||||
+++ common/cpu.h
|
||||
@@ -28,12 +28,15 @@
|
||||
#define CP_IDLE 2
|
||||
#define CP_NICE 3
|
||||
#define CP_STATES 4
|
||||
+#elif defined(__OpenBSD__)
|
||||
+ #include <sys/sched.h>
|
||||
+ #define CP_STATES CPUSTATES
|
||||
#else
|
||||
#define CP_USER 0
|
||||
#define CP_NICE 1
|
||||
#define CP_SYS 2
|
||||
|
||||
- #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
+ #if defined(__FreeBSD__) || defined(__NetBSD__)
|
||||
// *BSD or OSX
|
||||
#define CP_INTR 3
|
||||
#define CP_IDLE 4
|
32
sysutils/tmux-mem-cpu-load/patches/patch-openbsd_cpu_cc
Normal file
32
sysutils/tmux-mem-cpu-load/patches/patch-openbsd_cpu_cc
Normal file
|
@ -0,0 +1,32 @@
|
|||
Fix return type of get_cpu_count().
|
||||
|
||||
Index: openbsd/cpu.cc
|
||||
--- openbsd/cpu.cc.orig
|
||||
+++ openbsd/cpu.cc
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "error.h"
|
||||
#include "cpu.h"
|
||||
|
||||
-uint8_t get_cpu_count()
|
||||
+uint32_t get_cpu_count()
|
||||
{
|
||||
int cpu_count = 1; // default to 1
|
||||
int mib[2] = { CTL_HW, HW_NCPUONLINE };
|
||||
@@ -35,7 +35,7 @@ uint8_t get_cpu_count()
|
||||
error( "sysctl: error getting cpu count" );
|
||||
}
|
||||
|
||||
- return cpu_count;
|
||||
+ return static_cast<uint32_t>( cpu_count );
|
||||
}
|
||||
|
||||
float cpu_percentage( unsigned int cpu_usage_delay )
|
||||
@@ -54,6 +54,8 @@ float cpu_percentage( unsigned int cpu_usage_delay )
|
||||
}
|
||||
|
||||
usleep( cpu_usage_delay );
|
||||
+
|
||||
+ size = sizeof( load2 );
|
||||
|
||||
// update cpu times
|
||||
if( sysctl( cpu_ctl, 2, &load2, &size, NULL, 0 ) < 0 )
|
7
sysutils/tmux-mem-cpu-load/pkg/DESCR
Normal file
7
sysutils/tmux-mem-cpu-load/pkg/DESCR
Normal file
|
@ -0,0 +1,7 @@
|
|||
Simple, lightweight program provided for system monitoring in the status
|
||||
line of tmux.
|
||||
|
||||
The memory monitor displays the used and available memory. The CPU
|
||||
usage monitor outputs a percent CPU usage over all processors. It also
|
||||
displays a textual bar graph of the current percent usage. The system
|
||||
load average is also displayed.
|
3
sysutils/tmux-mem-cpu-load/pkg/PLIST
Normal file
3
sysutils/tmux-mem-cpu-load/pkg/PLIST
Normal file
|
@ -0,0 +1,3 @@
|
|||
@bin bin/tmux-mem-cpu-load
|
||||
share/doc/tmux-mem-cpu-load/
|
||||
share/doc/tmux-mem-cpu-load/README.rst
|
Loading…
Add table
Add a link
Reference in a new issue