From owner-svn-ports-head@freebsd.org Sat Jun 1 13:14:46 2019 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE1715BD44C; Sat, 1 Jun 2019 13:14:46 +0000 (UTC) (envelope-from koobs@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC80B8FE0B; Sat, 1 Jun 2019 13:14:45 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9588418464; Sat, 1 Jun 2019 13:14:45 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x51DEjaN083585; Sat, 1 Jun 2019 13:14:45 GMT (envelope-from koobs@FreeBSD.org) Received: (from koobs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x51DEjt8083584; Sat, 1 Jun 2019 13:14:45 GMT (envelope-from koobs@FreeBSD.org) Message-Id: <201906011314.x51DEjt8083584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: koobs set sender to koobs@FreeBSD.org using -f From: Kubilay Kocak Date: Sat, 1 Jun 2019 13:14:45 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r503234 - in head/sysutils/asmem: . files X-SVN-Group: ports-head X-SVN-Commit-Author: koobs X-SVN-Commit-Paths: in head/sysutils/asmem: . files X-SVN-Commit-Revision: 503234 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC80B8FE0B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2019 13:14:46 -0000 Author: koobs Date: Sat Jun 1 13:14:44 2019 New Revision: 503234 URL: https://svnweb.freebsd.org/changeset/ports/503234 Log: sysutils/asmem: Remove BROKEN (fix build) for FreeBSD 12/13 PR: 238273 Submitted by: lealxe Approved by: portmgr (unmaintained port) MFH: 2019Q2 Added: head/sysutils/asmem/files/patch-read__mem.c (contents, props changed) Deleted: head/sysutils/asmem/files/patch-read_mem.c Modified: head/sysutils/asmem/Makefile Modified: head/sysutils/asmem/Makefile ============================================================================== --- head/sysutils/asmem/Makefile Sat Jun 1 12:59:52 2019 (r503233) +++ head/sysutils/asmem/Makefile Sat Jun 1 13:14:44 2019 (r503234) @@ -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 Added: head/sysutils/asmem/files/patch-read__mem.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/asmem/files/patch-read__mem.c Sat Jun 1 13:14:44 2019 (r503234) @@ -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 + #include + #include + #include +@@ -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;