Hello. I recently compiled 0.13rc1 on my Mac. It compiled but I came across several warnings such as the following.
qt/guiutil.cpp:810:67: warning: 'kLSSharedFileListSessionLoginItems' is deprecated: first deprecated in OS X 10.11 - Use a LaunchAgent, XPCService or the ServiceManagement APIs instead. [-Wdeprecated-declarations] LSSharedFileListRef loginItems = LSSharedFileListCreate(NULL, kLSSharedFileListSessionLoginItems, NULL);
It appears that the code used to start Core when logging into OS X is now obsolete and needs to be upgraded sooner or later. I haven't tried compiling on a 10.12 beta yet but I'm guessing it still compiles on 10.12.
Anyway, after doing some research, I found this post, which implies that Apple wants everybody to move over to the ServiceManagement framework. Said framework, according to this tutorial, seems to have the following steps.
- Create a background helper app that resides within the main app structure.
- The background app finds the main app at startup, calls the main app, and immediately terminates.
- The main app uses some roundabout calls to signal to OS X whether or not the user wishes to have the main app start at login.
src/qt/guiutil.cpp has most of the code that needs to be updated, although it appears that src/qt/notificator.cpp also needs an update. I spent a few hours last night trying to wrap my head around how Core could be updated to handle the new method. I had some success but am not totally sure how to proceed. Here's what I have so far, which is probably incomplete.
- Modify the Make system to create the helper app for Mac builds, and create it first. Due to the Mac-specific nature of the code, I'd imagine it'd just be a .h/.mm combo and perhaps some support files to assist with putting everything together.
- Compile Core with the hooks for the helper app.
- After the .app structure for Core has been built, move/copy the helper app inside Core.
- Update Core .plist files and such as needed.
- Update the cleanup code to delete any helper app copies.
The main problem I have is that, honestly, I'm not totally familiar with all the nuances of Apple's APIs. So, it's hard for me to figure out how certain things work. For example, the tutorial I linked used the Xcode GUI to do things, which I know would be frowned upon by Core devs. That's fine. I just don't know all the little things necessary to make OS X happy. The app signing nuances don't help either.
Would anybody like to lend a hand? I'm happy to work on this in my free time. I just need somebody who can provide some guidance and make sure I'm not going down a path that'll screw up things like app signing. I have a Core file guide here in case it helps. It covers the high level of what's going on with Core's files, including some of the Mac-specific stuff.
Thanks.