diff --git a/sysutils/xosview/Makefile b/sysutils/xosview/Makefile index af04b4f31e34..9e7066ecafff 100644 --- a/sysutils/xosview/Makefile +++ b/sysutils/xosview/Makefile @@ -1,33 +1,33 @@ PORTNAME= xosview DISTVERSION= 1.23 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MAINTAINER= otaciliodearaujo@gmail.com COMMENT= Graphical performance meter WWW= https://www.pogo.org.uk/~mark/xosview/ LICENSE= BSD4CLAUSE GPLv2 LICENSE_COMB= multi RUN_DEPENDS= font-misc-misc>=1.1.2:x11-fonts/font-misc-misc USES= gmake xorg USE_GITHUB= yes GH_ACCOUNT= hills USE_XORG= x11 xpm MAKE_ENV= OPTFLAGS="" PLATFORM=bsd MANDIR=${MANPREFIX}/man ALL_TARGET= xosview DESKTOP_ENTRIES="XOsview" "" "" "xosview" "" "" do-configure: @${SED} -e '/CXX/s|^|#|' -e 's|/usr/local|${LOCALBASE}|' \ ${WRKSRC}/targets/freebsd > ${WRKSRC}/.config post-install: @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} @${CP} ${WRKSRC}/Xdefaults ${STAGEDIR}${PREFIX}/lib/X11/app-defaults/XOsview .include diff --git a/sysutils/xosview/files/patch-bsd_kernel.cc b/sysutils/xosview/files/patch-bsd_kernel.cc index 4fb5fe787e4f..a008568f689e 100644 --- a/sysutils/xosview/files/patch-bsd_kernel.cc +++ b/sysutils/xosview/files/patch-bsd_kernel.cc @@ -1,50 +1,78 @@ ---- bsd/kernel.cc.orig 2021-05-16 03:48:22 UTC +--- bsd/kernel.cc.orig 2020-07-11 12:10:34 UTC +++ bsd/kernel.cc @@ -48,8 +48,10 @@ static int maxcpus = 1; #include #include #include +#if defined(__amd64__) || defined(__i386__) #include #endif +#endif #if defined(XOSVIEW_NETBSD) #include -@@ -1558,6 +1560,7 @@ BSDHasBattery() { +@@ -338,15 +340,14 @@ BSDGetPageStats(uint64_t *meminfo, uint64_t *pageinfo) + u_int v_swappgsout; + } vm; + #if defined(XOSVIEW_FREEBSD) +- size_t size = sizeof(unsigned int); ++ size_t size = sizeof(u_int); ++ bzero(&vm, sizeof(vm)); + #define GET_VM_STATS(name) \ + sysctlbyname("vm.stats.vm." #name, &vm.name, &size, NULL, 0) + GET_VM_STATS(v_active_count); + GET_VM_STATS(v_inactive_count); + GET_VM_STATS(v_wire_count); +-#if __FreeBSD_version < 1200017 + GET_VM_STATS(v_cache_count); +-#endif + GET_VM_STATS(v_free_count); + GET_VM_STATS(v_page_size); + GET_VM_STATS(v_vnodepgsin); +@@ -368,9 +369,7 @@ BSDGetPageStats(uint64_t *meminfo, uint64_t *pageinfo) + meminfo[0] = (uint64_t)vm.v_active_count * vm.v_page_size; + meminfo[1] = (uint64_t)vm.v_inactive_count * vm.v_page_size; + meminfo[2] = (uint64_t)vm.v_wire_count * vm.v_page_size; +-#if __FreeBSD_version < 1200017 + meminfo[3] = (uint64_t)vm.v_cache_count * vm.v_page_size; +-#endif + meminfo[4] = (uint64_t)vm.v_free_count * vm.v_page_size; + #else /* XOSVIEW_DFBSD */ + meminfo[0] = (uint64_t)vms.v_active_count * vms.v_page_size; +@@ -1558,6 +1557,7 @@ BSDHasBattery() { #else // XOSVIEW_FREEBSD || XOSVIEW_DFBSD int fd; if ( (fd = open(ACPIDEV, O_RDONLY)) == -1 ) { + #if defined(__amd64__) || defined(__i386__) // No ACPI -> try APM if ( (fd = open(APMDEV, O_RDONLY)) == -1 ) return false; -@@ -1569,6 +1572,9 @@ BSDHasBattery() { +@@ -1569,6 +1569,9 @@ BSDHasBattery() { if (aip.ai_batt_stat == 0xff || aip.ai_batt_life == 0xff) return false; return true; + #else + return false; + #endif } union acpi_battery_ioctl_arg battio; -@@ -1717,6 +1723,7 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) +@@ -1717,6 +1720,7 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) /* Adapted from acpiconf and apm. */ int fd; if ( (fd = open(ACPIDEV, O_RDONLY)) == -1 ) { + #if defined(__amd64__) || defined(__i386__) // No ACPI -> try APM if ( (fd = open(APMDEV, O_RDONLY)) == -1 ) err(EX_OSFILE, "could not open %s or %s", ACPIDEV, APMDEV); -@@ -1740,6 +1747,10 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) +@@ -1740,6 +1744,10 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) else *state = XOSVIEW_BATT_NONE; return; + #else + *state = XOSVIEW_BATT_NONE; + return; + #endif } // ACPI union acpi_battery_ioctl_arg battio;