From f537d441529df29d83ccacf9b5d0b1b9b5877547 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 13 Dec 2024 16:03:28 +0800 Subject: [PATCH] nut: fix build on legacy macOS Closes: https://trac.macports.org/ticket/71514 --- sysutils/nut/Portfile | 3 +++ sysutils/nut/files/patch-legacy-macos.diff | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 sysutils/nut/files/patch-legacy-macos.diff diff --git a/sysutils/nut/Portfile b/sysutils/nut/Portfile index 48cf774bfff62..a744c07d6e5e9 100644 --- a/sysutils/nut/Portfile +++ b/sysutils/nut/Portfile @@ -40,6 +40,9 @@ depends_lib-append port:libtool \ patchfiles dynamic_lookup-11.patch +# https://trac.macports.org/ticket/71514 +patchfiles-append patch-legacy-macos.diff + set userName _nut set groupName _nut add_users ${userName} group=${groupName} diff --git a/sysutils/nut/files/patch-legacy-macos.diff b/sysutils/nut/files/patch-legacy-macos.diff new file mode 100644 index 0000000000000..efb988a37976a --- /dev/null +++ b/sysutils/nut/files/patch-legacy-macos.diff @@ -0,0 +1,16 @@ +--- drivers/macosx-ups.c 2024-04-02 08:31:18.000000000 +0800 ++++ drivers/macosx-ups.c 2024-12-13 15:56:30.000000000 +0800 +@@ -28,6 +28,13 @@ + #include "IOKit/ps/IOPowerSources.h" + #include "IOKit/ps/IOPSKeys.h" + ++#ifndef kIOPSTypeKey ++#define kIOPSTypeKey "Type" ++#endif ++#ifndef kIOPSInternalBatteryType ++#define kIOPSInternalBatteryType "InternalBattery" ++#endif ++ + #define DRIVER_NAME "Mac OS X UPS meta-driver" + #define DRIVER_VERSION "1.41" +