From 8e2d8c37467e0ba93ac227b521f7f1c289ef033f Mon Sep 17 00:00:00 2001 From: jca Date: Fri, 23 Jul 2021 08:04:21 +0000 Subject: [PATCH] Restore patch to allow building on machines without apm(4) support. No bump as it doesn't change the code on platforms with apm(4) support. Fixes the build on riscv64. --- .../patch-clients_lcdproc_machine_OpenBSD_c | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 comms/lcdproc/patches/patch-clients_lcdproc_machine_OpenBSD_c diff --git a/comms/lcdproc/patches/patch-clients_lcdproc_machine_OpenBSD_c b/comms/lcdproc/patches/patch-clients_lcdproc_machine_OpenBSD_c new file mode 100644 index 00000000000..5d6387a896b --- /dev/null +++ b/comms/lcdproc/patches/patch-clients_lcdproc_machine_OpenBSD_c @@ -0,0 +1,42 @@ +$OpenBSD: patch-clients_lcdproc_machine_OpenBSD_c,v 1.5 2021/07/23 08:04:21 jca Exp $ + +Allow building on machines without apm(4) support. + +Index: clients/lcdproc/machine_OpenBSD.c +--- clients/lcdproc/machine_OpenBSD.c.orig ++++ clients/lcdproc/machine_OpenBSD.c +@@ -50,7 +50,9 @@ + #include + #include + #include ++#ifdef WITH_APM + #include ++#endif + #include + #include + +@@ -97,13 +99,16 @@ machine_close(void) + int + machine_get_battstat(int *acstat, int *battflag, int *percent) + { ++#ifdef WITH_APM + int apmd; + struct apm_power_info api; ++#endif + + *acstat = LCDP_AC_ON; + *battflag = LCDP_BATT_ABSENT; + *percent = 100; + ++#ifdef WITH_APM + if ((apmd = open("/dev/apm", O_RDONLY)) == -1) { + perror("get_battstat_open"); + return (TRUE); +@@ -150,6 +155,7 @@ machine_get_battstat(int *acstat, int *battflag, int * + *percent = api.battery_life; + + close(apmd); ++#endif + + return (TRUE); + }