Date: Mon, 1 Jul 2019 06:21:52 +0000 (UTC) From: Kubilay Kocak <koobs@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r505540 - in branches/2019Q2/sysutils/asmem: . files Message-ID: <201907010621.x616Lq6g036310@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: koobs Date: Mon Jul 1 06:21:52 2019 New Revision: 505540 URL: https://svnweb.freebsd.org/changeset/ports/505540 Log: MFH: r503234 sysutils/asmem: Remove BROKEN (fix build) for FreeBSD 12/13 PR: 238273 Submitted by: lealxe <lealxe yandex ru> Approved by: portmgr (unmaintained port) Approved by: ports-secteam (blanket: build fix) Added: branches/2019Q2/sysutils/asmem/files/patch-read__mem.c - copied unchanged from r503234, head/sysutils/asmem/files/patch-read__mem.c Deleted: branches/2019Q2/sysutils/asmem/files/patch-read_mem.c Modified: branches/2019Q2/sysutils/asmem/Makefile Directory Properties: branches/2019Q2/ (props changed) Modified: branches/2019Q2/sysutils/asmem/Makefile ============================================================================== --- branches/2019Q2/sysutils/asmem/Makefile Mon Jul 1 06:19:57 2019 (r505539) +++ branches/2019Q2/sysutils/asmem/Makefile Mon Jul 1 06:21:52 2019 (r505540) @@ -5,17 +5,16 @@ PORTNAME= asmem PORTVERSION= 1.12 PORTREVISION= 1 CATEGORIES= sysutils afterstep -MASTER_SITES= http://tigr.net/afterstep/download/asmem/ +MASTER_SITES= https://tigr.net/afterstep/download/asmem/ MAINTAINER= ports@FreeBSD.org COMMENT= AfterStep look-n-feel memory utilization monitor LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/LICENSE -BROKEN_FreeBSD_12= fails to compile: read_mem.c: invalid use of undefined type 'struct vmmeter' -BROKEN_FreeBSD_13= fails to compile: read_mem.c: invalid use of undefined type 'struct vmmeter' +USE_XORG= x11 ice sm x11 xext xpm -USE_XORG= xpm GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-xpm \ --with-xpm-includes=${LOCALBASE}/include \ @@ -25,9 +24,7 @@ post-build: @${LN} -sf asmem.man ${WRKSRC}/asmem.1 do-install: - (cd ${WRKSRC} && ${INSTALL_PROGRAM} asmem \ - ${STAGEDIR}${PREFIX}/bin) - (cd ${WRKSRC} && ${INSTALL_MAN} asmem.1 \ - ${STAGEDIR}${MANPREFIX}/man/man1) + ${INSTALL_PROGRAM} ${WRKSRC}/asmem ${STAGEDIR}${PREFIX}/bin + ${INSTALL_MAN} ${WRKSRC}/asmem.1 ${STAGEDIR}${MANPREFIX}/man/man1 .include <bsd.port.mk> Copied: branches/2019Q2/sysutils/asmem/files/patch-read__mem.c (from r503234, head/sysutils/asmem/files/patch-read__mem.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2019Q2/sysutils/asmem/files/patch-read__mem.c Mon Jul 1 06:21:52 2019 (r505540, copy of r503234, head/sysutils/asmem/files/patch-read__mem.c) @@ -0,0 +1,60 @@ +--- read_mem.c.orig 2007-04-12 20:38:40 UTC ++++ read_mem.c +@@ -56,6 +56,8 @@ char buf[BUFFER_LENGTH]; + // Machine dependent headers + // FreeBSD + #if defined(__FreeBSD__) ++#define _WANT_VMMETER ++#include <sys/param.h> + #include <sys/conf.h> + #include <osreldate.h> + #include <kvm.h> +@@ -336,6 +338,14 @@ void error_handle( int place, const char * message ) + int read_meminfo() { + int pagesize, pageshift; + #if __FreeBSD_version > 400000 ++ ++ /* setup pageshift */ ++ pagesize = getpagesize(); ++ pageshift = 0; ++ while (pagesize > 1) { ++ pageshift++; ++ pagesize >>= 1; ++ } + + struct kvm_swap kswap[SWAP_DEVICES]; + int i, swaps; +@@ -347,10 +357,6 @@ int read_meminfo() { + time_t current_time; + #define GETSWAP_DELAY 60 /* 1 min */ + +- /* get the info */ +- if (kvm_read(kd, cnt_offset, (int *)(&sum), sizeof(sum)) != sizeof(sum)) +- return (-1); +- + /* we obtain swap info every GETSWAP_DELAY seconds because of + * kvm_getswapinfo CPU load + */ +@@ -406,9 +412,19 @@ int read_meminfo() { + + #endif /* if __FreeBSD_version > 400000 */ + +- state.fresh.total = pagetok(sum.v_page_count); +- state.fresh.used = pagetok(sum.v_page_count-sum.v_free_count); +- state.fresh.free = pagetok(sum.v_free_count); ++ unsigned long physmem, freemem, inacmem; ++ size_t sz = sizeof(unsigned long); ++ ++ physmem = 0; ++ freemem = 0; ++ inacmem = 0; ++ sysctlbyname("hw.physmem", &physmem, &sz, NULL, 0); ++ sysctlbyname("vm.stats.vm.v_free_count", &freemem, &sz, NULL, 0); ++ sysctlbyname("vm.stats.vm.v_inactive_count", &inacmem, &sz, NULL, 0); ++ ++ state.fresh.total = physmem; ++ state.fresh.free = pagetok(freemem + inacmem); ++ state.fresh.used = physmem - pagetok(freemem + inacmem); + + state.fresh.shared = 0; /* dont know how to get these */ + state.fresh.buffers = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907010621.x616Lq6g036310>