aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtacílio de Araújo Ramos Neto <otacilio.neto@bsd.com.br>2021-05-24 00:46:29 +0000
committerLi-Wen Hsu <lwhsu@FreeBSD.org>2021-05-24 00:46:29 +0000
commitfb4bd742805ad510aa813c322045875e72f05eac (patch)
treec768192f575fc2c8169d7f80ea43a35a169f9d78
parent7ef30eed0cf6f5626f708259518981a293a7645a (diff)
downloadports-fb4bd742805ad510aa813c322045875e72f05eac.tar.gz
ports-fb4bd742805ad510aa813c322045875e72f05eac.zip
sysutils/xosview: Fix build for aarch64 and other archs
PR: 255922
-rw-r--r--sysutils/xosview/Makefile4
-rw-r--r--sysutils/xosview/files/patch-bsd_kernel.cc50
2 files changed, 51 insertions, 3 deletions
diff --git a/sysutils/xosview/Makefile b/sysutils/xosview/Makefile
index 16ab32e7e8e0..8a9a9ccd31ca 100644
--- a/sysutils/xosview/Makefile
+++ b/sysutils/xosview/Makefile
@@ -2,6 +2,7 @@
PORTNAME= xosview
DISTVERSION= 1.23
+PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= otaciliodearaujo@gmail.com
@@ -10,9 +11,6 @@ COMMENT= Graphical performance meter
LICENSE= BSD4CLAUSE GPLv2
LICENSE_COMB= multi
-ONLY_FOR_ARCHS= amd64 i386
-ONLY_FOR_ARCHS_REASON= uses x86-specific hardware resources
-
RUN_DEPENDS= font-misc-misc>=1.1.2:x11-fonts/font-misc-misc
USES= gmake xorg
diff --git a/sysutils/xosview/files/patch-bsd_kernel.cc b/sysutils/xosview/files/patch-bsd_kernel.cc
new file mode 100644
index 000000000000..4fb5fe787e4f
--- /dev/null
+++ b/sysutils/xosview/files/patch-bsd_kernel.cc
@@ -0,0 +1,50 @@
+--- bsd/kernel.cc.orig 2021-05-16 03:48:22 UTC
++++ bsd/kernel.cc
+@@ -48,8 +48,10 @@ static int maxcpus = 1;
+ #include <sys/ioctl.h>
+ #include <sys/resource.h>
+ #include <dev/acpica/acpiio.h>
++#if defined(__amd64__) || defined(__i386__)
+ #include <machine/apm_bios.h>
+ #endif
++#endif
+
+ #if defined(XOSVIEW_NETBSD)
+ #include <sys/sched.h>
+@@ -1558,6 +1560,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() {
+ 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)
+ /* 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)
+ else
+ *state = XOSVIEW_BATT_NONE;
+ return;
++ #else
++ *state = XOSVIEW_BATT_NONE;
++ return;
++ #endif
+ }
+ // ACPI
+ union acpi_battery_ioctl_arg battio;