diff options
author | pi <pi@FreeBSD.org> | 2016-03-17 05:07:11 +0800 |
---|---|---|
committer | pi <pi@FreeBSD.org> | 2016-03-17 05:07:11 +0800 |
commit | 1944a3ab9a9b8d67345fcb6d0fce41fd07332a1a (patch) | |
tree | 504ceee394620fcf31e8c86986f6d4c8ad92b922 /sysutils | |
parent | d30d8e37bc596b0957a8eacd49e34b496540586f (diff) | |
download | freebsd-ports-gnome-1944a3ab9a9b8d67345fcb6d0fce41fd07332a1a.tar.gz freebsd-ports-gnome-1944a3ab9a9b8d67345fcb6d0fce41fd07332a1a.tar.zst freebsd-ports-gnome-1944a3ab9a9b8d67345fcb6d0fce41fd07332a1a.zip |
sysutils/htop: 2.0.0 -> 2.0.1
- Add lsof into RUN_DEPENDS
- fix CPU and memory readings
(thanks to Tim Creech, Hung-Yi Chen, Bernard Spil, Greg V)
- add battery support
(thanks to Greg V)
- Fix crash when emptying a column of meters
- Make Esc key more responsive
Submitted by: Hung-Yi Chen <gaod@hychen.org> (maintainer)
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/htop/Makefile | 9 | ||||
-rw-r--r-- | sysutils/htop/distinfo | 4 | ||||
-rw-r--r-- | sysutils/htop/files/patch-CRT.c | 11 | ||||
-rw-r--r-- | sysutils/htop/files/patch-CRT.h | 11 | ||||
-rw-r--r-- | sysutils/htop/files/patch-freebsd__Battery.c | 27 | ||||
-rw-r--r-- | sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c | 42 | ||||
-rw-r--r-- | sysutils/htop/pkg-plist | 4 |
7 files changed, 31 insertions, 77 deletions
diff --git a/sysutils/htop/Makefile b/sysutils/htop/Makefile index 79c1c94539ee..1bf84d77aebc 100644 --- a/sysutils/htop/Makefile +++ b/sysutils/htop/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= htop -PORTVERSION= 2.0.0 -PORTREVISION= 2 +PORTVERSION= 2.0.1 CATEGORIES= sysutils MAINTAINER= gaod@hychen.org @@ -11,6 +10,8 @@ COMMENT= Better top(1) - interactive process viewer LICENSE= GPLv2 +RUN_DEPENDS= lsof:${PORTSDIR}/sysutils/lsof + GNU_CONFIGURE= yes CPPFLAGS+= -I${LOCALBASE}/include LIBS+= -L${LOCALBASE}/lib -lexecinfo @@ -21,5 +22,9 @@ SHEBANG_LANG= python2 SHEBANG_FILES= scripts/MakeHeader.py USE_GITHUB= yes GH_ACCOUNT= hishamhm +PLIST_FILES= bin/htop \ + man/man1/htop.1.gz \ + share/applications/htop.desktop \ + share/pixmaps/htop.png .include <bsd.port.mk> diff --git a/sysutils/htop/distinfo b/sysutils/htop/distinfo index cc7a72aa7ba2..6cb973857b6b 100644 --- a/sysutils/htop/distinfo +++ b/sysutils/htop/distinfo @@ -1,2 +1,2 @@ -SHA256 (hishamhm-htop-2.0.0_GH0.tar.gz) = 2522a93792dfee188bfaff23f30332d1173460c95f9869588398e9bdd3a0491b -SIZE (hishamhm-htop-2.0.0_GH0.tar.gz) = 143353 +SHA256 (hishamhm-htop-2.0.1_GH0.tar.gz) = 636c1e8b703058e793e8d25423af4b74059290ef9e48fa261ba58555069517b5 +SIZE (hishamhm-htop-2.0.1_GH0.tar.gz) = 145463 diff --git a/sysutils/htop/files/patch-CRT.c b/sysutils/htop/files/patch-CRT.c new file mode 100644 index 000000000000..ec47e1db5eb6 --- /dev/null +++ b/sysutils/htop/files/patch-CRT.c @@ -0,0 +1,11 @@ +--- CRT.c.orig 2016-03-07 21:32:06 UTC ++++ CRT.c +@@ -125,7 +125,7 @@ void CRT_fatalError(const char* note) __ + + void CRT_handleSIGSEGV(int sgn); + +-#define KEY_ALT(x) KEY_F(60) + (x - 'A') ++#define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A')) + + }*/ + diff --git a/sysutils/htop/files/patch-CRT.h b/sysutils/htop/files/patch-CRT.h new file mode 100644 index 000000000000..ffbcff3cd532 --- /dev/null +++ b/sysutils/htop/files/patch-CRT.h @@ -0,0 +1,11 @@ +--- CRT.h.orig 2016-03-07 21:32:06 UTC ++++ CRT.h +@@ -115,7 +115,7 @@ void CRT_fatalError(const char* note) __ + + void CRT_handleSIGSEGV(int sgn); + +-#define KEY_ALT(x) KEY_F(60) + (x - 'A') ++#define KEY_ALT(x) (KEY_F(64 - 26) + (x - 'A')) + + + extern const char *CRT_treeStrAscii[TREE_STR_COUNT]; diff --git a/sysutils/htop/files/patch-freebsd__Battery.c b/sysutils/htop/files/patch-freebsd__Battery.c deleted file mode 100644 index 3113e7341c55..000000000000 --- a/sysutils/htop/files/patch-freebsd__Battery.c +++ /dev/null @@ -1,27 +0,0 @@ ---- freebsd/Battery.c.orig 2016-02-13 00:30:03.804015000 +0800 -+++ freebsd/Battery.c 2016-02-13 00:31:05.662396000 +0800 -@@ -6,10 +6,21 @@ - */ - - #include "BatteryMeter.h" -+#include <sys/sysctl.h> - - void Battery_getData(double* level, ACPresence* isOnAC) { -- // TODO -- *level = -1; -- *isOnAC = AC_ERROR; -+ int life; -+ size_t life_len = sizeof(life); -+ if (sysctlbyname("hw.acpi.battery.life", &life, &life_len, NULL, 0) == -1) -+ *level = -1; -+ else -+ *level = life; -+ -+ int acline; -+ size_t acline_len = sizeof(acline); -+ if (sysctlbyname("hw.acpi.acline", &acline, &acline_len, NULL, 0) == -1) -+ *isOnAC = AC_ERROR; -+ else -+ *isOnAC = acline == 0 ? AC_ABSENT : AC_PRESENT; - } - diff --git a/sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c b/sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c deleted file mode 100644 index af92b315bbda..000000000000 --- a/sysutils/htop/files/patch-freebsd__FreeBSDProcessList.c +++ /dev/null @@ -1,42 +0,0 @@ ---- freebsd/FreeBSDProcessList.c.orig 2016-02-10 12:48:39.000000000 -0800 -+++ freebsd/FreeBSDProcessList.c 2016-02-13 13:42:40.759431578 -0800 -@@ -84,6 +84,8 @@ - static int MIB_kern_cp_times[2]; - static int kernelFScale; - -+// XXX hack -+static unsigned long long int Global_totalMem; - - ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { - FreeBSDProcessList* fpl = xCalloc(1, sizeof(FreeBSDProcessList)); -@@ -301,6 +303,8 @@ - //pl->totalMem *= pageSizeKb; - sysctl(MIB_hw_physmem, 2, &(pl->totalMem), &len, NULL, 0); - pl->totalMem /= 1024; -+ // XXX hack -+ Global_totalMem = pl->totalMem; - - sysctl(MIB_vm_stats_vm_v_active_count, 4, &(fpl->memActive), &len, NULL, 0); - fpl->memActive *= pageSizeKb; -@@ -477,8 +481,9 @@ - } - - // from FreeBSD source /src/usr.bin/top/machine.c -- proc->m_size = kproc->ki_size / 1024; -- proc->m_resident = kproc->ki_rssize * pageSizeKb; -+ proc->m_size = kproc->ki_size / 1024 / pageSizeKb; -+ proc->m_resident = kproc->ki_rssize; -+ proc->percent_mem = (proc->m_resident * PAGE_SIZE_KB) / (double)(Global_totalMem) * 100.0; - proc->nlwp = kproc->ki_numthreads; - proc->time = (kproc->ki_runtime + 5000) / 10000; - -@@ -487,9 +492,6 @@ - // system idle process should own all CPU time left regardless of CPU count - if ( strcmp("idle", kproc->ki_comm) == 0 ) { - isIdleProcess = true; -- } else { -- if (cpus > 1) -- proc->percent_cpu = proc->percent_cpu / (double) cpus; - } - } - if (isIdleProcess == false && proc->percent_cpu >= 99.8) { diff --git a/sysutils/htop/pkg-plist b/sysutils/htop/pkg-plist deleted file mode 100644 index d925ab99a3b6..000000000000 --- a/sysutils/htop/pkg-plist +++ /dev/null @@ -1,4 +0,0 @@ -bin/htop -man/man1/htop.1.gz -share/applications/htop.desktop -share/pixmaps/htop.png |