I will post the entire process here soon but here's a quick rundown... and Coinbuck you're right, I realize that if I were able I could insert whatever I want into the code prior to compiling. As I said, you'll just have to trust me to some extent - if you can suggest a way that I can prove that there's nothing malicious in the Mac binaries please let me know and I'll be more than happy to comply. All I can do for now is give you my word that I'm not interested in doing something like that.
Ok, so brief rundown of how to do this:
[Note: Pro tip, when you're in Terminal on a Mac and you don't want to have to type a huge path in, remember you can drag folders or files into the terminal window and it'll automatically put the correct path.]
1) You need to install all of the dependencies on your computer; this includes:
- libminiupnpc
- openssl
- libboost
- libdb 4.8 (aka Berkeley DB) [Note: This is NOT the most current version.]
To install those, you'll want to install either MacPorts or HomeBrew (I prefer HomeBrew). These are essentially the Mac equivalent of "apt-get" from the Linux environment and make it easy to install packages. Then just google "homebrew libminiupnpc," etc., to get the correct syntax for installing each library (this is all done via Terminal).
2) You need to download and install the QT SDK version 4.8 and QT Creator 2.5.2. I tried doing this with the latest versions (5.0 and 2.7.3 respectively) and had a bad time.
3) Download the complete source code for the client you want to compile.
4) Open the "xxcoin-qt.pro" file (where "xx" is the name of your coin) in the root directory of the source code with QT Creator.
5) Choose "Build" and "Build xxcoin-qt." (I think I'm glossing over some steps here,... I'll edit with more info when I do the next client.)
6) Find the .app file generated by QT Creator. It should run correctly on *your* computer since you have all the dependencies installed, but it won't run on anyone else's who doesn't have them. If you don't care, then you're done at this point.
7) To make it run on other people's computers without the dependencies, you'll have to right-click the .app file you built, choose "Show Package Contents," and go into the Contents directory. Now take a look in the same directory of the Mac clients you already have (can be my mincoin one, or the official bitcoin or litecoin ones). Notice that your newly built .app is missing the "Frameworks" and "Plugins" directories under "Contents." Copy them straight over from one of the official apps. Also copy over /Contents/Resources/qt.conf to the same location in your app. Notice in /Contents/Resources the file bitcoin.icns which is the icon - you can change that to whatever icon you want.
8) Okay, now you have all the dependencies in your .app but the .app doesn't know to find them there - if you were to give this .app to someone else, it would look for them in the normal places they would be installed if that person was to use HomeBrew or MacPorts to download them. To fix this we need to use a combination of "otool" and "install_name_tool." For example, to check where the app is looking for dependencies, type in terminal:
otool -L /Applications/MinCoin-Qt.app/Contents/MacOS/MinCoin-Qt
This is assuming that you put your newly compiled app into the Applications folder. Change names and locations as needed. You should get a list of all the dependencies and their locations. Now repeat that for one of the already-built clients. Notice the difference? Instead of looking for libminiupnpc, libssl/libcrypto (part of the openssl package), and libboost in absolute paths in their installation directories, the already-built clients are pointing to "@executable_path/../Frameworks/[library file]". This tells the app to look for the library in the Frameworks directory. To make the change you execute the following:
install_name_tool -change [old path] [new path] [application location]
For example, if I were changing the libboost_thread-mt.dylib reference, and my application was in /Applications I would run:
install_name_tool -change /usr/local/lib/libboost_thread-mt.dylib @executable_path/../Frameworks/libboost_thread-mt.dylib /Applications/MinCoin-Qt.app/Contents/MacOS/MinCoin-Qt
(Obviously that example is for fixing the mincoin-qt client - you would change the name for whatever client you are fixing.)
Repeat that for each dylib that otool lists. In the end, otool -L should look identical between your freshly made app and one of the pre-built Mac ones.
That's all! I'm sure I left out some stuff, but that's the gist of it.