Opened 4 years ago

Closed 3 years ago

#49235 closed defect (fixed)

policykit 0.113 cannot be built on PPC Tiger, Mac OS X 10.4.11, because Availability.h not found

Reported by: ballapete (Peter Dyballa) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger haspatch Cc:
Port: policykit

Description

This is the failure:

polkitagenthelperprivate.c:51:26: error: Availability.h: No such file or directory
polkitagenthelperprivate.c: In function 'getdelim':

It is introduced by the patch file patch-getline.diff:

+// getline() is only available on OS X Lion and newer
+
+#ifdef __APPLE__
+#include <Availability.h>
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060

This can be avoided by adding another guard:

+#ifdef __APPLE__
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+#include <Availability.h>
+#endif
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060

Attachments (3)

main.log (267.6 KB) - added by ballapete (Peter Dyballa) 4 years ago.
main.log
patch-getline.diff-2 (1.9 KB) - added by ballapete (Peter Dyballa) 4 years ago.
Improved patch file
patch-getline.diff (1.9 KB) - added by dbevans (David B. Evans) 3 years ago.
Modified patch-getline.diff as proposed by devans

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by ballapete (Peter Dyballa)

Attachment: main.log added

main.log

Changed 4 years ago by ballapete (Peter Dyballa)

Attachment: patch-getline.diff-2 added

Improved patch file

comment:1 Changed 4 years ago by ryandesign (Ryan Schmidt)

Cc: devans@… removed
Keywords: tiger haspatch added
Owner: changed from macports-tickets@… to devans@…

comment:2 in reply to:  description ; Changed 3 years ago by dbevans (David B. Evans)

Status: newassigned
Version: 2.3.4

Replying to Peter_Dyballa@…:

This can be avoided by adding another guard:

+#ifdef __APPLE__
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+#include <Availability.h>
+#endif
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060

Yes, thanks for reminding me of this issue. But, after looking things over to refresh my memory, I would suggest a slightly different modification as follows:

+#ifdef __APPLE__
+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+#include <Availability.h>
+#else
+#include <AvailabilityMacros.h>
+#endif
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060

The rationale is that MAC_OS_X_VERSION_MIN_REQUIRED is defined in Availability.h, so using the built-in compiler preprocessor definition ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED is probably the only part that works. AvailabilityMacros.h serves the same purpose as Availability.h on the older OS versions and should be available back to 10.2 if I remember correctly.

Can you test this modification and see if it works? I'm thinking there are probably some other issues with this port on your platform as well. The pam configuration for instance. Is #45832 still an issue with 0.113? Also #49521.

Last edited 3 years ago by dbevans (David B. Evans) (previous) (diff)

comment:3 Changed 3 years ago by dbevans (David B. Evans)

Actually if MAC_OS_X_VERSION_MIN_REQUIRED is already defined for some reason, there's no need for the includes at all. Attached is my new proposed patch-getline.diff that incorporates this concept. Works on newer systems. If it works for you I'll commit the change.

Changed 3 years ago by dbevans (David B. Evans)

Attachment: patch-getline.diff added

Modified patch-getline.diff as proposed by devans

comment:4 in reply to:  2 Changed 3 years ago by ballapete (Peter Dyballa)

Replying to devans@…:

[…] I would suggest a slightly different modification as follows:

Policykit @0.113_1 builds fine with the modified patch on PPC Tiger, Mac OS X 10.4.11.

I'm thinking there are probably some other issues with this port on your platform as well. The pam configuration for instance. Is #45832 still an issue with 0.113? Also #49521.

mozjs17 @17.0.0_3 builds fine meanwhile because GCC is used for building the package. The other issue, #49521, never hit me. I'd assume dbus is referencing an old or wrong UID.

I think the tickets #49235 and #45832 can be closed now as being fixed.

comment:5 Changed 3 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

Good. Updated patch-getline.diff committed in r142728. Thanks for reporting this issue and helping getting it fixed.

Note: See TracTickets for help on using tickets.