Opened 11 years ago

Closed 10 years ago

#42845 closed defect (fixed)

daemon @0.6.4 fails build on mavericks

Reported by: posita (Matt Bogosian) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: kurthindenburg (Kurt Hindenburg)
Port: daemon

Description

main.log attached

Attachments (2)

daemon_main.log (14.7 KB) - added by posita (Matt Bogosian) 11 years ago.
daemon-0.6.4-ignore-strlcpy-strlcat.patch (1.0 KB) - added by posita (Matt Bogosian) 11 years ago.
fix patch

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by posita (Matt Bogosian)

Attachment: daemon_main.log added

comment:1 Changed 11 years ago by posita (Matt Bogosian)

Same problem on brew:

https://github.com/Homebrew/homebrew/issues/25455

No fix there (yet) either.

comment:2 Changed 11 years ago by posita (Matt Bogosian)

After minimal investigation, it seems mavericks defines its own strlcpy and strlcat (as macros). libslack (included by daemon) has redundant definitions as C functions in slack/str.[hc]. Their implementations are guarded by #ifndef HAVE_STRLC(AT|PY) statements in str.c, but their prototype definitions are not similarly guarded in str.h.

Also, while HAVE_STRLC(AT|PY) are properly set to 1 in config.h for Darwin, config.h is not included by daemon.c before daemon.c includes slack/str.h, so even if the str.h definitions were guarded, compiling daemon.c would fail to exclude them.

Attached is a patch that addresses both of these problems, and should result in a successful build.

Last edited 11 years ago by posita (Matt Bogosian) (previous) (diff)

Changed 11 years ago by posita (Matt Bogosian)

fix patch

comment:3 Changed 11 years ago by posita (Matt Bogosian)

I managed a successful build via ports by moving the attached patch file to <[PREFIX]/var/macports/sources/rsync.macports.org/release/tarballs/ports/sysutils/daemon/files/strlcpy_strlcat.patch> and adding the following lines to the Portfile:

patchfiles strlcpy_strlcat.patch
patch.pre_args -p1

I am Portfile NOOB, but I can imitate without understanding with the best of them. :o) FYI, I have not tested this on anything other than mavericks, so I don't know if it will still build in snow leopard, lion, etc.

comment:4 Changed 11 years ago by posita (Matt Bogosian)

Looks like the patch was good enough for brew (wink, wink, nudge, nudge):

https://github.com/Homebrew/homebrew/issues/25455

comment:5 Changed 10 years ago by kurthindenburg (Kurt Hindenburg)

Cc: khindenburg@… added

Cc Me!

comment:6 Changed 10 years ago by kurthindenburg (Kurt Hindenburg)

Thanks for the research and patches - I have it working here and will commit it - need to check if it will build on older systems.

comment:7 Changed 10 years ago by kurthindenburg (Kurt Hindenburg)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.