Skip to content

Commit

Permalink
nut: fix build on legacy macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Dec 13, 2024
1 parent b2fab58 commit f537d44
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sysutils/nut/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
16 changes: 16 additions & 0 deletions sysutils/nut/files/patch-legacy-macos.diff
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit f537d44

Please sign in to comment.