things needed to restore OS/X support
Hello. I took a look at updating Homebrew's pg_top formula to the new 4.0.0 version, but found that it's not compilable on OS/X. I suspect that this is already known, but I thought I would open a ticket to enumerate the issues in case somebody wants to take up the work.
For reference here was the original homebrew attempt (by someone else) to upgrade to 4.0.0: https://github.com/Homebrew/homebrew-core/pull/64184
Here is the PR I am currently proposing to leave homebrew on the 3.X releases for now: https://github.com/Homebrew/homebrew-core/pull/67409/files
Anyway, here are the issues I found. No promise that they're exhaustive:
- The OS-dependent files
machine/m_macosx.*
aren't found because cmake looks formachine/m_darwin.c
instead (uname -s
on OS/X returns "Darwin") So the files either need to be renamed or CMakeLists.txt needs to be adjusted - Also in CMakeLists.txt, the code that builds
sigdesc.h
assumes that the system's header files are directly in/usr/include
. With Xcode you need to look in${CMAKE_OSX_SYSROOT}/usr/include
since the header files are divided among different SDKs. - In
m_macosx.c
, the symbol namevm_stats
conflicts with the name of a function in recent SDKs. It needs to be renamed to something likevm_stats_data
in order to compile. Note that this has to be done on 3.x as well when compiling on recent versions of OS/X - More generally the
machine/m_macosx.c
file needs some work to update the APIs as already happened with the BSDs (#5 (closed), #6 (closed)) This is the point that I threw in the towel since I don't know enough about this project to confidently make the changes. -
reallocarray()
is not available on OS/X, needs a fallback torealloc()
-
tree.h
isn't part of the standard headers. The BSD licensed code can be found other places though like from https://raw.githubusercontent.com/provos/libevent-niels/master/WIN32-Code/tree.h
Anyway, hopefully if anybody makes an attempt to port 4.x to OS/X this will give them a head start.